Flutter-Global-Config
Flutter-Global-Config copied to clipboard
Unable to use configuration value as default for a constructor parameter
Because GlobalConfiguration doesn't have a const constructor. It's not possible to use a configured value as a default for a parameter in class constructors.
This is not possible right now
const Duration(milliseconds: 150 * GlobalConfiguration().getValue<int>('animationMultiplier'))
I am not sure if this makes sense at all due to the fact that values from the config can change over time. I for example use this package in combination with shared preferences to hold the shared pref data in memory and make it globaly available. When i update the shared pref data i also have to update the data stored in the global configuration singleton.
But I am open minded for a PR. Feel free to contribute this.