Skip to content

Commit 5e47ae7

Browse files
authored
chore: bump dependencies versions (#89)
* chore: update and migrate to auto_route v9.2.2 * chore: set flutter sdk version range in pubspec * ci: bump flutter version to 3.27.1 * chore: replace deprecated members after bumping flutter version to 3.27.0 * style: bump very_good_analysis version and fix linter warnings * chore: bump flutter_overlay_window version and add permissions for android 14
1 parent 52b6b49 commit 5e47ae7

File tree

28 files changed

+261
-254
lines changed

28 files changed

+261
-254
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.24.4
13+
flutter_version: 3.27.1
1414
coverage_excludes: "**/*.g.dart **/*.freezed.dart **/*.config.dart"

analysis_options.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include: package:very_good_analysis/analysis_options.4.0.0.yaml
1+
include: package:very_good_analysis/analysis_options.7.0.0.yaml
22

33
analyzer:
44
exclude:
@@ -17,3 +17,4 @@ linter:
1717
always_put_required_named_parameters_first: false
1818
no_leading_underscores_for_local_identifiers: false
1919
one_member_abstracts: false
20+
document_ignores: false

android/app/src/main/AndroidManifest.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
1010
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
1111
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
12+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
13+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
1214

1315
<uses-feature android:name="android.hardware.usb.host" />
1416
<uses-sdk android:minSdkVersion="12" />
@@ -72,6 +74,11 @@
7274
<meta-data
7375
android:name="flutterEmbedding"
7476
android:value="2" />
75-
<service android:name="flutter.overlay.window.flutter_overlay_window.OverlayService" android:exported="false" />
77+
<service android:name="flutter.overlay.window.flutter_overlay_window.OverlayService"
78+
android:exported="false"
79+
android:foregroundServiceType="specialUse">
80+
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
81+
android:value="Show overlay with main data when an external app is open"/>
82+
</service>
7683
</application>
7784
</manifest>

lib/app/overlay.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ class _OverlayGeneralStatisticsState extends State<OverlayGeneralStatistics> {
9191
child: DecoratedBox(
9292
decoration: BoxDecoration(
9393
borderRadius: const BorderRadius.all(Radius.circular(24)),
94-
color: context.colors.background.withOpacity(.5),
94+
color: context.colors.background.withValues(
95+
alpha: .5,
96+
),
9597
),
9698
child: InkWell(
9799
onTap: BgLauncher.bringAppToForeground,

lib/data/storages/developer_tools_parameters_storage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class DeveloperToolsParametersStorageImpl
3434

3535
put(devToolsParams);
3636
return Result.value(devToolsParams);
37-
} catch (e) {
37+
} on Exception catch (_) {
3838
return const Result.error(DeveloperToolsParametersReadError.noValue);
3939
}
4040
}

lib/domain/data_source/extensions/int.dart

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import 'dart:typed_data';
22

3-
import 'package:collection/collection.dart';
4-
53
extension ToBytesExtension on int {
64
Int8List get toBytesInt8 => intToBytesInt8(this);
75

@@ -27,15 +25,14 @@ extension ToBytesExtension on int {
2725
}
2826
}
2927

30-
Uint8List intToBytesUint16(int value) {
28+
Uint8List intToBytesUint16(int value, {Endian endian = Endian.little}) {
3129
final data = ByteData(Uint16List.bytesPerElement)
32-
..setUint16(0, value, Endian.little);
30+
..setUint16(0, value, endian);
3331
return data.buffer.asUint8List();
3432
}
3533

36-
Int8List intToBytesInt16(int value) {
37-
final data = ByteData(Int16List.bytesPerElement)
38-
..setInt16(0, value, Endian.little);
34+
Int8List intToBytesInt16(int value, {Endian endian = Endian.little}) {
35+
final data = ByteData(Int16List.bytesPerElement)..setInt16(0, value, endian);
3936
return data.buffer.asInt8List();
4037
}
4138

@@ -44,18 +41,12 @@ Int8List intToBytesInt8(int value) {
4441
return data.buffer.asInt8List();
4542
}
4643

47-
int uint32ToInt(List<int> bytes) {
48-
return Uint8List.fromList(bytes)
49-
.buffer
50-
.asByteData()
51-
.getUint32(0, Endian.little);
44+
int uint32ToInt(List<int> bytes, {Endian endian = Endian.little}) {
45+
return Uint8List.fromList(bytes).buffer.asByteData().getUint32(0, endian);
5246
}
5347

54-
int int32ToInt(List<int> bytes) {
55-
return Int8List.fromList(bytes)
56-
.buffer
57-
.asByteData()
58-
.getInt32(0, Endian.little);
48+
int int32ToInt(List<int> bytes, {Endian endian = Endian.little}) {
49+
return Int8List.fromList(bytes).buffer.asByteData().getInt32(0, endian);
5950
}
6051

6152
extension AsIntBytesExtension on List<int> {
@@ -96,7 +87,7 @@ extension ParseListOfIntsExtension on String {
9687
.replaceAll(',', ' ')
9788
.split(' ')
9889
.map((e) => int.tryParse(e.trim()))
99-
.whereNotNull()
90+
.nonNulls
10091
.toList();
10192
}
10293

lib/domain/data_source/models/package/data_source_incoming_package.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ abstract class DataSourceIncomingPackage<T extends BytesConvertible>
4545
static DataSourceIncomingPackage? instanceOrNUll(List<int> package) {
4646
try {
4747
return DataSourceIncomingPackage.parse(package);
48-
} catch (e) {
48+
} on Exception catch (_) {
4949
return null;
5050
}
5151
}

lib/domain/data_source/models/package/data_source_package.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ abstract class DataSourcePackage extends UnmodifiableListView<int> {
9999
final last5bits = secondConfigByte.substring(3);
100100
try {
101101
return DataSourceRequestType.fromInt(int.parse(last5bits, radix: 2));
102-
} catch (e) {
102+
} on Exception catch (_) {
103103
throw Exception('package $this');
104104
}
105105
}

lib/domain/user_defined_buttons/models/matcher.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import 'dart:typed_data';
2+
13
import 'package:flutter/widgets.dart';
2-
import 'package:pixel_app_flutter/domain/user_defined_buttons/user_defined_buttons.dart';
4+
import 'package:pixel_app_flutter/domain/data_source/extensions/int.dart';
5+
import 'package:pixel_app_flutter/domain/user_defined_buttons/user_defined_buttons.dart'
6+
hide Endian;
37
import 'package:re_seedwork/re_seedwork.dart';
48

59
sealed class Matcher<T> {
@@ -46,7 +50,15 @@ final class ColorMatcher extends Matcher<Color> {
4650
static Color _parseColor(String serialized) => Color(int.parse(serialized));
4751

4852
@override
49-
String matcherResultToSting(Color result) => '${result.value}';
53+
String matcherResultToSting(Color result) => '${uint32ToInt(
54+
[
55+
(result.a * 255).toInt(),
56+
(result.r * 255).toInt(),
57+
(result.g * 255).toInt(),
58+
(result.b * 255).toInt(),
59+
],
60+
endian: Endian.big,
61+
)}';
5062
}
5163

5264
class StringMatcher extends Matcher<String> {

lib/domain/user_defined_buttons/models/package_data_parameters.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,12 @@ extension on List<int> {
270270
big: () => insert(0, lastBytePlaceholder),
271271
little: () => add(lastBytePlaceholder),
272272
);
273-
break;
274273
case > 4 && < 8:
275274
final bytes = List.generate(8 - length, (index) => lastBytePlaceholder);
276275
endian.when(
277276
big: () => insertAll(0, bytes),
278277
little: () => addAll(bytes),
279278
);
280-
break;
281279
}
282280
}
283281
}

0 commit comments

Comments
 (0)