File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 1+ ## 0.0.2
2+
3+ - Edit pubspec.yaml description
4+ - Edit ` example/lib/main.dart ` by using BuildContext synchronously
5+
16## 0.0.1
27
38Initial release including the following features:
Original file line number Diff line number Diff line change 1- // ignore_for_file: use_build_context_synchronously
2-
31import 'dart:io' ;
42
53import 'package:flutter/material.dart' ;
@@ -36,21 +34,16 @@ class _MyAppState extends State<MyApp> {
3634 String dropdownValue = Platform .isIOS ? iconsIOS.first : iconsAndroid.first;
3735 final _flutterIconDynamicPlugin = FlutterIconDynamic ();
3836
39- @override
40- void initState () {
41- super .initState ();
42- }
43-
4437 Future <void > changeIcon (String icon, BuildContext context) async {
4538 try {
4639 final value = await _flutterIconDynamicPlugin.setIcon (icon, androidIcons: iconsAndroid);
47- if (value) {
48- showSnackBar (context, 'Icon changed to $icon ' );
49- } else {
50- showSnackBar (context, 'Failed to change icon to $icon ' );
40+ if (context.mounted) {
41+ showSnackBar (context, value ? 'Icon changed to $icon ' : 'Failed to change icon to $icon ' );
5142 }
5243 } catch (e) {
53- showSnackBar (context, 'Failed to change icon to $icon : $e ' );
44+ if (context.mounted) {
45+ showSnackBar (context, 'Failed to change icon to $icon : $e ' );
46+ }
5447 }
5548 }
5649
Original file line number Diff line number Diff line change 11name : flutter_icon_dynamic
2- description : " Change your mobile app icon dynamically"
3- version : 0.0.1
2+ description : " Change your Android and iOS app icon dynamically without any hassle! "
3+ version : 0.0.2
44homepage : https://github.com/sncf-connect-tech/flutter_icon_dynamic
55
66environment :
You can’t perform that action at this time.
0 commit comments