configuration method
void
configuration(})
Implementation
void configuration(Config? config,
{required dynamic Function(List<MediaFile>) onSelect,
required Widget Function(String, MediaFile, BuildContext)? heroBuilder,
required bool isRecent,
required bool startWithRecent,
required List<MediaFile>? initSelectedMedias,
required List<MediaFile>? extraRecentMedia,
required Widget Function(List<MediaFile>, BuildContext)?
multipleMediasBuilder}) {
this.onSelect = onSelect;
this.heroBuilder = heroBuilder;
this.isRecent = isRecent;
this.startWithRecent = startWithRecent;
this.multipleMediasBuilder = multipleMediasBuilder;
pageController = PageController();
pickerPageController = PageController(initialPage: startWithRecent ? 0 : 1);
this.config = config ?? Config();
if (initSelectedMedias != null) {
_selectedFiles = initSelectedMedias.map((e) => e).toList();
}
if (extraRecentMedia != null) {
_extraRecentMedia = extraRecentMedia.map((e) => e).toList();
}
if (selectedFiles.isNotEmpty) {
_pickerMode = true;
}
configurationCompleted = true;
}