File tree 1 file changed +29
-11
lines changed
1 file changed +29
-11
lines changed Original file line number Diff line number Diff line change @@ -27,20 +27,38 @@ class MyHomePage extends StatefulWidget {
27
27
}
28
28
29
29
class _MyHomePageState extends State <MyHomePage > {
30
+ bool _isZerkerVisible = true ;
31
+
32
+ void _toggleZerkerVisibility () {
33
+ setState (() {
34
+ _isZerkerVisible = ! _isZerkerVisible;
35
+ });
36
+ }
37
+
30
38
@override
31
39
Widget build (BuildContext context) {
32
40
return Scaffold (
33
- appBar: AppBar (
34
- title: Text (widget.title),
35
- ),
36
- body: Center (
37
- child: Zerker (
38
- app: MyZKApp (),
39
- clip: true ,
40
- interactive: true ,
41
- width: 350 ,
42
- height: 350 ),
43
- ));
41
+ appBar: AppBar (
42
+ title: Text (widget.title),
43
+ ),
44
+ body: Center (
45
+ child: _isZerkerVisible
46
+ ? Zerker (
47
+ app: MyZKApp (),
48
+ clip: true ,
49
+ interactive: true ,
50
+ width: 350 ,
51
+ height: 350 ,
52
+ )
53
+ : Container (),
54
+ ),
55
+ floatingActionButton: FloatingActionButton (
56
+ onPressed: _toggleZerkerVisibility,
57
+ child: Icon (_isZerkerVisible ? Icons .visibility_off : Icons .visibility),
58
+ tooltip: _isZerkerVisible ? 'Hide Zerker' : 'Show Zerker' ,
59
+ ),
60
+ floatingActionButtonLocation: FloatingActionButtonLocation .startFloat,
61
+ );
44
62
}
45
63
}
46
64
You can’t perform that action at this time.
0 commit comments