read method

  1. @override
Future<String?> read(
  1. String key
)
override

Read cookie string from the given key in the storage.

Implementation

@override
Future<String?> read(String key) async {
  final file = File('$_currentDirectory$key');
  if (file.existsSync()) {
    if (readPreHandler != null) {
      return readPreHandler!(await file.readAsBytes());
    } else {
      return file.readAsString();
    }
  }
  return null;
}