Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reloading automatically many times using FutureBuilder #8

Open
crcaicedo opened this issue Jun 18, 2019 · 1 comment
Open

Reloading automatically many times using FutureBuilder #8

crcaicedo opened this issue Jun 18, 2019 · 1 comment

Comments

@crcaicedo
Copy link

crcaicedo commented Jun 18, 2019

I am using a FutureBuilder with the scan card method, but when I finish the scan, the scan card screen shows again, I accept the new scan, but scan card screen shows again, the cycle never finishes until I cancel the scan. This is a snippet of my code:

  Future<bool> _scanCard() async {
    bool ok = false;
    Map<String, dynamic> result = await FlutterCardIo.scanCard({
      "requireExpiry": true,
      "scanExpiry": true,
      "requireCVV": false,
      "requirePostalCode": false,
      "restrictPostalCodeToNumericOnly": false,
      "requireCardHolderName": false,
      "scanInstructions": R.s("scanCardTitle")
    });
   ok = true;
}

 @override
 Widget build(BuildContext context) {
      return FutureBuilder(future: _scanCard(),
          builder: (BuildContext context, AsyncSnapshot snapshot) {
            if (snapshot.hasData) {
              return _customBuilder(context);
            }
            else return CircularProgressIndicator();
          });
 }

I will be very thankful if anyone shares an idea or solution. Best regards.

@procedurallygenerated
Copy link
Owner

@crcaicedo Will test and fix this, It's probably too late for you but might help others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants