fix: stepper submission data

This commit is contained in:
2024-02-07 17:17:32 +07:00
parent 5e97154100
commit d672a23564
4 changed files with 14 additions and 10 deletions

View File

@@ -2,7 +2,8 @@ import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
class SubmissionDataViewModel extends ChangeNotifier {
int currentStep = 1;
static int _currentStep = 1;
int get getCurrentStep => _currentStep;
int stepAmount = 9;
bool _isEmailVerify = false;
bool get isEmailVerify => _isEmailVerify;
@@ -19,8 +20,8 @@ class SubmissionDataViewModel extends ChangeNotifier {
}
onWillPopSubmission(BuildContext context) {
if (currentStep != 1) {
currentStep--;
if (getCurrentStep != 1) {
_currentStep--;
notifyListeners();
} else {
Navigator.of(context).pop(true);
@@ -28,8 +29,8 @@ class SubmissionDataViewModel extends ChangeNotifier {
}
nextSubmission(BuildContext context) {
if (currentStep < stepAmount) {
currentStep++;
if (getCurrentStep < stepAmount) {
_currentStep++;
} else {
//ToDo : Go To next step after completing the submission
}