pushToViewer static method

Future<AssetEntity?> pushToViewer(
  1. BuildContext context, {
  2. required CameraPickerState pickerState,
  3. required XFile previewXFile,
  4. required ThemeData theme,
  5. bool shouldDeletePreviewFile = false,
  6. 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);
      },
    ),
  );
}