fix: stepper submission data
This commit is contained in:
@@ -101,7 +101,7 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||
provider.stepAmount,
|
||||
(index) => _stepItem(
|
||||
isCurrentStep:
|
||||
provider.currentStep == index + 1,
|
||||
provider.getCurrentStep == index + 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -110,10 +110,10 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||
child: Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: _content(provider.currentStep),
|
||||
child: _content(provider.getCurrentStep),
|
||||
),
|
||||
),
|
||||
provider.currentStep == 3
|
||||
provider.getCurrentStep == 3
|
||||
? const SizedBox()
|
||||
: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user