Skip to content

Commit

Permalink
add IconToggle example
Browse files Browse the repository at this point in the history
  • Loading branch information
2534290808 committed Sep 5, 2019
1 parent ac95bee commit f78293c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {
bool _value = false;
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
Expand Down Expand Up @@ -87,6 +88,14 @@ class _MyHomePageState extends State<MyHomePage> {
Icon(AntDesign.getIconData("stepforward")),
Icon(FontAwesome.getIconData("glass")),
Icon(MaterialIcons.getIconData("ac-unit")),
IconToggle(
value: _value,
onChanged: (value) {
setState(() {
_value = value;
});
},
),
],
),
),
Expand Down

0 comments on commit f78293c

Please sign in to comment.