import 'package:camera/camera.dart';
import 'package:flutter/material.dart';

class SubmissionDataViewModel extends ChangeNotifier {
  int currentStep = 1;
  int stepAmount = 9;
  bool _isEmailVerify = false;
  bool get isEmailVerify => _isEmailVerify;

  Future<List<CameraDescription>> initCamera() async {
    final cameras = await availableCameras();
    final camerasDesc = cameras;
    return camerasDesc;
  }

  submitEmail() {
    _isEmailVerify = !_isEmailVerify;
    notifyListeners();
  }

  onWillPopSubmission(BuildContext context) {
    if (currentStep != 1) {
      currentStep--;
      notifyListeners();
    } else {
      Navigator.of(context).pop(true);
    }
  }

  nextSubmission(BuildContext context) {
    if (currentStep < stepAmount) {
      currentStep++;
    } else {
      //ToDo : Go To next step after completing the submission
    }
    notifyListeners();
  }
}
