Skip to content

Commit cdc1c87

Browse files
authored
chore: use fvm in snap and actions, migrate media tray to registration (#1339)
* chore: use fvm in snap and GitHub actions, move media tray handling into registration phase * dispose * . * base: core22 * unusedsub * "flutter": "3.32.5"
1 parent 9bad2cd commit cdc1c87

25 files changed

+1078
-896
lines changed

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.32.2"
2+
"flutter": "3.32.5"
33
}

.github/workflows/ci.yaml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,36 @@ on:
44
pull_request:
55
branches: [main]
66

7-
env:
8-
FLUTTER_VERSION: '3.32.2'
97

108
jobs:
119
analyze:
1210
runs-on: ubuntu-latest
1311
steps:
1412
- uses: actions/checkout@v4
15-
- uses: subosito/flutter-action@v2
16-
with:
17-
channel: 'stable'
18-
flutter-version: ${{env.FLUTTER_VERSION}}
13+
- uses: kuhnroyal/flutter-fvm-config-action/setup@v3
1914
- run: flutter pub get
2015
- run: flutter analyze --fatal-infos
2116

2217
format:
2318
runs-on: ubuntu-latest
2419
steps:
2520
- uses: actions/checkout@v4
26-
- uses: subosito/flutter-action@v2
27-
with:
28-
channel: 'stable'
29-
flutter-version: ${{env.FLUTTER_VERSION}}
21+
- uses: kuhnroyal/flutter-fvm-config-action/setup@v3
3022
- run: flutter pub get
3123
- run: dart format --set-exit-if-changed .
3224

3325
test:
3426
runs-on: ubuntu-latest
3527
steps:
3628
- uses: actions/checkout@v4
37-
- uses: subosito/flutter-action@v2
38-
with:
39-
channel: 'stable'
40-
flutter-version: ${{env.FLUTTER_VERSION}}
29+
- uses: kuhnroyal/flutter-fvm-config-action/setup@v3
4130
- run: flutter test
4231

4332
build:
4433
runs-on: ubuntu-latest
4534
steps:
4635
- uses: actions/checkout@v4
47-
- uses: subosito/flutter-action@v2
48-
with:
49-
channel: 'stable'
50-
flutter-version: ${{env.FLUTTER_VERSION}}
36+
- uses: kuhnroyal/flutter-fvm-config-action/setup@v3
5137
- run: sudo apt update
5238
- run: sudo apt install -y clang cmake curl libgtk-3-dev ninja-build pkg-config unzip libunwind-dev libmpv-dev
5339
- run: flutter pub get

android/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
88
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
99
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
10-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
11-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
12-
android:maxSdkVersion="29" />
1310
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
1411
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
1512
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />

lib/app/view/musicpod.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class _MusicPodState extends State<MusicPod> {
3636
return FutureBuilder(
3737
key: key,
3838
future: _allReady,
39-
builder: (context, snapshot) => snapshot.hasData
39+
builder: (context, snapshot) => snapshot.hasError
40+
? SplashScreen(body: Center(child: Text(snapshot.error.toString())))
41+
: snapshot.hasData
4042
? isLinux
4143
? GtkApplication(
4244
onCommandLine: (args) =>

lib/app/view/splash_screen.dart

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import '../../l10n/app_localizations.dart';
88
import '../../l10n/l10n.dart';
99

1010
class SplashScreen extends StatelessWidget {
11-
const SplashScreen({super.key});
11+
const SplashScreen({super.key, this.body});
12+
13+
final Widget? body;
1214

1315
@override
1416
Widget build(BuildContext context) => MaterialApp(
@@ -27,24 +29,26 @@ class SplashScreen extends StatelessWidget {
2729
border: BorderSide.none,
2830
backgroundColor: Colors.transparent,
2931
),
30-
body: Center(
31-
child: SingleChildScrollView(
32-
child: Center(
33-
child: Column(
34-
mainAxisSize: MainAxisSize.min,
35-
children: [
36-
Image.asset('assets/icon.png', height: 250, width: 250),
37-
Padding(
38-
padding: const EdgeInsets.all(20),
39-
child: isLinux
40-
? const YaruCircularProgressIndicator()
41-
: const CircularProgressIndicator.adaptive(),
32+
body:
33+
body ??
34+
Center(
35+
child: SingleChildScrollView(
36+
child: Center(
37+
child: Column(
38+
mainAxisSize: MainAxisSize.min,
39+
children: [
40+
Image.asset('assets/icon.png', height: 250, width: 250),
41+
Padding(
42+
padding: const EdgeInsets.all(20),
43+
child: isLinux
44+
? const YaruCircularProgressIndicator()
45+
: const CircularProgressIndicator.adaptive(),
46+
),
47+
],
4248
),
43-
],
49+
),
4450
),
4551
),
46-
),
47-
),
4852
),
4953
);
5054
}
Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
import 'package:flutter/foundation.dart';
1+
import 'dart:io';
22

3-
extension TagetPlatformX on TargetPlatform {
4-
bool get isIOS => this == TargetPlatform.iOS;
5-
bool get isAndroid => this == TargetPlatform.android;
6-
bool get isFuchsia => this == TargetPlatform.fuchsia;
7-
bool get isMacOS => this == TargetPlatform.macOS;
8-
bool get isWindows => this == TargetPlatform.windows;
9-
bool get isLinux => this == TargetPlatform.linux;
10-
bool get isDesktop => isMacOS || isWindows || isLinux;
11-
bool get isMobile => isIOS || isAndroid || isFuchsia;
12-
}
3+
import 'package:flutter/foundation.dart';
134

14-
bool get isDesktop => defaultTargetPlatform.isDesktop;
15-
bool get isMobile => defaultTargetPlatform.isMobile;
16-
bool get isLinux => defaultTargetPlatform.isLinux;
17-
bool get isMacOS => defaultTargetPlatform.isMacOS;
18-
bool get isWindows => defaultTargetPlatform.isWindows;
19-
bool get isIOS => defaultTargetPlatform.isIOS;
20-
bool get isAndroid => defaultTargetPlatform.isAndroid;
21-
bool get isFuchsia => defaultTargetPlatform.isFuchsia;
5+
bool get isDesktop => !kIsWeb && !isMobile;
6+
bool get isMobile => !kIsWeb && (isIOS || isAndroid || isFuchsia);
7+
bool get isLinux => !kIsWeb && Platform.isLinux;
8+
bool get isMacOS => !kIsWeb && Platform.isMacOS;
9+
bool get isWindows => !kIsWeb && Platform.isWindows;
10+
bool get isIOS => !kIsWeb && Platform.isIOS;
11+
bool get isAndroid => !kIsWeb && Platform.isAndroid;
12+
bool get isFuchsia => !kIsWeb && Platform.isFuchsia;

lib/external_path/external_path_service.dart

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,14 @@ class ExternalPathService {
5252
return [];
5353
}
5454

55-
Future<bool> _androidPermissionsGranted() async {
56-
final mediaLibraryIsGranted =
57-
(await Permission.mediaLibrary
58-
.onDeniedCallback(() {})
59-
.onGrantedCallback(() {})
60-
.onPermanentlyDeniedCallback(() {})
61-
.onRestrictedCallback(() {})
62-
.onLimitedCallback(() {})
63-
.onProvisionalCallback(() {})
64-
.request())
65-
.isGranted;
66-
67-
final manageExternalStorageIsGranted =
68-
(await Permission.manageExternalStorage
69-
.onDeniedCallback(() {})
70-
.onGrantedCallback(() {})
71-
.onPermanentlyDeniedCallback(() {})
72-
.onRestrictedCallback(() {})
73-
.onLimitedCallback(() {})
74-
.onProvisionalCallback(() {})
75-
.request())
76-
.isGranted;
77-
78-
return mediaLibraryIsGranted && manageExternalStorageIsGranted;
79-
}
55+
Future<bool> _androidPermissionsGranted() async =>
56+
(await Permission.audio
57+
.onDeniedCallback(() {})
58+
.onGrantedCallback(() {})
59+
.onPermanentlyDeniedCallback(() {})
60+
.onRestrictedCallback(() {})
61+
.onLimitedCallback(() {})
62+
.onProvisionalCallback(() {})
63+
.request())
64+
.isGranted;
8065
}

lib/l10n/app_localizations_pl.dart

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class AppLocalizationsPl extends AppLocalizations {
2121
String get stop => 'Stop';
2222

2323
@override
24-
String get shuffle => 'Shuffle';
24+
String get shuffle => 'Losowo';
2525

2626
@override
27-
String get repeat => 'Repeat';
27+
String get repeat => 'Powtarzaj';
2828

2929
@override
3030
String get repeatAll => 'Repeat All';
@@ -63,10 +63,10 @@ class AppLocalizationsPl extends AppLocalizations {
6363
String get removeFromFavorites => 'Remove from favorites';
6464

6565
@override
66-
String get share => 'Share';
66+
String get share => 'Udostępnij';
6767

6868
@override
69-
String get local => 'Local';
69+
String get local => 'Lokalne';
7070

7171
@override
7272
String get localAudio => 'Lokalne pliki audio';
@@ -135,7 +135,7 @@ class AppLocalizationsPl extends AppLocalizations {
135135
String get titles => 'Tytuły';
136136

137137
@override
138-
String get description => 'Description';
138+
String get description => 'Opis';
139139

140140
@override
141141
String get artist => 'Artysta';
@@ -312,7 +312,7 @@ class AppLocalizationsPl extends AppLocalizations {
312312
String get station => 'Stacja';
313313

314314
@override
315-
String get stations => 'Stations';
315+
String get stations => 'Stacje';
316316

317317
@override
318318
String get country => 'Kraj';
@@ -468,7 +468,7 @@ class AppLocalizationsPl extends AppLocalizations {
468468
String get confirm => 'Confirm';
469469

470470
@override
471-
String get confirmation => 'Confirmation';
471+
String get confirmation => 'Potwierdzenie';
472472

473473
@override
474474
String get isMaybeLowBandwidthDialogTitle => 'No WIFI/Ethernet';
@@ -932,7 +932,7 @@ class AppLocalizationsPl extends AppLocalizations {
932932
String get reorder => 'Reorder';
933933

934934
@override
935-
String get move => 'Move';
935+
String get move => 'Przenieś';
936936

937937
@override
938938
String get pinAlbum => 'Pin album to sidebar';
@@ -973,7 +973,7 @@ class AppLocalizationsPl extends AppLocalizations {
973973
String get podcastName => 'Podcast name';
974974

975975
@override
976-
String get url => 'Url';
976+
String get url => 'Adres URL';
977977

978978
@override
979979
String get loadFromFileOptional => 'Load from file (optional)';
@@ -1040,7 +1040,7 @@ class AppLocalizationsPl extends AppLocalizations {
10401040
'Set playlist name and add more titles later';
10411041

10421042
@override
1043-
String get or => 'or';
1043+
String get or => 'lub';
10441044

10451045
@override
10461046
String get loadMore => 'Load more';
@@ -1061,7 +1061,7 @@ class AppLocalizationsPl extends AppLocalizations {
10611061
String get language => 'Język';
10621062

10631063
@override
1064-
String get duration => 'Duration';
1064+
String get duration => 'Czas trwania';
10651065

10661066
@override
10671067
String get radioTagDisclaimerTitle => 'This station sends a lot of tags.';
@@ -1190,7 +1190,7 @@ class AppLocalizationsPl extends AppLocalizations {
11901190
'Ta funkcja jest aktualnie niedostępna dla tego systemu operacyjnego.';
11911191

11921192
@override
1193-
String get regionNone => 'None';
1193+
String get regionNone => 'Żaden';
11941194

11951195
@override
11961196
String get regionAfghanistan => 'Afganistan';
@@ -1202,13 +1202,13 @@ class AppLocalizationsPl extends AppLocalizations {
12021202
String get regionAlbania => 'Albania';
12031203

12041204
@override
1205-
String get regionAlgeria => 'Algeria';
1205+
String get regionAlgeria => 'Algieria';
12061206

12071207
@override
12081208
String get regionAmericansamoa => 'Americansamoa';
12091209

12101210
@override
1211-
String get regionAndorra => 'Andorra';
1211+
String get regionAndorra => 'Andora';
12121212

12131213
@override
12141214
String get regionAngolia => 'Angolia';
@@ -1978,7 +1978,7 @@ class AppLocalizationsPl extends AppLocalizations {
19781978
String get pinnedAlbums => 'Pinned albums';
19791979

19801980
@override
1981-
String get export => 'Export';
1981+
String get export => 'Eksport';
19821982

19831983
@override
19841984
String get import => 'Import';
@@ -1998,16 +1998,16 @@ class AppLocalizationsPl extends AppLocalizations {
19981998
'Do you want to reload the local audio directory?';
19991999

20002000
@override
2001-
String get external => 'external';
2001+
String get external => 'zewnętrzne';
20022002

20032003
@override
20042004
String get externalPlaylist => 'External playlist';
20052005

20062006
@override
2007-
String get pictures => 'Pictures';
2007+
String get pictures => 'Obrazy';
20082008

20092009
@override
2010-
String get localPictureTypeOther => 'Other';
2010+
String get localPictureTypeOther => 'Inne';
20112011

20122012
@override
20132013
String get localPictureTypeFileIcon32x32 => 'Icon 32x32';
@@ -2037,10 +2037,10 @@ class AppLocalizationsPl extends AppLocalizations {
20372037
String get localPictureTypeConductor => 'Conductor';
20382038

20392039
@override
2040-
String get localPictureTypeBandOrchestra => 'Band/Orchestra';
2040+
String get localPictureTypeBandOrchestra => 'Zespół/Orkiestra';
20412041

20422042
@override
2043-
String get localPictureTypeComposer => 'Composer';
2043+
String get localPictureTypeComposer => 'Kompozytor';
20442044

20452045
@override
20462046
String get localPictureTypeLyricistTextWriter => 'Lyricist/Text writer';
@@ -2080,7 +2080,7 @@ class AppLocalizationsPl extends AppLocalizations {
20802080
'You can\'t unpin albums without empty album metadata!';
20812081

20822082
@override
2083-
String get path => 'Path';
2083+
String get path => 'Ścieżka';
20842084

20852085
@override
20862086
String get albumNotFound =>
@@ -2099,7 +2099,7 @@ class AppLocalizationsPl extends AppLocalizations {
20992099
'The provided URL must exist on the radiobrowser server, otherwise it will not be added to you library! Ideally search for them in the radio feature and add them with the star button to your library!';
21002100

21012101
@override
2102-
String get disc => 'Disc';
2102+
String get disc => 'Dysk';
21032103

21042104
@override
21052105
String get groupAlbumsOnlyByAlbumName => 'Group albums only by album name';

0 commit comments

Comments
 (0)