From 6b7afbb31c9fe01f935f0d987205c6fc46dc6efe Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Wed, 29 Jun 2022 07:30:15 -0400 Subject: [PATCH] Convert scroll to top to button widget (#90) --- lib/widgets/scroll_to_top_button.dart | 33 +++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/lib/widgets/scroll_to_top_button.dart b/lib/widgets/scroll_to_top_button.dart index 1f58d2b7..fc13b986 100644 --- a/lib/widgets/scroll_to_top_button.dart +++ b/lib/widgets/scroll_to_top_button.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:frosty/widgets/button.dart'; class ScrollToTopButton extends StatelessWidget { final ScrollController scrollController; @@ -8,22 +9,24 @@ class ScrollToTopButton extends StatelessWidget { @override Widget build(BuildContext context) { - return Tooltip( - message: 'Scroll to top', - preferBelow: false, - child: FloatingActionButton( - onPressed: () { - HapticFeedback.lightImpact(); + return Padding( + padding: const EdgeInsets.only(bottom: 5.0), + child: Tooltip( + message: 'Scroll to top', + preferBelow: false, + child: Button( + onPressed: () { + HapticFeedback.lightImpact(); - scrollController.animateTo( - 0.0, - curve: Curves.easeOutCubic, - duration: const Duration(milliseconds: 500), - ); - }, - mini: true, - heroTag: null, - child: const Icon(Icons.keyboard_arrow_up), + scrollController.animateTo( + 0.0, + curve: Curves.easeOutCubic, + duration: const Duration(milliseconds: 500), + ); + }, + padding: const EdgeInsets.symmetric(horizontal: 25.0, vertical: 10.0), + child: const Icon(Icons.keyboard_arrow_up), + ), ), ); }