diff --git a/bin/generate_packs.dart b/bin/generate_packs.dart index 648648b..ee07522 100644 --- a/bin/generate_packs.dart +++ b/bin/generate_packs.dart @@ -13,8 +13,6 @@ const help = 'help'; const clear = 'clear'; Future main(List arguments) async { - exitCode = 0; // Presume success - final parser = ArgParser() ..addFlag(help, help: 'Shows how to use generate_packs command', abbr: 'h') ..addFlag(clear, help: 'Clears all generated packs', abbr: 'c') diff --git a/example/lib/app/icon_notifier.dart b/example/lib/app/icon_notifier.dart index deea2cf..b1730b7 100644 --- a/example/lib/app/icon_notifier.dart +++ b/example/lib/app/icon_notifier.dart @@ -6,7 +6,7 @@ import 'package:path_provider/path_provider.dart'; import 'app_brightness.dart'; class IconNotifier extends ChangeNotifier { - static final starterPacks = [IconPack.cupertino]; + static final starterPacks = [IconPack.evaIcons]; IconNotifier._( IconPickerIcon? iconData, @@ -26,10 +26,7 @@ class IconNotifier extends ChangeNotifier { IconPickerIcon? get icon => _icon; - void setIconData( - IconPickerIcon value, { - IconPack? pack, - }) { + void setIconData(IconPickerIcon value) { if (_icon == value) { return; } @@ -83,8 +80,7 @@ class IconNotifier extends ChangeNotifier { try { if (!kIsWeb) Hive.init((await getApplicationDocumentsDirectory()).path); } catch (e) { - debugPrint( - 'Hive has already been initialized. Skipping this step for now.'); + debugPrint('Hive has already been initialized. Skipping this step for now.'); } if (!Hive.isBoxOpen('FLIPBox')) { @@ -97,9 +93,7 @@ class IconNotifier extends ChangeNotifier { ? deserializeIcon(Map.from(await box.get('iconData'))) : null; - final cachedIcons = await box.get('iconsData') != null - ? deserializeIcons(await box.get('iconsData')) - : null; + final cachedIcons = await box.get('iconsData') != null ? deserializeIcons(await box.get('iconsData')) : null; final brightness = AppBrightness.from(await box.get('app.brightness')); diff --git a/example/lib/home/home_screen.dart b/example/lib/home/home_screen.dart index 8ce139a..4954cc2 100644 --- a/example/lib/home/home_screen.dart +++ b/example/lib/home/home_screen.dart @@ -33,24 +33,19 @@ class _HomeScreenState extends State { adaptiveDialog: isAdaptive, showTooltips: showTooltips, showSearchBar: showSearch, - iconPickerShape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)), + iconPickerShape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)), iconPackModes: IconNotifier.starterPacks, searchComparator: (String search, IconPickerIcon icon) => - search - .toLowerCase() - .contains(icon.name.replaceAll('_', ' ').toLowerCase()) || + search.toLowerCase().contains(icon.name.replaceAll('_', ' ').toLowerCase()) || icon.name.toLowerCase().contains(search.toLowerCase()), ), ); if (icon != null) { - Provider.of(context, listen: false) - .setIconData(icon, pack: icon.pack); + Provider.of(context, listen: false).setIconData(icon); setState(() {}); - debugPrint( - 'Picked Icon: $icon and saved it successfully in local hive db.'); + debugPrint('Picked Icon: $icon and saved it successfully in local hive db.'); } } @@ -106,9 +101,7 @@ class _HomeScreenState extends State { onPressed: _pickIcon, child: AnimatedSize( duration: const Duration(milliseconds: 300), - child: Text(notifier.icon != null - ? 'Change Icon' - : 'Open IconPicker'), + child: Text(notifier.icon != null ? 'Change Icon' : 'Open IconPicker'), ), ), AnimatedSwitcher( @@ -154,24 +147,21 @@ class _HomeScreenState extends State { children: [ Flexible( child: SwitchListTile.adaptive( - title: const Text('Show search-bar', - style: TextStyle(color: Colors.white)), + title: const Text('Show search-bar', style: TextStyle(color: Colors.white)), value: showSearch, onChanged: (val) => setState(() => showSearch = val), ), ), Flexible( child: SwitchListTile.adaptive( - title: const Text('Show tooltips', - style: TextStyle(color: Colors.white)), + title: const Text('Show tooltips', style: TextStyle(color: Colors.white)), value: showTooltips, onChanged: (val) => setState(() => showTooltips = val), ), ), Flexible( child: SwitchListTile.adaptive( - title: const Text('Adaptive dialog', - style: TextStyle(color: Colors.white)), + title: const Text('Adaptive dialog', style: TextStyle(color: Colors.white)), value: isAdaptive, onChanged: (val) => setState(() => isAdaptive = val), ),