Skip to content

Commit 4d54140

Browse files
authored
Update libraries and fix some new lint issues (#506)
* Update libraries and fix some new lint issues. * Update flutter-version. * Add type annotations to fix lint issues.
1 parent 1d11e03 commit 4d54140

15 files changed

Lines changed: 339 additions & 221 deletions

File tree

.github/workflows/device-client.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: install flutter
1313
uses: subosito/flutter-action@v2
1414
with:
15-
flutter-version: '3.29.0'
15+
flutter-version: '3.32.6'
1616
channel: 'stable'
1717
- name: use cache
1818
uses: actions/cache@v3
@@ -43,7 +43,7 @@ jobs:
4343
- name: install flutter
4444
uses: subosito/flutter-action@v2
4545
with:
46-
flutter-version: '3.27.4'
46+
flutter-version: '3.32.6'
4747
channel: 'stable'
4848
- name: use cache
4949
uses: actions/cache@v3

.github/workflows/log_file_client.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- name: install flutter
1313
uses: subosito/flutter-action@v2
1414
with:
15-
flutter-version: '3.29.0'
15+
flutter-version: '3.32.6'
1616
channel: 'stable'
1717
- name: use cache
1818
uses: actions/cache@v3
@@ -43,7 +43,7 @@
4343
- name: install flutter
4444
uses: subosito/flutter-action@v2
4545
with:
46-
flutter-version: '3.27.4'
46+
flutter-version: '3.32.6'
4747
channel: 'stable'
4848
- name: use cache
4949
uses: actions/cache@v3

.github/workflows/log_file_server.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- name: install flutter
1313
uses: subosito/flutter-action@v2
1414
with:
15-
flutter-version: '3.29.0'
15+
flutter-version: '3.32.6'
1616
channel: 'stable'
1717
- name: use cache
1818
uses: actions/cache@v3
@@ -42,7 +42,7 @@
4242
- name: install flutter
4343
uses: subosito/flutter-action@v2
4444
with:
45-
flutter-version: '3.27.4'
45+
flutter-version: '3.32.6'
4646
channel: 'stable'
4747
- name: use cache
4848
uses: actions/cache@v3

extras/device_client/lib/view/current_data_page.dart

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,18 @@ class CurrentData extends StatelessWidget {
8484
child: Text('ON'),
8585
),
8686
],
87-
onChanged: (String? newValue) {
88-
TcInterface.instance()
87+
onChanged: (String? newValue) async {
88+
await TcInterface.instance()
8989
.put(
9090
'${appData.currentData["IPAddress"]}',
9191
'data?$key=$newValue',
9292
)
9393
.then((value) {
9494
appData.currentData = json.decode(value);
9595
});
96-
Navigator.pop(context);
96+
if (context.mounted) {
97+
Navigator.pop(context);
98+
}
9799
},
98100
)
99101
else if (key == 'HeatOrChill')
@@ -109,31 +111,35 @@ class CurrentData extends StatelessWidget {
109111
child: Text('HEAT'),
110112
),
111113
],
112-
onChanged: (String? newValue) {
113-
TcInterface.instance()
114+
onChanged: (String? newValue) async {
115+
await TcInterface.instance()
114116
.put(
115117
'${appData.currentData["IPAddress"]}',
116118
'data?$key=$newValue',
117119
)
118120
.then((value) {
119121
appData.currentData = json.decode(value);
120122
});
121-
Navigator.pop(context);
123+
if (context.mounted) {
124+
Navigator.pop(context);
125+
}
122126
},
123127
)
124128
else
125129
TextFormField(
126130
initialValue: value,
127-
onFieldSubmitted: (val) {
128-
TcInterface.instance()
131+
onFieldSubmitted: (val) async {
132+
await TcInterface.instance()
129133
.put(
130134
'${appData.currentData["IPAddress"]}',
131135
'data?$key=$val',
132136
)
133137
.then((value) {
134138
appData.currentData = json.decode(value);
135139
});
136-
Navigator.pop(context);
140+
if (context.mounted) {
141+
Navigator.pop(context);
142+
}
137143
},
138144
),
139145
const SizedBox(height: 20),
@@ -209,8 +215,8 @@ class CurrentData extends StatelessWidget {
209215
final files = uploadInput.files;
210216
final file = files![0];
211217
final dynamic reader = html.FileReader();
212-
reader.onLoadEnd.listen((e) {
213-
sendArbitraryPathString(reader.result as String, ip);
218+
reader.onLoadEnd.listen((e) async {
219+
await sendArbitraryPathString(reader.result as String, ip);
214220
});
215221
reader.readAsDataUrl(file);
216222
});

0 commit comments

Comments
 (0)