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> {
|
class WalletListBodyState extends State<WalletListBody> {
|
||||||
final moneroIcon = Image.asset('assets/images/monero.png', height: 24, width: 24);
|
final moneroIcon = Image.asset('assets/images/monero.png', height: 24, width: 24);
|
||||||
WalletListStore _walletListStore;
|
WalletListStore _walletListStore;
|
||||||
|
ScrollController scrollController = ScrollController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -64,6 +65,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
|
controller: scrollController,
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
SliverPersistentHeader(
|
SliverPersistentHeader(
|
||||||
pinned: false,
|
pinned: false,
|
||||||
|
@ -105,8 +107,11 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
|
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => walletMenu.action(
|
onTap: () {
|
||||||
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet),
|
scrollController.animateTo(0.0, duration: Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||||
|
walletMenu.action(
|
||||||
|
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet);
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 108,
|
height: 108,
|
||||||
width: 108,
|
width: 108,
|
||||||
|
@ -127,8 +132,11 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
}
|
}
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => walletMenu.action(
|
onTap: () {
|
||||||
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet),
|
scrollController.animateTo(0.0, duration: Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
|
||||||
|
walletMenu.action(
|
||||||
|
walletMenu.listItems.indexOf(item), wallet, isCurrentWallet);
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 108,
|
height: 108,
|
||||||
width: 108,
|
width: 108,
|
||||||
|
|
Loading…
Reference in a new issue