File tree 1 file changed +16
-16
lines changed
1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,9 @@ class _CodeDetailPageState extends State<CodeDetailPageWeb> {
83
83
@override
84
84
Widget build (BuildContext context) {
85
85
return new Scaffold (
86
- appBar: isLand == false
87
- ? new AppBar (
88
- title: GSYTitleBar (widget.title),
89
- )
90
- : null ,
86
+ appBar: new AppBar (
87
+ title: GSYTitleBar (widget.title),
88
+ ),
91
89
body: FutureBuilder <String >(
92
90
initialData: widget.data,
93
91
future: _getData (),
@@ -123,17 +121,19 @@ class _CodeDetailPageState extends State<CodeDetailPageWeb> {
123
121
child: Icon (
124
122
isLand ? Icons .screen_lock_landscape : Icons .screen_lock_portrait),
125
123
onPressed: () {
126
- if (isLand) {
127
- isLand = false ;
128
- SystemChrome .setPreferredOrientations ([
129
- DeviceOrientation .portraitUp,
130
- ]);
131
- } else {
132
- isLand = true ;
133
- SystemChrome .setPreferredOrientations ([
134
- DeviceOrientation .landscapeLeft,
135
- ]);
136
- }
124
+ setState (() {
125
+ if (isLand) {
126
+ isLand = ! isLand;
127
+ SystemChrome .setPreferredOrientations ([
128
+ DeviceOrientation .portraitUp,
129
+ ]);
130
+ } else {
131
+ isLand = ! isLand;
132
+ SystemChrome .setPreferredOrientations ([
133
+ DeviceOrientation .landscapeLeft,
134
+ ]);
135
+ }
136
+ });
137
137
},
138
138
),
139
139
);
You can’t perform that action at this time.
0 commit comments