firebase_remote_helper 0.0.1+3 firebase_remote_helper: ^0.0.1+3 copied to clipboard
This plugin will help you easier to use firebase remote config.
Firebase Remote Helper #
Usage #
Await for the initialization
// Get the instance
final remoteHelper = FirebaseRemoteHelper.instance;
// Initialize
await remoteHelper.initial(
fetchTimeout: const Duration(minutes: 1), // Optinal: default is 1 minute
minimumFetchInterval: const Duration(minutes: 60), // Optinal: default is 60 minutes
defaultParameters: {}, // Optinal: default is not set
);
Or you can call initial and await for it later:
// Initialize
remoteHelper.initial(
fetchTimeout: const Duration(minutes: 1), // Optinal: default is 1 minute
minimumFetchInterval: const Duration(minutes: 60), // Optinal: default is 60 minutes
defaultParameters: {}, // Optinal: default is not set
);
// And wait for the initial later
await remoteHelper.ensureInitialized;
Get value
remoteHelper.get('key'); // .asBool, .asInt, .asDouble, .asString, .asMap, .asList
remoteHelper.getInt('key');
remoteHelper.getBool('key');
remoteHelper.getDouble('key');
remoteHelper.getString('key');
remoteHelper.getMap('key');
remoteHelper.getList('key');