Skip to content

Commit fbb1d4e

Browse files
committed
Fix Dart linter issue: deprecated_member_use, dead_code, etc
1 parent d981121 commit fbb1d4e

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

flutter/lib/benchmark/state.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class BenchmarkState extends ChangeNotifier {
4949

5050
// Only if [state] == [BenchmarkStateEnum.downloading]
5151
String get loadingPath => resourceManager.loadingPath;
52+
5253
double get loadingProgress => resourceManager.loadingProgress;
5354

5455
ExtendedResult? lastResult;
@@ -226,7 +227,6 @@ class BenchmarkState extends ChangeNotifier {
226227
case true:
227228
return BenchmarkStateEnum.done;
228229
}
229-
throw StateError('unreachable');
230230
}
231231

232232
Future<void> resetBenchmarkState() async {

flutter/lib/device_info.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class DeviceInfo {
6262
String? modelName;
6363
var machine = deviceInfo.utsname.machine;
6464
modelName = deviceNames.getSingleNameFromModel(DeviceType.ios, machine);
65-
return EnvIos(
65+
return EnvIos(
6666
osVersion: Platform.operatingSystemVersion,
6767
modelCode: modelCode,
6868
modelName: modelName,

flutter/lib/ui/history/history_filter_screen.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ class DropdownOption<T> {
253253
DropdownOption(this.value, this.label);
254254

255255
@override
256-
bool operator ==(dynamic other) =>
257-
other != null && other is DropdownOption && this.value == other.value;
256+
bool operator ==(Object other) =>
257+
other is DropdownOption && this.value == other.value;
258258

259259
@override
260260
int get hashCode => value.hashCode ^ label.hashCode;

flutter/lib/ui/home/resource_loading_screen.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _ResourceLoadingScreenState extends State<ResourceLoadingScreen> {
4444
fontWeight: FontWeight.bold,
4545
color: AppColors.lightText,
4646
),
47-
textScaleFactor: 2,
47+
textScaler: const TextScaler.linear(2),
4848
),
4949
),
5050
),

flutter/lib/ui/home/result_circle.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import 'package:mlperfbench/ui/icons.dart' as app_icons;
88
class ResultCircle extends StatefulWidget {
99
final num _value;
1010

11-
ResultCircle(num value, {super.key})
12-
: _value = value.clamp(0, 1);
11+
ResultCircle(num value, {super.key}) : _value = value.clamp(0, 1);
1312

1413
@override
1514
State<ResultCircle> createState() => _ResultCircleState();

flutter/lib/ui/settings/task_config_section.dart

+4-3
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,14 @@ class _DataFolderSelectorHelper {
131131
}
132132
return ListTile(
133133
title: Text(l10n.settingsTaskDataFolderCustom),
134-
subtitle: WillPopScope(
135-
onWillPop: () async {
134+
subtitle: PopScope(
135+
canPop: false,
136+
onPopInvoked: (bool didPop) async {
137+
if (didPop) return;
136138
if (store.customDataFolder.isEmpty ||
137139
!await Directory(store.customDataFolder).exists()) {
138140
setValue(DataFolderType.default_);
139141
}
140-
return true;
141142
},
142143
child: Column(
143144
children: [pathField, dirWarning],

0 commit comments

Comments
 (0)