localMediaProvider top-level property Null safety

ChangeNotifierProviderFamily<LocalMediaModel, String> localMediaProvider
final

Model for retrieving local images and videos and getting them with LocalMedia.

Images and video are acquired separately.

final media = read(localMediaProvider("test.jpg")).image();
if(media == null) return;
final media = read(localMediaProvider("test.jpg")).video();
if(media == null) return;

Implementation

final localMediaProvider =
    ChangeNotifierProvider.family<LocalMediaModel, String>(
  (_, path) => LocalMediaModel(path),
);