selectMedia static method
Future<List<Uint8List> ?>
selectMedia(
- dynamic context, {
- String? titleText = '',
- String? completeText = 'done',
- String? selectAlbumText = '',
- int? crossAxisCount = 4,
- int? maxLength = 2,
- double? aspectRatio = 1.0 / 1.91,
- double? previewHeight = 300,
- double? previewShowingRatio = 1 / 3,
- Color? backgroundColor = Colors.grey,
- Color? tagColor = Colors.yellow,
- Color? tagTextColor = Colors.black,
- Color? textColor = Colors.white,
- Widget? loadingWidget = const Center(child: CircularProgressIndicator()),
- Widget? actionLoadingWidget = const Center(child: CircularProgressIndicator()),
Implementation
static Future<List<Uint8List>?> selectMedia(
context, {
String? titleText = '',
String? completeText = 'done',
String? selectAlbumText = '',
int? crossAxisCount = 4,
int? maxLength = 2,
double? aspectRatio = 1.0 / 1.91,
double? previewHeight = 300,
double? previewShowingRatio = 1 / 3,
Color? backgroundColor = Colors.grey,
Color? tagColor = Colors.yellow,
Color? tagTextColor = Colors.black,
Color? textColor = Colors.white,
Widget? loadingWidget = const Center(
child: CircularProgressIndicator(),
),
Widget? actionLoadingWidget = const Center(
child: CircularProgressIndicator(),
),
}) async {
assert(maxLength! > 0);
assert(crossAxisCount! > 0);
assert(aspectRatio! > 0);
assert(previewHeight! >= 0);
assert(previewShowingRatio! >= 0);
return await Navigator.of(context, rootNavigator: true)
.push(MaterialPageRoute(
builder: (context) => _SelectMediaPage(
titleText!,
completeText!,
selectAlbumText!,
crossAxisCount!,
maxLength!,
aspectRatio!,
previewHeight!,
previewShowingRatio!,
backgroundColor!,
tagColor!,
tagTextColor!,
textColor!,
loadingWidget!,
actionLoadingWidget!,
key: UniqueKey(),
)));
}