Last active
September 7, 2019 17:40
-
-
Save icatalud/121a1cb789a7d08c61f8a6f4d9a9cf37 to your computer and use it in GitHub Desktop.
Using a static class as a port to `floop` Map
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 DynamicValues { | |
static Widget get image => floop['image']; | |
static set image(Widget widget) => floop['image'] = widget; | |
// Here should go all the reads and writes to `floop` | |
} | |
/// It's also possible to create a local [ObservedMap]. | |
/// `floop` is just an instance of [ObservedMap]. | |
class DynamicValuesLocal { | |
static ObservedMap<String, dynamic> dyn = ObservedMap(); | |
static Widget get image => dyn['image']; | |
static set image(Widget widget) => dyn['image'] = widget; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment