Created
June 18, 2022 12:05
-
-
Save FlutterWiz/8a5b0e7143687dcd844e0f6a96bbdeb7 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
final charactersDatasProvider = FutureProvider.autoDispose<List<CharacterModel>>( | |
(ref) { | |
return ref.read(apiProvider).getCharactersDatas().then( | |
(characters) { | |
final List<CharacterModel> characterList = []; | |
for (var i = 0; i < 10; i++) { | |
characterList.add( | |
CharacterModel( | |
characterName: characters[i]["name"], | |
characterImgUrl: characters[i]["image"], | |
), | |
); | |
} | |
return characterList; | |
}, | |
); | |
}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment