mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-18 16:55:58 +00:00
CWA-201 | added scroll controller to wallet list page
This commit is contained in:
parent
07aaf77167
commit
28d8cd43dc
1 changed files with 12 additions and 4 deletions
|
@ -28,6 +28,7 @@ class WalletListBody extends StatefulWidget {
|
|||
class WalletListBodyState extends State<WalletListBody> {
|
||||
final moneroIcon = Image.asset('assets/images/monero.png', height: 24, width: 24);
|
||||
WalletListStore _walletListStore;
|
||||
ScrollController scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -64,6 +65,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
width: double.infinity,
|
||||
child: CustomScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: scrollController,
|
||||
slivers: <Widget>[
|
||||
SliverPersistentHeader(
|
||||
pinned: false,
|
||||
|
@ -105,8 +107,11 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
|
||||
if (index == 0) {
|
||||
return GestureDetector(
|
||||
onTap: () => walletMenu.action(
|
||||
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet),
|
||||
onTap: () {
|
||||
scrollController.animateTo(0.0, duration: Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
walletMenu.action(
|
||||
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet);
|
||||
},
|
||||
child: Container(
|
||||
height: 108,
|
||||
width: 108,
|
||||
|
@ -127,8 +132,11 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
}
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => walletMenu.action(
|
||||
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet),
|
||||
onTap: () {
|
||||
scrollController.animateTo(0.0, duration: Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||
walletMenu.action(
|
||||
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet);
|
||||
},
|
||||
child: Container(
|
||||
height: 108,
|
||||
width: 108,
|
||||
|
|
Loading…
Reference in a new issue