Created
January 9, 2019 19:21
-
-
Save jesusrp98/7ea784536f7551af19ecb5b903426d0d to your computer and use it in GitHub Desktop.
Launchpad model using ScopedModel
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 LaunchpadModel extends QuerryModel { | |
final String id, name; | |
LaunchpadModel(this.id, this.name); | |
@override | |
Future loadData() async { | |
// Get item by http call | |
response = await http.get(Url.launchpadDialog + id); | |
// Clear old data | |
clearItems(); | |
// Add parsed item | |
items.add(Launchpad.fromJson(json.decode(response.body))); | |
// Finished loading data | |
setLoading(false); | |
} | |
Launchpad get launchpad => items[0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment