Skip to content

Commit 25a9d39

Browse files
chore: fix warnings and ci (#68)
ci: bump flutter version to 3.24.4 chore: migrate API to newer versions of flutter and packages, and fix warnings
1 parent ff05344 commit 25a9d39

30 files changed

+52
-58
lines changed

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ jobs:
1010
with:
1111
min_coverage: 0
1212
flutter_channel: stable
13-
flutter_version: 3.13.0
13+
flutter_version: 3.24.4
1414
coverage_excludes: "**/*.g.dart **/*.freezed.dart **/*.config.dart"

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ linter:
1414
rules:
1515
sort_pub_dependencies: false
1616
public_member_api_docs: false
17-
avoid_returning_this: false
1817
always_put_required_named_parameters_first: false
1918
no_leading_underscores_for_local_identifiers: false
19+
one_member_abstracts: false

lib/app/app.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ class _AppState extends State<App> {
6060
),
6161
builder: (context, child) {
6262
return MediaQuery(
63-
data: MediaQuery.of(context).copyWith(textScaleFactor: 1),
63+
data: MediaQuery.of(context)
64+
.copyWith(textScaler: TextScaler.noScaling),
6465
child: AppTypography(
6566
child: Screen(
6667
child: AnnotatedRegion<SystemUiOverlayStyle>(

lib/app/overlay.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'dart:async';
2-
import 'dart:ui';
32

43
import 'package:bg_launcher/bg_launcher.dart';
54
import 'package:flutter/material.dart';

lib/domain/data_source/models/data_source_device.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DataSourceDevice {
1313
final bool isBonded;
1414

1515
@override
16-
bool operator ==(dynamic other) {
16+
bool operator ==(Object other) {
1717
return other is DataSourceDevice &&
1818
name == other.name &&
1919
address == other.address &&

lib/domain/data_source/models/data_source_with_address.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DataSourceWithAddress {
1616
int get hashCode => Object.hash(dataSource.hashCode, address.hashCode);
1717

1818
@override
19-
bool operator ==(dynamic other) {
19+
bool operator ==(Object other) {
2020
return other is DataSourceWithAddress &&
2121
other.address == address &&
2222
other.dataSource == dataSource;

lib/domain/data_source/models/developer_tools_parameters.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class DeveloperToolsParameters {
101101
);
102102

103103
@override
104-
bool operator ==(dynamic other) {
104+
bool operator ==(Object other) {
105105
return other is DeveloperToolsParameters &&
106106
other.protocolVersion == protocolVersion &&
107107
other.requestsPeriodInMillis == requestsPeriodInMillis &&

lib/presentation/app/theme.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class MaterialTheme {
6363
onSecondary: colors.onPrimary,
6464
error: colors.error,
6565
onError: colors.text,
66-
background: colors.background,
67-
onBackground: colors.text,
66+
surface: colors.background,
67+
onSurface: colors.text,
6868
brightness: brightness,
6969
),
7070
primaryColor: colors.primary,
@@ -132,8 +132,8 @@ class MaterialTheme {
132132
shadowColor: Colors.transparent,
133133
padding: EdgeInsets.symmetric(horizontal: 13.si, vertical: 22.si),
134134
).copyWith(
135-
backgroundColor: MaterialStateProperty.resolveWith((states) {
136-
if (states.contains(MaterialState.selected)) {
135+
backgroundColor: WidgetStateProperty.resolveWith((states) {
136+
if (states.contains(WidgetState.selected)) {
137137
return colors.primaryAccent.withOpacity(.15);
138138
}
139139
return colors.borderAccent.withOpacity(.10);
@@ -150,7 +150,7 @@ class MaterialTheme {
150150
}
151151

152152
class ElevatedButtonBorder extends RoundedRectangleBorder
153-
implements MaterialStateOutlinedBorder {
153+
implements WidgetStateOutlinedBorder {
154154
const ElevatedButtonBorder({required this.colors});
155155

156156
@protected
@@ -161,8 +161,8 @@ class ElevatedButtonBorder extends RoundedRectangleBorder
161161
static const border = RoundedRectangleBorder(borderRadius: _borderRadius);
162162

163163
@override
164-
OutlinedBorder? resolve(Set<MaterialState> states) {
165-
if (states.contains(MaterialState.selected)) {
164+
OutlinedBorder? resolve(Set<WidgetState> states) {
165+
if (states.contains(WidgetState.selected)) {
166166
return border.copyWith(
167167
side: BorderSide(
168168
color: colors.primaryAccent,

lib/presentation/app/typography.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AppTypography extends StatelessWidget {
2525
);
2626
return MediaQuery(
2727
data: MediaQuery.of(context).copyWith(
28-
textScaleFactor: textScaleFactor,
28+
textScaler: TextScaler.linear(textScaleFactor),
2929
),
3030
child: InheritedAppTypography(
3131
textScaleFactor: textScaleFactor,

lib/presentation/screens/common/loading_screen.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class LoadingScreen extends StatelessWidget {
1212
@override
1313
Widget build(BuildContext context) {
1414
return GradientScaffold(
15-
body: WillPopScope(
16-
onWillPop: () async => popable,
15+
body: PopScope(
16+
canPop: popable,
1717
child: const Center(child: CircularProgressIndicator()),
1818
),
1919
);

0 commit comments

Comments
 (0)