Created
October 23, 2021 08:31
-
-
Save jeckymodi/b3da62a669e65af67d13ac4f41e8d896 to your computer and use it in GitHub Desktop.
Segment Controll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getSegmentButtons() { | |
return Consumer<PageNotifier>(builder: (context, provider, snapshot) { | |
return Padding( | |
padding: EdgeInsets.only(left: 20, right: 20, top: 10), | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: [ | |
getButtonItem("Linked Accounts", selectedIndex == 0, onTap: () { | |
selectedIndex = 0; | |
provider.setCurrentPage = selectedIndex.toDouble(); | |
controller.animateToPage(selectedIndex.toInt(), | |
duration: Duration(milliseconds: 500), curve: Curves.easeIn); | |
}), | |
getButtonItem("Delinked Accounts", selectedIndex == 1, onTap: () { | |
selectedIndex = 1; | |
provider.setCurrentPage = selectedIndex.toDouble(); | |
controller.animateToPage(selectedIndex.toInt(), | |
duration: Duration(milliseconds: 500), curve: Curves.easeIn); | |
}), | |
], | |
), | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment