progress property

SurveyProgress get progress

Implementation

class SurveyFlow{final Collection collection;late Map<String,dynamic> _answers;late List<int> _route;late List<int> _history;late int _current;SurveyFlow(this.collection,[Map<String,dynamic> answers=const{}]){_answers=routedAnswers(collection,{...answers});_route=pageRoute(collection,_answers);_current=_route.firstOrNull??0;_history=[_current];}SurveyPage get page=>_pages(collection)[_current];Map<String,dynamic> get answers=>Map.unmodifiable(_answers);SurveyProgress get progress=>SurveyProgress(_current+1,_pages(collection).length,_history.length);