@@ -195,11 +195,9 @@ class _MessageListState extends State<MessageList> {
195
195
Positioned (
196
196
bottom: 0 ,
197
197
right: 0 ,
198
- child: ScrollToBottomButton (scrollController: scrollController, visibleValue: _scrollToBottomVisibleValue),
199
- ),
200
- ]
201
- ),
202
- ))))));
198
+ child: ScrollToBottomButton (
199
+ scrollController: scrollController,
200
+ visibleValue: _scrollToBottomVisibleValue))])))))));
203
201
}
204
202
205
203
Widget _buildListView (context) {
@@ -243,23 +241,26 @@ class ScrollToBottomButton extends StatelessWidget {
243
241
// Calculate time necessary if we're capping speed at 8pixels/ms (== 8000pixels/s)
244
242
final speedLimit = (distance / 8 ).ceil ();
245
243
final int durationMs = max (300 , speedLimit);
246
- scrollController.animateTo (0 , duration: Duration (milliseconds: durationMs), curve: Curves .easeIn);
244
+ scrollController.animateTo (
245
+ 0 ,
246
+ duration: Duration (milliseconds: durationMs),
247
+ curve: Curves .easeIn);
247
248
}
248
249
249
250
@override
250
251
Widget build (BuildContext context) {
251
252
return ValueListenableBuilder <bool >(
252
- builder: (BuildContext context, bool value, Widget ? child) {
253
- return (value && child != null ) ? child : const SizedBox .shrink ();
254
- },
255
- valueListenable: visibleValue,
256
- // TODO: fix hardcoded values for size and style here
257
- child: IconButton (
258
- tooltip: "Scroll to bottom" ,
259
- icon: const Icon (Icons .expand_circle_down_rounded),
260
- iconSize: 40 ,
261
- color: const HSLColor .fromAHSL (0.5 ,240 ,0.96 ,0.68 ).toColor (),
262
- onPressed: () => _navigateToBottom (context)));
253
+ builder: (BuildContext context, bool value, Widget ? child) {
254
+ return (value && child != null ) ? child : const SizedBox .shrink ();
255
+ },
256
+ valueListenable: visibleValue,
257
+ // TODO: fix hardcoded values for size and style here
258
+ child: IconButton (
259
+ tooltip: "Scroll to bottom" ,
260
+ icon: const Icon (Icons .expand_circle_down_rounded),
261
+ iconSize: 40 ,
262
+ color: const HSLColor .fromAHSL (0.5 ,240 ,0.96 ,0.68 ).toColor (),
263
+ onPressed: () => _navigateToBottom (context)));
263
264
}
264
265
}
265
266
0 commit comments