Skip to content

Commit

Permalink
fix: 从后台重新打开 splash 不关闭
Browse files Browse the repository at this point in the history
  • Loading branch information
luke358 committed Aug 23, 2024
1 parent 701e469 commit 058425b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_splash_screen/flutter_splash_screen.dart';
import 'package:get/get.dart';
import 'package:podcasts_pro/config/theme.dart';
import 'package:podcasts_pro/constants/routes.dart';
Expand Down Expand Up @@ -46,9 +47,17 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
WidgetsBinding.instance.addObserver(this);
}

@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}

@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
print("Starting... resumed");
FlutterSplashScreen.hide();
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
systemNavigationBarColor: Colors.white,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: podcasts_pro
description: "A project to listen to podcasts through RSS subscription links."
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.12
version: 1.0.13

environment:
sdk: '>=3.4.3 <4.0.0'
Expand Down

0 comments on commit 058425b

Please sign in to comment.