VxConditionalSwitch class
Renders widgets based on switch case conditions Example:
VxConditionalSwitch.single<String>(
context: context,
valueBuilder: (BuildContext context) => mynumber,
caseBuilders: {
'One': (BuildContext context) => Text('The value is One'),
'Two': (BuildContext context) => Text('The value is Two'),
},
fallbackBuilder: (BuildContext context) => Text('None of the cases matched!'),
),
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
Static Methods
-
list<
T> ({BuildContext context, T valueBuilder(BuildContext context), Map< T, List< caseBuilders, List<Widget> Function(BuildContext context)>Widget> fallbackBuilder(BuildContext context)}) → List<Widget> -
A function which returns a
List<Widget>
[...] -
single<
T> ({BuildContext context, T valueBuilder(BuildContext context), Map< T, Widget Function(BuildContext context)> caseBuilders, Widget fallbackBuilder(BuildContext context)}) → Widget -
A function which returns a single
Widget
[...]