Files class
Files provide verity of file picker like camera, gallery, file pre-define ui for file picker use customize ui and file pick
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
cameraPicker(
{required FileData fileData, required dynamic onSelected(FileData fileData), dynamic onCancel(String message, int messageCode)?, bool crop = false, int? maxFileSizeInMb, bool cropOnlySquare = false, String cropperToolbarTitle = Files.cropperToolbarTitle, Color cropperToolbarColor = Files.cropperToolbarColor, Color cropperToolbarWidgetsColor = Files.cropperToolbarWidgetsColor}) → dynamic - function camera picker for take picture and save to temporary cache directory
-
deleteFile(
{required FileData fileData, required dynamic onDeleted(FileData fileData)}) → dynamic - function file deletion
-
filePicker(
{required FileData fileData, required dynamic onSelected(FileData fileData), dynamic onCancel(String message, int messageCode)?, int? maxFileSizeInMb, List< String> allowedExtensions = const [Files.pdf, Files.doc, Files.docx, Files.xls, Files.xlsx, Files.ppt, Files.pptx, Files.png, Files.jpg, Files.jpeg]}) → dynamic - function file picker for pick any file and save to temporary cache directory
-
filePickerOptions(
{required BuildContext context, required FileData fileData, required FileMode fileMode, required dynamic onSelected(FileData fileData), dynamic onCancel(String message, int messageCode)?, bool crop = false, int? maxFileSizeInMB, bool cropOnlySquare = false, String cropperToolbarTitle = Files.cropperToolbarTitle, Color cropperToolbarColor = Files.cropperToolbarColor, Color cropperToolbarWidgetsColor = Files.cropperToolbarWidgetsColor, List< String> allowedExtensions = Files.allowedAllExtensions}) → dynamic - function file picker options
-
getFileExtension(
String? path, {bool withDot = true}) → String - get file extension
-
getFileName(
String? path, {bool withExtension = true}) → String - get file name from file path or url
-
getMimeType(
String? path) → String - get file mime type
-
imagePicker(
{required FileData fileData, required dynamic onSelected(FileData fileData), dynamic onCancel(String message, int messageCode)?, bool crop = false, int? maxFileSizeInMb, bool cropOnlySquare = false, String cropperToolbarTitle = Files.cropperToolbarTitle, Color cropperToolbarColor = Files.cropperToolbarColor, Color cropperToolbarWidgetsColor = Files.cropperToolbarWidgetsColor}) → dynamic - function image picker for pick image from gallery and save to temporary cache directory
-
isHttpPath(
String filePath) → bool - check http file path
-
kb(
int sizeInBytes) → double - get file size in KB
-
mb(
int sizeInBytes) → double - get file size in MB
-
setFileDataFromUpdate(
{required String? path}) → FileData - selected file path or url to set FileData
-
viewFile(
{required FileData fileData, dynamic onView(FileData fileData)?}) → dynamic - function file view
Constants
-
allowedAllExtensions
→ const List<
String> - allowed all extensions
- cropperToolbarColor → const Color
- cropperToolbarTitle → const String
- cropperToolbarWidgetsColor → const Color
- doc → const String
- docx → const String
- gif → const String
- jpeg → const String
- jpg → const String
- pdf → const String
- file extensions
- png → const String
- ppt → const String
- pptx → const String
- xls → const String
- xlsx → const String