Skip to content

Commit f996768

Browse files
committed
chore: use script_runner
1 parent eb9b6be commit f996768

File tree

14 files changed

+71
-31
lines changed

14 files changed

+71
-31
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jobs:
2828
run: |
2929
flutter config --no-analytics
3030
flutter pub get
31-
sh ./scripts/generate_code.sh
31+
dart pub global activate script_runner
32+
scr build
3233
3334
- name: Build APKs
3435
run: flutter build apk --build-number $(printf '%(%Y%m%d)T\n' -1) --debug

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ jobs:
3737
run: |
3838
flutter config --no-analytics
3939
flutter pub get
40-
sh ./scripts/generate_code.sh
40+
dart pub global activate script_runner
41+
scr build
4142
4243
- name: Build APKs
4344
if: ${{ steps.release.outputs.release_created }}

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@ Contributions are what make the open source community such an amazing place to l
9797
### Building the app
9898

9999
1. Run `flutter pub get`
100-
2. Run `./scripts/generate_code.sh` or
101-
`flutter pub run flutter_oss_licenses:generate.dart` and
102-
`flutter pub run intl_utils:generate` to generate licenses and translations
103-
3. Run `flutter build apk` or run using your IDE
100+
2. Install [script_runner](https://pub.dev/packages/script_runner) by running `flutter pub global activate script_runner`
101+
3. Run `scr build`
102+
4. Run `flutter build apk` or run using your IDE
104103

105104
<!-- LICENSE -->
106105
## License
54 Bytes
Loading
1.08 KB
Loading
809 Bytes
Loading
-2.12 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5+
<item name="android:forceDarkAllowed">false</item>
6+
<item name="android:windowFullscreen">true</item>
7+
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
8+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
9+
<item name="android:windowSplashScreenBackground">#2E3440</item>
10+
<item name="android:windowSplashScreenIconBackgroundColor">#2E3440</item>
11+
</style>
12+
<!-- Theme applied to the Android Window as soon as the process has started.
13+
This theme determines the color of the Android Window while your
14+
Flutter UI initializes, as well as behind your Flutter UI while its
15+
running.
16+
17+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
18+
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
19+
<item name="android:windowBackground">?android:colorBackground</item>
20+
</style>
21+
</resources>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
4+
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
5+
<item name="android:forceDarkAllowed">false</item>
6+
<item name="android:windowFullscreen">true</item>
7+
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
8+
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
9+
<item name="android:windowSplashScreenBackground">#D8DEE9</item>
10+
<item name="android:windowSplashScreenIconBackgroundColor">#D8DEE9</item>
11+
</style>
12+
<!-- Theme applied to the Android Window as soon as the process has started.
13+
This theme determines the color of the Android Window while your
14+
Flutter UI initializes, as well as behind your Flutter UI while its
15+
running.
16+
17+
This Theme is only used starting with V2 of Flutter's Android embedding. -->
18+
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
19+
<item name="android:windowBackground">?android:colorBackground</item>
20+
</style>
21+
</resources>

lib/main.dart

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ import 'package:flutter/gestures.dart';
55
import 'package:flutter/material.dart';
66
import 'package:flutter/services.dart';
77
import 'package:flutter_localizations/flutter_localizations.dart';
8+
import 'package:flutter_native_splash/flutter_native_splash.dart';
89
import 'package:flutter_phoenix/flutter_phoenix.dart';
910
import 'package:pref/pref.dart';
1011
import 'package:prefs/prefs.dart';
1112

1213
import 'generated/l10n.dart';
1314
import 'layouts/home_page.dart';
1415
import 'utils/migrations.dart';
15-
import 'utils/tts_helper.dart';
1616
import 'utils/sound_helper.dart';
17+
import 'utils/tts_helper.dart';
1718

1819
void main() async {
19-
WidgetsFlutterBinding.ensureInitialized();
20+
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
2021
GestureBinding.instance.resamplingEnabled = true;
22+
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
2123
await Prefs.init();
2224

2325
PrefServiceShared.init(
@@ -36,9 +38,12 @@ void main() async {
3638
SoundHelper.loadSounds(),
3739
Migrations.runMigrations(),
3840
]).then(
39-
(_) => runApp(
40-
PrefService(service: service, child: Phoenix(child: JAWTApp())),
41-
),
41+
(_) {
42+
runApp(
43+
PrefService(service: service, child: Phoenix(child: JAWTApp())),
44+
);
45+
FlutterNativeSplash.remove();
46+
},
4247
),
4348
);
4449
}

0 commit comments

Comments
 (0)