chore: Design follow up
This commit is contained in:
parent
dd7330ecd3
commit
038cd9cb73
6 changed files with 172 additions and 139 deletions
|
|
@ -216,7 +216,7 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
|
||||
EmojiPickerType emojiPickerType = EmojiPickerType.keyboard;
|
||||
|
||||
void requestHistory() async {
|
||||
void requestHistory([_]) async {
|
||||
if (!timeline!.canRequestHistory) return;
|
||||
Logs().v('Requesting history...');
|
||||
try {
|
||||
|
|
@ -269,11 +269,6 @@ class ChatController extends State<ChatPageWithRoom> {
|
|||
if (scrollController.position.pixels == 0 ||
|
||||
scrollController.position.pixels == 64) {
|
||||
requestFuture();
|
||||
} else if (scrollController.position.pixels ==
|
||||
scrollController.position.maxScrollExtent ||
|
||||
scrollController.position.pixels + 64 ==
|
||||
scrollController.position.maxScrollExtent) {
|
||||
requestHistory();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,11 +82,17 @@ class ChatEventList extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
if (controller.timeline!.canRequestHistory) {
|
||||
return Center(
|
||||
child: IconButton(
|
||||
onPressed: controller.requestHistory,
|
||||
icon: const Icon(Icons.refresh_outlined),
|
||||
),
|
||||
return Builder(
|
||||
builder: (context) {
|
||||
WidgetsBinding.instance
|
||||
.addPostFrameCallback(controller.requestHistory);
|
||||
return Center(
|
||||
child: IconButton(
|
||||
onPressed: controller.requestHistory,
|
||||
icon: const Icon(Icons.refresh_outlined),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue