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
if (result.hasException) { | |
return Text(result.exception.toString()); | |
} |
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
if (result.loading) { | |
return const Center( | |
child: CircularProgressIndicator(), | |
); | |
} |
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
final allCompanies = CompaniesData.fromJson(result.data).allCompanies; | |
return ListView.builder( | |
itemBuilder: (_, index) { | |
return ListTile( | |
leading: Icon(Icons.card_travel), | |
title: Text(allCompanies[index].name), | |
subtitle: Text(allCompanies[index].industry), | |
); | |
}, |
OlderNewer