init static method

Future<VariablesPlugin> Function(DevbarState) init({
  1. Map<String, dynamic>? values,
  2. VariablesStore? store,
  3. Future<VariablesStore> storeFactory()?,
  4. FutureOr<String> filePath()?,
  5. String? title,
})

Implementation

static Future<VariablesPlugin> Function(DevbarState) init({
  Map<String, dynamic>? values,
  VariablesStore? store,
  Future<VariablesStore> Function()? storeFactory,
  FutureOr<String> Function()? filePath,
  String? title,
}) {
  return (devbar) async {
    if (store == null) {
      if (storeFactory != null) {
        store = await storeFactory();
      } else if (filePath != null) {
        store = await FileVariableStore.load(File(await filePath()));
      }
    }
    return VariablesPlugin._(devbar,
        overrides: values, store: store, title: title);
  };
}