Skip to content

Commit 319e35c

Browse files
committed
Updated and migrated to Flutter 2.0
1 parent 3fa3e1e commit 319e35c

File tree

5 files changed

+522
-689
lines changed

5 files changed

+522
-689
lines changed

lib/AboutPage.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class MyAppState extends State<AboutPage> {
119119
Padding(
120120
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
121121
child: Text(
122-
"Flutter: 1.22.6",
122+
"Flutter: 2.0.1",
123123
style: TextStyle(
124124
color: Theme.of(context).textTheme.bodyText1.color,
125125
),

lib/SettingsPage.dart

+60-79
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ class SettingsPageState extends State<SettingsPage> {
9191
title: Text(
9292
'Arduino LED',
9393
style: TextStyle(
94-
color:
95-
Theme.of(context).textTheme.bodyText1.color,
94+
color: Theme.of(context).textTheme.bodyText1.color,
9695
),
9796
),
9897
),
@@ -101,92 +100,74 @@ class SettingsPageState extends State<SettingsPage> {
101100
cases: [
102101
Case(
103102
buttonThema == true,
104-
builder: () => ButtonBar(
105-
buttonHeight: 40,
106-
buttonMinWidth:
107-
SizeConfig.blockSizeHorizontal * 38,
108-
alignment: MainAxisAlignment.spaceBetween,
109-
children: [
110-
OutlineButton(
111-
shape: RoundedRectangleBorder(
112-
borderRadius:
113-
BorderRadius.circular(7),
114-
),
115-
child: Text(
116-
'AAN',
117-
style: TextStyle(
118-
color: Theme.of(context)
119-
.textTheme
120-
.bodyText2
121-
.color,
103+
builder: () => Padding(
104+
padding: const EdgeInsets.all(8.0),
105+
child: Row(
106+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
107+
children: [
108+
OutlinedButton(
109+
style: OutlinedButton.styleFrom(minimumSize: Size(SizeConfig.blockSizeHorizontal * 38, 40)),
110+
child: Text(
111+
'AAN',
112+
style: TextStyle(
113+
color: Theme.of(context).textTheme.bodyText2.color,
114+
),
122115
),
116+
onPressed: () {
117+
setState(() {
118+
changeThemeToAAN();
119+
});
120+
},
123121
),
124-
onPressed: () {
125-
setState(() {
126-
changeThemeToAAN();
127-
});
128-
},
129-
),
130-
RaisedButton(
131-
shape: RoundedRectangleBorder(
132-
borderRadius:
133-
BorderRadius.circular(7),
122+
ElevatedButton(
123+
style: ElevatedButton.styleFrom(minimumSize: Size(SizeConfig.blockSizeHorizontal * 38, 40)),
124+
child: const Text('UIT'),
125+
onPressed: () {
126+
setState(() {
127+
changeThemeToUIT();
128+
});
129+
},
134130
),
135-
color: Color(0xFF3D5AFE),
136-
child: const Text('UIT'),
137-
onPressed: () {
138-
setState(() {
139-
changeThemeToUIT();
140-
});
141-
},
142-
),
143-
],
131+
],
132+
),
144133
),
145134
),
146135
Case(
147136
buttonThema == false,
148-
builder: () => ButtonBar(
149-
buttonHeight: 40,
150-
buttonMinWidth:
151-
SizeConfig.blockSizeHorizontal * 38,
152-
alignment: MainAxisAlignment.spaceBetween,
153-
children: [
154-
RaisedButton(
155-
shape: RoundedRectangleBorder(
156-
borderRadius:
157-
BorderRadius.circular(7)),
158-
color: Color(0xFF3D5AFE),
159-
child: const Text('AAN'),
160-
onPressed: () {
161-
setState(
162-
() {
163-
changeThemeToAAN();
164-
},
165-
);
166-
},
167-
),
168-
OutlineButton(
169-
shape: RoundedRectangleBorder(
170-
borderRadius:
171-
BorderRadius.circular(7)),
172-
child: Text(
173-
'UIT',
174-
style: TextStyle(
175-
color: Theme.of(context)
176-
.textTheme
177-
.bodyText2
178-
.color,
137+
builder: () => Padding(
138+
padding: const EdgeInsets.all(8.0),
139+
child: Row(
140+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
141+
children: [
142+
ElevatedButton(
143+
style: ElevatedButton.styleFrom(minimumSize: Size(SizeConfig.blockSizeHorizontal * 38, 40)),
144+
child: const Text('AAN'),
145+
onPressed: () {
146+
setState(
147+
() {
148+
changeThemeToAAN();
149+
},
150+
);
151+
},
152+
),
153+
OutlinedButton(
154+
style: OutlinedButton.styleFrom(minimumSize: Size(SizeConfig.blockSizeHorizontal * 38, 40)),
155+
child: Text(
156+
'UIT',
157+
style: TextStyle(
158+
color: Theme.of(context).textTheme.bodyText2.color,
159+
),
179160
),
161+
onPressed: () {
162+
setState(
163+
() {
164+
changeThemeToUIT();
165+
},
166+
);
167+
},
180168
),
181-
onPressed: () {
182-
setState(
183-
() {
184-
changeThemeToUIT();
185-
},
186-
);
187-
},
188-
),
189-
],
169+
],
170+
),
190171
),
191172
),
192173
],

0 commit comments

Comments
 (0)