pushToViewer static method
Future<AssetEntity?>
pushToViewer(
- BuildContext context, {
- required CameraPickerConfig pickerConfig,
- required CameraPickerViewType viewType,
- required XFile previewXFile,
- CameraPickerViewerState createViewerState()?,
Static method to push with the navigator. 跳转至选择预览的静态方法
Implementation
static Future<AssetEntity?> pushToViewer(
BuildContext context, {
required CameraPickerConfig pickerConfig,
required CameraPickerViewType viewType,
required XFile previewXFile,
CameraPickerViewerState Function()? createViewerState,
bool useRootNavigator = true,
}) {
return Navigator.of(
context,
rootNavigator: useRootNavigator,
).push<AssetEntity?>(
PageRouteBuilder<AssetEntity?>(
pageBuilder: (_, __, ___) => CameraPickerViewer._(
viewType: viewType,
previewXFile: previewXFile,
pickerConfig: pickerConfig,
createViewerState: createViewerState,
),
transitionsBuilder: (
BuildContext context,
Animation<double> animation,
Animation<double> secondaryAnimation,
Widget child,
) {
return FadeTransition(opacity: animation, child: child);
},
),
);
}