pushToViewer static method
Future<AssetEntity?>
pushToViewer(
- BuildContext context, {
- required CameraPickerState pickerState,
- required XFile previewXFile,
- required ThemeData theme,
- bool shouldDeletePreviewFile = false,
- EntitySaveCallback? onEntitySaving,
Static method to push with the navigator.
Implementation
static Future<AssetEntity?> pushToViewer(
BuildContext context, {
required CameraPickerState pickerState,
required XFile previewXFile,
required ThemeData theme,
bool shouldDeletePreviewFile = false,
EntitySaveCallback? onEntitySaving,
}) {
return Navigator.of(context).push<AssetEntity?>(
PageRouteBuilder<AssetEntity?>(
pageBuilder: (_, __, ___) => CameraPickerViewer(
pickerState: pickerState,
previewXFile: previewXFile,
theme: theme,
shouldDeletePreviewFile: shouldDeletePreviewFile,
onEntitySaving: onEntitySaving,
),
transitionsBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) {
return FadeTransition(opacity: animation, child: child);
},
),
);
}