From 9d2954d717e7e8cf52cd68913eb8bfbb81e4df42 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 29 Mar 2021 09:26:11 +0900 Subject: [PATCH] minor changes --- lib/model/actions/entry_actions.dart | 4 ++-- lib/services/app_shortcut_service.dart | 2 +- lib/widgets/collection/app_bar.dart | 2 +- lib/widgets/viewer/overlay/common.dart | 5 ++--- lib/widgets/viewer/panorama_page.dart | 1 - 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/model/actions/entry_actions.dart b/lib/model/actions/entry_actions.dart index ad47ac452..2b92511dc 100644 --- a/lib/model/actions/entry_actions.dart +++ b/lib/model/actions/entry_actions.dart @@ -52,7 +52,7 @@ extension ExtraEntryAction on EntryAction { // in app actions case EntryAction.toggleFavourite: // different data depending on toggle state - return null; + return context.l10n.entryActionAddFavourite; case EntryAction.delete: return context.l10n.entryActionDelete; case EntryAction.export: @@ -93,7 +93,7 @@ extension ExtraEntryAction on EntryAction { // in app actions case EntryAction.toggleFavourite: // different data depending on toggle state - return null; + return AIcons.favourite; case EntryAction.delete: return AIcons.delete; case EntryAction.export: diff --git a/lib/services/app_shortcut_service.dart b/lib/services/app_shortcut_service.dart index 9c5a1cb46..d13daa4cb 100644 --- a/lib/services/app_shortcut_service.dart +++ b/lib/services/app_shortcut_service.dart @@ -44,7 +44,7 @@ class AppShortcutService { await platform.invokeMethod('pin', { 'label': label, 'iconBytes': iconBytes, - 'filters': filters.map((filter) => filter.toJson()).toList(), + 'filters': filters.where((filter) => filter != null).map((filter) => filter.toJson()).toList(), }); } on PlatformException catch (e) { debugPrint('pin failed with code=${e.code}, exception=${e.message}, details=${e.details}'); diff --git a/lib/widgets/collection/app_bar.dart b/lib/widgets/collection/app_bar.dart index 7c18ac952..cbf5c41b6 100644 --- a/lib/widgets/collection/app_bar.dart +++ b/lib/widgets/collection/app_bar.dart @@ -367,7 +367,7 @@ class _CollectionAppBarState extends State with SingleTickerPr if (name == null || name.isEmpty) return; - unawaited(AppShortcutService.pin(name, coverEntry, collection.filters)); + unawaited(AppShortcutService.pin(name, coverEntry, filters)); } void _goToSearch() { diff --git a/lib/widgets/viewer/overlay/common.dart b/lib/widgets/viewer/overlay/common.dart index 0ef41c77a..da559fd63 100644 --- a/lib/widgets/viewer/overlay/common.dart +++ b/lib/widgets/viewer/overlay/common.dart @@ -10,10 +10,9 @@ class OverlayButton extends StatelessWidget { const OverlayButton({ Key key, - @required this.scale, + this.scale = kAlwaysCompleteAnimation, @required this.child, - }) : assert(scale != null), - super(key: key); + }) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/widgets/viewer/panorama_page.dart b/lib/widgets/viewer/panorama_page.dart index 0c4a51653..9672a4ccc 100644 --- a/lib/widgets/viewer/panorama_page.dart +++ b/lib/widgets/viewer/panorama_page.dart @@ -94,7 +94,6 @@ class _PanoramaPageState extends State { return Padding( padding: EdgeInsets.all(8) + EdgeInsets.only(right: mqPadding.right, bottom: mqPadding.bottom), child: OverlayButton( - scale: kAlwaysCompleteAnimation, child: ValueListenableBuilder( valueListenable: _sensorControl, builder: (context, sensorControl, child) {