diff --git a/packages/battery_plus/CHANGELOG.md b/packages/battery_plus/CHANGELOG.md index feac0ae74..8193fb7bb 100644 --- a/packages/battery_plus/CHANGELOG.md +++ b/packages/battery_plus/CHANGELOG.md @@ -1,6 +1,7 @@ ## NEXT * Update minimum Flutter and Dart version to 3.13 and 3.1. +* Fix analyze issue. ## 1.1.2 diff --git a/packages/battery_plus/example/lib/main.dart b/packages/battery_plus/example/lib/main.dart index 6aa8088a3..733f22835 100644 --- a/packages/battery_plus/example/lib/main.dart +++ b/packages/battery_plus/example/lib/main.dart @@ -74,6 +74,7 @@ class _MyHomePageState extends State { onPressed: () { _battery.batteryLevel.then( (batteryLevel) { + if (!context.mounted) return; showDialog( context: context, builder: (_) => AlertDialog( @@ -98,6 +99,7 @@ class _MyHomePageState extends State { onPressed: () { _battery.isInBatterySaveMode.then( (isInPowerSaveMode) { + if (!context.mounted) return; showDialog( context: context, builder: (_) => AlertDialog(