load static method

Future<StaticHeadConfig> load(
  1. File file
)

Implementation

static Future<StaticHeadConfig> load(File file) async {
  final decoded = jsonDecode(await file.readAsString());
  if (decoded is! Map) {
    throw const FormatException('Config root must be a JSON object.');
  }
  return StaticHeadConfig.fromJson(Map<String, Object?>.from(decoded));
}