From 97db56ae78186e5c05899d64b699bb34833d57f1 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 7 May 2020 19:13:22 +0200 Subject: [PATCH] Improve notifications delete button --- lib/ui/screens/notifications_screen.dart | 15 ++++++++++++--- .../widgets/tablet_mode/tablet_appbar_widget.dart | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/ui/screens/notifications_screen.dart b/lib/ui/screens/notifications_screen.dart index 935962d..33c1e91 100644 --- a/lib/ui/screens/notifications_screen.dart +++ b/lib/ui/screens/notifications_screen.dart @@ -26,6 +26,14 @@ enum _Status { LOADING, ERROR, NONE } enum _PopupMenuActions { DELETE } class NotificationsScreen extends StatefulWidget { + final bool useSmallDeleteButton; + + const NotificationsScreen({ + Key key, + this.useSmallDeleteButton = false, + }) : assert(useSmallDeleteButton != null), + super(key: key); + @override _NotificationsScreenState createState() => _NotificationsScreenState(); } @@ -100,13 +108,14 @@ class _NotificationsScreenState extends SafeState { ), // Add conversation button Positioned( - right: 20.0, - bottom: 20.0, + right: widget.useSmallDeleteButton ? 0.0 : 20.0, + bottom: widget.useSmallDeleteButton ? 0.0 : 20.0, child: FloatingActionButton( + mini: widget.useSmallDeleteButton, onPressed: () => _deleteAllNotifications(), child: Icon(Icons.delete), ), - ), + ) ]), ); } diff --git a/lib/ui/widgets/tablet_mode/tablet_appbar_widget.dart b/lib/ui/widgets/tablet_mode/tablet_appbar_widget.dart index d439ab9..d1b837e 100644 --- a/lib/ui/widgets/tablet_mode/tablet_appbar_widget.dart +++ b/lib/ui/widgets/tablet_mode/tablet_appbar_widget.dart @@ -64,7 +64,7 @@ class _ComunicTabletAppBarWidgetState notificationsBadge: _unreadNotifications.notifications, onBuildOverlay: (c) => Padding( padding: const EdgeInsets.all(8.0), - child: NotificationsScreen(), + child: NotificationsScreen(useSmallDeleteButton: true), ), ), AppBarCustomDropDownWidget(