LiteFilePicker constructor

LiteFilePicker({
  1. required String name,
  2. Key? key,
  3. AutovalidateMode? autovalidateMode,
  4. int maxFiles = 1,
  5. ViewBuilder? viewBuilder,
  6. LiteFormValueSerializer? initialValueDeserializer,
  7. Object? initialValue,
  8. LiteFormValueSerializer serializer = nonConvertingValueConvertor,
  9. List<LiteValidator>? validators,
  10. String? hintText,
  11. String? label,
  12. LiteDropSelectorViewType dropSelectorType = LiteDropSelectorViewType.adaptive,
  13. TextStyle? errorStyle,
  14. double paddingTop = 0.0,
  15. double paddingBottom = 0.0,
  16. double paddingLeft = 0.0,
  17. double paddingRight = 0.0,
  18. double? aspectRatio,
  19. BoxConstraints? constraints,
  20. double width = 110.0,
  21. double height = 70.0,
  22. CameraDevice preferredCameraDevice = CameraDevice.rear,
  23. double? maxHeight,
  24. double? maxWidth,
  25. EdgeInsets? margin,
  26. int? imageQuality,
  27. BoxDecoration? decoration,
  28. DropSelectorItemIconBuilder? menuItemBuilder,
  29. EdgeInsets? smoothErrorPadding = const EdgeInsets.only(top: 6.0),
  30. double imageSpacing = 1.0,
  31. double menuButtonHeight = 54.0,
  32. bool requestFullMetadata = false,
  33. bool allowVideo = true,
  34. bool allowImages = true,
  35. FocusNode? focusNode,
  36. List<FileSource> sources = const [FileSource.camera, FileSource.gallery, FileSource.fileExplorer],
  37. List<String>? allowedExtensions,
})

Implementation

LiteFilePicker({
  required this.name,
  Key? key,
  this.autovalidateMode,
  this.maxFiles = 1,
  this.viewBuilder,
  this.initialValueDeserializer,
  this.initialValue,
  this.serializer = nonConvertingValueConvertor,
  this.validators,
  this.hintText,
  this.label,
  this.dropSelectorType = LiteDropSelectorViewType.adaptive,
  this.errorStyle,
  this.paddingTop = 0.0,
  this.paddingBottom = 0.0,
  this.paddingLeft = 0.0,
  this.paddingRight = 0.0,
  this.aspectRatio,
  this.constraints,
  this.width = 110.0,
  this.height = 70.0,
  this.preferredCameraDevice = CameraDevice.rear,
  this.maxHeight,
  this.maxWidth,
  this.margin,
  this.imageQuality,
  this.decoration,
  this.menuItemBuilder,
  this.smoothErrorPadding = const EdgeInsets.only(
    top: 6.0,
  ),
  this.imageSpacing = 1.0,
  this.menuButtonHeight = 54.0,
  this.requestFullMetadata = false,
  this.allowVideo = true,
  this.allowImages = true,
  this.focusNode,
  this.sources = const [
    FileSource.camera,
    FileSource.gallery,
    FileSource.fileExplorer,
  ],
  this.allowedExtensions,
  // this.allowedExtensions = const [
  //   'jpg',
  //   'jpeg',
  //   'pdf',
  //   'doc',
  //   'bmp',
  //   'png',
  //   'gif',
  //   'mp4',
  //   'mov',
  //   'avi',
  //   'webp',
  //   'tif',
  // ],
})  : assert(sources.isNotEmpty),
      super(key: key ?? Key(name));