From 5195f738272a070568a00f5a32f4c3e545a96444 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Fri, 31 Dec 2021 09:12:47 +0100 Subject: [PATCH] chore: Improve FABs --- assets/l10n/intl_en.arb | 4 +++- lib/pages/add_story/add_story_view.dart | 8 ++++---- lib/pages/add_story/invite_story_page.dart | 3 +-- lib/pages/chat_list/chat_list_view.dart | 19 +++++++------------ 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index de2e6b11..bc9080a9 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -2685,5 +2685,7 @@ "body": {} } }, - "whoCanSeeMyStoriesDesc": "Please note that people can see and contact each other in your story." + "whoCanSeeMyStoriesDesc": "Please note that people can see and contact each other in your story.", + "whatIsGoingOn": "What is going on?", + "addDescription": "Add description" } diff --git a/lib/pages/add_story/add_story_view.dart b/lib/pages/add_story/add_story_view.dart index 57f4e7d5..5508c301 100644 --- a/lib/pages/add_story/add_story_view.dart +++ b/lib/pages/add_story/add_story_view.dart @@ -101,8 +101,9 @@ class AddStoryView extends StatelessWidget { onChanged: controller.updateColors, decoration: InputDecoration( border: InputBorder.none, - hintText: - controller.hasMedia ? 'Add description' : 'How are you?', + hintText: controller.hasMedia + ? L10n.of(context)!.addDescription + : L10n.of(context)!.whatIsGoingOn, filled: false, hintStyle: TextStyle( color: Colors.white.withOpacity(0.5), @@ -116,7 +117,6 @@ class AddStoryView extends StatelessWidget { ), ], ), - floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: controller.controller.text.isEmpty && !controller.hasMedia ? null @@ -125,7 +125,7 @@ class AddStoryView extends StatelessWidget { label: Text(L10n.of(context)!.publish), backgroundColor: Theme.of(context).colorScheme.surface, foregroundColor: Theme.of(context).colorScheme.onSurface, - icon: const Icon(Icons.check_circle), + icon: const Icon(Icons.send_rounded), ), ); } diff --git a/lib/pages/add_story/invite_story_page.dart b/lib/pages/add_story/invite_story_page.dart index beb441c4..ae6d067f 100644 --- a/lib/pages/add_story/invite_story_page.dart +++ b/lib/pages/add_story/invite_story_page.dart @@ -113,13 +113,12 @@ class _InviteStoryPageState extends State { ), ); }), - floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, floatingActionButton: FloatingActionButton.extended( onPressed: _inviteAction, label: Text(L10n.of(context)!.publish), backgroundColor: Theme.of(context).colorScheme.surface, foregroundColor: Theme.of(context).colorScheme.onSurface, - icon: const Icon(Icons.upload_outlined), + icon: const Icon(Icons.send_rounded), ), ); } diff --git a/lib/pages/chat_list/chat_list_view.dart b/lib/pages/chat_list/chat_list_view.dart index ff90d98d..2c5360c5 100644 --- a/lib/pages/chat_list/chat_list_view.dart +++ b/lib/pages/chat_list/chat_list_view.dart @@ -206,18 +206,13 @@ class ChatListView extends StatelessWidget { Expanded(child: _ChatListViewBody(controller)), ]), floatingActionButton: selectMode == SelectMode.normal - ? controller.scrolledToTop - ? FloatingActionButton.extended( - onPressed: () => - VRouter.of(context).to('/newprivatechat'), - icon: const Icon(CupertinoIcons.chat_bubble), - label: Text(L10n.of(context).newChat), - ) - : FloatingActionButton( - onPressed: () => - VRouter.of(context).to('/newprivatechat'), - child: const Icon(CupertinoIcons.chat_bubble), - ) + ? FloatingActionButton.extended( + isExtended: controller.scrolledToTop, + onPressed: () => + VRouter.of(context).to('/newprivatechat'), + icon: const Icon(CupertinoIcons.chat_bubble), + label: Text(L10n.of(context).newChat), + ) : null, bottomNavigationBar: Column( mainAxisSize: MainAxisSize.min,