Config.fromJson constructor

Config.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Config.fromJson(Map<String, dynamic> json) {
  if (json['bloc'] == true) return const Config(layer: PresentationLayer.bloc);
  if (json['riverpod'] == true) return const Config(layer: PresentationLayer.riverpod);
  if (json['getx'] == true) return const Config(layer: PresentationLayer.getx);
  // layer == null — will be caught by Parser.validateSchema.
  return const Config();
}