PickerStyle constructor
PickerStyle({
- BorderRadius borderRadius = const BorderRadius.all(Radius.circular(10)),
- Color backgroundColor = Colors.white,
- Color textColor = Colors.black,
- Color selectIconBackgroundColor = Colors.white,
- Widget selectIcon = const Icon(Icons.check, color: Colors.black),
- bool isNeedDragIndicator = true,
- Border selectIconBorder = const Border(),
- Color dragIndicatorColor = Colors.grey,
- EdgeInsets mainPadding = const EdgeInsets.all(10),
- BorderRadius itemsBorderRadius = const BorderRadius.all(Radius.circular(10)),
- Color shimmerBaseColor = Colors.grey,
- Color shimmerHighlightColor = Colors.white,
- Alignment selectIconAlignment = Alignment.topRight,
- Color dividerColor = Colors.grey,
- Color selectedFolderTextColor = Colors.white,
- Color unselectedFolderTextColor = Colors.black,
- BoxDecoration selectedFolderDecoration = const BoxDecoration(color: Colors.blue, borderRadius: BorderRadius.all(Radius.circular(10))),
- BoxDecoration unselectedFolderDecoration = const BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.all(Radius.circular(10))),
- BoxDecoration cameraContainerDecoration = const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10))),
- Widget cameraIcon = const Icon(Icons.camera_alt, color: Colors.white),
- Widget? completeWidget,
- CloseAlertStyle? closeAlertStyle,
- Future<
bool> showCustomAlert()?, - Widget? typeSelectionWidget,
- double bottomPadding = 0,
- Widget folderDivider = const Divider(),
- Widget titleWidget = const Text('Select media'),
- bool hasPermissionToCamera = true,
- bool hasPermissionToGallery = true,
- EdgeInsets cameraPreviewPadding = const EdgeInsets.all(16),
- int crossAxisCount = 4,
- double crossAxisSpacing = 4,
- double mainAxisSpacing = 4,
- Widget? unselectAssetIcon,
- Widget? customSelectAssetIcon,
- TextStyle? customSelectAssetCountStyle,
Picker style
Implementation
PickerStyle({
this.borderRadius = const BorderRadius.all(Radius.circular(10)),
this.backgroundColor = Colors.white,
this.textColor = Colors.black,
this.selectIconBackgroundColor = Colors.white,
this.selectIcon = const Icon(Icons.check, color: Colors.black),
this.isNeedDragIndicator = true,
this.selectIconBorder = const Border(),
this.dragIndicatorColor = Colors.grey,
this.mainPadding = const EdgeInsets.all(10),
this.itemsBorderRadius = const BorderRadius.all(Radius.circular(10)),
this.shimmerBaseColor = Colors.grey,
this.shimmerHighlightColor = Colors.white,
this.selectIconAlignment = Alignment.topRight,
this.dividerColor = Colors.grey,
this.selectedFolderTextColor = Colors.white,
this.unselectedFolderTextColor = Colors.black,
this.selectedFolderDecoration = const BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
),
this.unselectedFolderDecoration = const BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
),
this.cameraContainerDecoration = const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(
10,
)),
),
this.cameraIcon = const Icon(
Icons.camera_alt,
color: Colors.white,
),
this.completeWidget,
CloseAlertStyle? closeAlertStyle,
this.showCustomAlert,
this.typeSelectionWidget,
this.bottomPadding = 0,
this.folderDivider = const Divider(),
this.titleWidget = const Text('Select media'),
this.cameraAndGalleryUnavailableContent =
const Text('There is no permission to access the camera and gallery'),
this.cameraUnavailableContent = const Text('There is no permission to access the camera'),
this.galleryUnavailableContent = const Text('There is no permission to access the gallery'),
this.hasPermissionToCamera = true,
this.hasPermissionToGallery = true,
this.cameraPreviewPadding = const EdgeInsets.all(16),
this.crossAxisCount = 4,
this.crossAxisSpacing = 4,
this.mainAxisSpacing = 4,
this.unselectAssetIcon,
this.customSelectAssetIcon,
this.customSelectAssetCountStyle,
}) : _closeAlertStyle = closeAlertStyle ??
CloseAlertStyle(
title: 'Close',
message: 'Are you sure you want to close?',
positiveButtonText: 'Yes',
negativeButtonText: 'No',
);