Last active
March 5, 2018 23:08
-
-
Save Elvis10ten/c47517c0552cb18ccbc12958e0070689 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Widget _getListViewWidget() { | |
| // We want the ListView to have the flexibility to expand to fill the | |
| // available space in the vertical axis | |
| return new Flexible( | |
| child: new ListView.builder( | |
| // The number of items to show | |
| itemCount: _currencies.length, | |
| // Callback that should return ListView children | |
| // The index parameter = 0...(itemCount-1) | |
| itemBuilder: (context, index) { | |
| // Get the currency at this position | |
| final Map currency = _currencies[index]; | |
| // Get the icon color. Since x mod y, will always be less than y, | |
| // this will be within bounds | |
| final MaterialColor color = _colors[index % _colors.length]; | |
| return _getListItemWidget(currency, color); | |
| })); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment