You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
786 B
30 lines
786 B
import 'package:flutter/material.dart';
|
|
import '../helpers/chat_scroll_controller.dart';
|
|
|
|
class JumpToBottomButton extends StatelessWidget {
|
|
final ChatScrollController scrollController;
|
|
|
|
const JumpToBottomButton({
|
|
super.key,
|
|
required this.scrollController,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ValueListenableBuilder<bool>(
|
|
valueListenable: scrollController.showJumpToBottom,
|
|
builder: (context, show, _) {
|
|
if (!show) return const SizedBox.shrink();
|
|
return Positioned(
|
|
right: 16,
|
|
bottom: 16,
|
|
child: FloatingActionButton.small(
|
|
onPressed: scrollController.jumpToBottom,
|
|
child: const Icon(Icons.keyboard_arrow_down),
|
|
),
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|