-
-
Save hitherejoe/ef090056d00802710c39099a477ce88e to your computer and use it in GitHub Desktop.
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
class PlatformContent { | |
List<Widget> generate(int categoryIndex, int selectedCountryIndex) { | |
return _buildContentWidgets(categoryIndex, selectedCountryIndex); | |
} | |
List<Widget> _buildContentWidgets( | |
int categoryIndex, int selectedCountryIndex) { | |
if (Platform.isAndroid) { | |
return [ | |
categoryIndex == 3 | |
? _buildContentWidget(3, categoryIndex) | |
: _buildContentWidget(0, categoryIndex), | |
_buildContentWidget(1, categoryIndex), | |
_buildContentWidget(2, categoryIndex) | |
]; | |
} else { | |
return categoryIndex == 3 | |
? [_buildContentWidget(3, categoryIndex)] | |
: [_buildContentWidget(selectedCountryIndex, categoryIndex)]; | |
} | |
} | |
Widget _buildContentWidget(int selectedCountryIndex, int navigationIndex) { | |
return SafeArea( | |
child: DocumentContent( | |
selectedCategory: categories[navigationIndex].documentName, | |
selectedCountry: countries[selectedCountryIndex].country, | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment