SingleAssetPicker constructor

const SingleAssetPicker({
  1. Key? key,
  2. ValueChanged<ExtendedAssetEntity>? onChanged,
  3. bool enablePicker = true,
  4. PickerErrorCallback? errorCallback,
  5. List<PickerFromTypeConfig> fromRequestTypes = const [PickerFromTypeConfig(fromType: PickerFromType.assets, text: Text('图库选择'), requestType: RequestType.common), PickerFromTypeConfig(fromType: PickerFromType.camera, text: Text('相机拍摄'), requestType: RequestType.common), PickerFromTypeConfig(fromType: PickerFromType.cancel, text: Text('取消'), requestType: RequestType.common)],
  6. CameraPickerPageRoute<AssetEntity> pageRouteBuilderForCameraPicker(
    1. Widget picker
    )?,
  7. AssetPickerPageRouteBuilder<List<AssetEntity>>? pageRouteBuilderForAssetPicker,
  8. PickerFromTypeBuilder? fromTypesBuilder,
  9. FlAssetFileRenovate? renovate,
  10. FlAssetsPickerCheckPermission? checkPermission,
  11. PickerAssetEntryBuilderConfig config = const PickerAssetEntryBuilderConfig(),
  12. SinglePickerEntryBuilder? builder,
  13. ExtendedAssetEntity? initialData,
  14. bool allowDelete = true,
})

Implementation

const SingleAssetPicker({
  super.key,
  this.onChanged,
  super.enablePicker = true,
  super.errorCallback,
  super.fromRequestTypes = const [
    PickerFromTypeConfig(
        fromType: PickerFromType.assets,
        text: Text('图库选择'),
        requestType: RequestType.common),
    PickerFromTypeConfig(
        fromType: PickerFromType.camera,
        text: Text('相机拍摄'),
        requestType: RequestType.common),
    PickerFromTypeConfig(
        fromType: PickerFromType.cancel,
        text: Text('取消'),
        requestType: RequestType.common),
  ],
  super.pageRouteBuilderForCameraPicker,
  super.pageRouteBuilderForAssetPicker,
  super.fromTypesBuilder,
  super.renovate,
  super.checkPermission,
  this.config = const PickerAssetEntryBuilderConfig(),
  this.builder,
  this.initialData,
  this.allowDelete = true,
}) : super(maxCount: 1, maxVideoCount: 0);