diff --git a/lib/main.dart b/lib/main.dart index 4d100d39..f2faae5a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,6 +7,7 @@ import 'package:feedback_sentry/feedback_sentry.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:hive_flutter/adapters.dart'; import 'package:logging/logging.dart'; @@ -105,8 +106,9 @@ void initFlogger() { } void initFlutter() { - WidgetsFlutterBinding.ensureInitialized(); - WidgetsBinding.instance.addObserver(WidgetBindingLogger()); + WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); + widgetsBinding.addObserver(WidgetBindingLogger()); + FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); // keeps the splash screen visible } class WidgetBindingLogger extends WidgetsBindingObserver { @@ -195,8 +197,9 @@ class _TailAppState extends State { child: ValueListenableBuilder( valueListenable: SentryHive.box(settings).listenable(keys: [appColor]), builder: (BuildContext context, value, Widget? child) { + Future(() => FlutterNativeSplash.remove()); //remove the splash screen one frame later return MaterialApp.router( - title: subTitle(), + title: title(), color: Color(SentryHive.box(settings).get(appColor, defaultValue: appColorDefault)), theme: buildTheme(Brightness.light, Color(SentryHive.box(settings).get(appColor, defaultValue: appColorDefault))), darkTheme: buildTheme(Brightness.dark, Color(SentryHive.box(settings).get(appColor, defaultValue: appColorDefault))), diff --git a/pubspec.lock b/pubspec.lock index df5aef19..7b518d1f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -563,7 +563,7 @@ packages: source: hosted version: "0.7.1" flutter_native_splash: - dependency: "direct dev" + dependency: "direct main" description: name: flutter_native_splash sha256: edf39bcf4d74aca1eb2c1e43c3e445fd9f494013df7f0da752fefe72020eedc0 diff --git a/pubspec.yaml b/pubspec.yaml index 8448d80a..c27e58d3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -67,6 +67,7 @@ dependencies: flutter_markdown: ^0.7.1 #video_player: ^2.8.6 fading_edge_scrollview: ^4.1.1 + flutter_native_splash: ^2.4.0 # Dio HTTP dio: ^5.4.3+1 @@ -117,7 +118,6 @@ dev_dependencies: build_runner: # Required for build flutter_lints: # Dryer Lint riverpod_generator: ^2.4.2 - flutter_native_splash: ^2.4.0 json_serializable: ^6.8.0 # required for @JsonSerializable annotations hive_generator: ^2.0.1 # required for @HiveType annotations