jsonFromPath function

Future jsonFromPath(
  1. String path
)

Implementation

Future<dynamic> jsonFromPath(String path) async {
  if (!path.endsWith('.json')) return null;
  final file = File(path);
  if (!await file.exists()) return null;
  return json.decode(await file.readAsString());
}