Unable to implement ‘if int value >= 75’ then proceed to next page logic

You’re not using the parameter a, you use percentage on the if statement.

void checkpercent(int a) {
    if (a >= 75) {
          context, MaterialPageRoute(builder: (context) => const CertScreen()));

Also your int percentage = int.parse(percentController.text); at the start of main.dart should be called before the checkpercent function so it receives the latest value.

          child: const Text('Submit'),
          onPressed: () {
            int percentage = int.parse(percentController.text);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top