showCustomFilePicker method
Implementation
Future<File?> showCustomFilePicker({
required BuildContext context,
List<String>? allowedExtensions,
fp.FileType type = fp.FileType.any,
String? title,
Color? primaryColor,
Color? backgroundColor,
}) async {
bool hasPermission = await _checkStoragePermission();
if (!hasPermission) return null;
primaryColor ??= AppColors.primary;
backgroundColor ??= Colors.white;
final result = await showModalBottomSheet<File>(
context: context,
backgroundColor: Colors.transparent,
builder: (context) => _CustomFilePickerSheet(
allowedExtensions: allowedExtensions,
type: type,
title: title ?? 'Select File',
primaryColor: primaryColor!,
backgroundColor: backgroundColor!,
),
);
return result;
}