import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; class SubmissionDataViewModel extends ChangeNotifier { static int _currentStep = 1; int get getCurrentStep => _currentStep; int stepAmount = 9; bool _isEmailVerify = false; bool get isEmailVerify => _isEmailVerify; Future> initCamera() async { final cameras = await availableCameras(); final camerasDesc = cameras; return camerasDesc; } submitEmail() { _isEmailVerify = !_isEmailVerify; notifyListeners(); } onWillPopSubmission(BuildContext context) { if (getCurrentStep != 1) { _currentStep--; notifyListeners(); } else { Navigator.of(context).pop(true); } } nextSubmission(BuildContext context) { if (getCurrentStep < stepAmount) { _currentStep++; } else { //ToDo : Go To next step after completing the submission } notifyListeners(); } }