read method

  1. @override
Future<State> read()
override

Reads the state from storage.

Implementation

@override
Future<State> read() async {
  final file = await this.file();

  if (file.existsSync()) {
    final json = await file.readAsString();
    return converter.fromJson(jsonDecode(json));
  }

  return null;
}