QuestionProvider class
A provider that manages the state of the questions.
accepts a parameter of type List
- Inheritance
-
- Object
- ChangeNotifier
- QuestionProvider
Constructors
-
QuestionProvider(List<
Question> _questionStructure, {dynamic leading, dynamic trailing, dynamic value})
Properties
-
expanded
→ List<
Map< Question, String?> > -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- leading ↔ dynamic
-
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trailing ↔ dynamic
-
latefinal
- value ↔ dynamic
-
latefinal
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getElementList(
) → List< FormElement> - This function returns an ordered list of questions and their respective answers, the data can be used by other widgets.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyChanges(
) → void -
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onEvent(
Map< Question, String?> questionState, String? answer) → void - This method is used to used to set the answers or states of the question cards as and when the user taps on the choices.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resetState(
) → void - The resetState() method is, as its name implies, used to revert the states of all the cards back to its default state(null).
-
setState(
Map< String, dynamic> doc) → void - This method is used to set the state of the cards containing the questions and answers.
-
toMap(
) → Map< String, dynamic> - This method returns a Map<String,String> object of the current state of the question cards. This format is useful for writing to a database eg Firestore.
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
) → bool - This function is used to validate the question cards.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited