mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-19 04:55:09 +00:00
fix: Scroll up and scroll down buttons in chat list
This commit is contained in:
parent
000e595d8b
commit
c59486ca90
2 changed files with 8 additions and 13 deletions
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:scroll_to_index/scroll_to_index.dart';
|
import 'package:scroll_to_index/scroll_to_index.dart';
|
||||||
|
|
||||||
|
@ -54,13 +53,10 @@ class ChatEventList extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (controller.timeline!.canRequestFuture) {
|
if (controller.timeline!.canRequestFuture) {
|
||||||
Center(
|
return Center(
|
||||||
child: OutlinedButton(
|
child: IconButton(
|
||||||
style: OutlinedButton.styleFrom(
|
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
||||||
),
|
|
||||||
onPressed: controller.requestFuture,
|
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) {
|
if (controller.timeline!.canRequestHistory) {
|
||||||
Center(
|
return Center(
|
||||||
child: OutlinedButton(
|
child: IconButton(
|
||||||
style: OutlinedButton.styleFrom(
|
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
||||||
),
|
|
||||||
onPressed: controller.requestHistory,
|
onPressed: controller.requestHistory,
|
||||||
child: Text(L10n.of(context)!.loadMore),
|
icon: const Icon(Icons.refresh_outlined),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,6 +191,8 @@ class ChatView extends StatelessWidget {
|
||||||
title: ChatAppBarTitle(controller),
|
title: ChatAppBarTitle(controller),
|
||||||
actions: _appBarActions(context),
|
actions: _appBarActions(context),
|
||||||
),
|
),
|
||||||
|
floatingActionButtonLocation:
|
||||||
|
FloatingActionButtonLocation.centerFloat,
|
||||||
floatingActionButton: controller.showScrollDownButton &&
|
floatingActionButton: controller.showScrollDownButton &&
|
||||||
controller.selectedEvents.isEmpty
|
controller.selectedEvents.isEmpty
|
||||||
? Padding(
|
? Padding(
|
||||||
|
|
Loading…
Reference in a new issue