From c59486ca900e4a2b70c18fe17ca36d6e4d04eb2a Mon Sep 17 00:00:00 2001 From: Krille Date: Sat, 3 Jun 2023 17:59:48 +0200 Subject: [PATCH] fix: Scroll up and scroll down buttons in chat list --- lib/pages/chat/chat_event_list.dart | 19 ++++++------------- lib/pages/chat/chat_view.dart | 2 ++ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index 6f5ad6591..59df801a2 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:matrix/matrix.dart'; import 'package:scroll_to_index/scroll_to_index.dart'; @@ -54,13 +53,10 @@ class ChatEventList extends StatelessWidget { ); } if (controller.timeline!.canRequestFuture) { - Center( - child: OutlinedButton( - style: OutlinedButton.styleFrom( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - ), + return Center( + child: IconButton( onPressed: controller.requestFuture, - child: Text(L10n.of(context)!.loadMore), + icon: const Icon(Icons.refresh_outlined), ), ); } @@ -81,13 +77,10 @@ class ChatEventList extends StatelessWidget { ); } if (controller.timeline!.canRequestHistory) { - Center( - child: OutlinedButton( - style: OutlinedButton.styleFrom( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - ), + return Center( + child: IconButton( onPressed: controller.requestHistory, - child: Text(L10n.of(context)!.loadMore), + icon: const Icon(Icons.refresh_outlined), ), ); } diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index 66448648f..c72a15446 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -191,6 +191,8 @@ class ChatView extends StatelessWidget { title: ChatAppBarTitle(controller), actions: _appBarActions(context), ), + floatingActionButtonLocation: + FloatingActionButtonLocation.centerFloat, floatingActionButton: controller.showScrollDownButton && controller.selectedEvents.isEmpty ? Padding(