FutureOr<Uint8List> get data { var data = _data; if (data is Uint8List) { return data.asUnmodifiableView(); } else if (data is DataProvider) { return data.get(); } throw StateError('Unknown data type: $data'); }