StorageProvider class
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
Static Methods
-
configure({BuildContext? context, bool showProgress = false, Future<ImageSource?> getImageSource()?, Future<void> showDataUploadProgress(UploadTask uploadTask)?})
→ void
-
-
get(String path, {bool isLocal = false, StorageType type = StorageType.string})
→ Future
-
Get object from storage or local
-
getImage(String path, {bool isLocal = false})
→ Future<Uint8List?>
-
Get image from storage or local
-
getJson(String path, {bool isLocal = false})
→ Future<Map<String, dynamic>?>
-
Get json from storage or local
-
getLocalImage(String path)
→ Future<Uint8List?>
-
Get image from local storage
-
getLocalJson(String path)
→ Future<Map<String, dynamic>?>
-
Get json from local storage
-
getLocalString(String path)
→ Future<String?>
-
Get string from local storage
-
getLocalVideo(String path)
→ Future<Uint8List?>
-
Get video from local storage
-
getSource({Color? backgroundColor = Colors.transparent, BuildContext? context})
→ Future<ImageSource?>
-
Let the default showModalBottomSheet get the source from user.
-
getString(String path, {bool isLocal = false})
→ Future<String?>
-
Get string from storage or local
-
getVideo(String path, {bool isLocal = false})
→ Future<Uint8List?>
-
Get video from storage or local
-
remove(String path, {bool isLocal = false})
→ Future<void>
-
Remove object from storage
-
removeUrl(String url)
→ Future<void>
-
Remove object from url (only storage in firebase)
-
save(String path, dynamic value, {String? extensionFormat, String? fileName, bool showProgress = false, BuildContext? context, bool toLocalStorage = false})
→ Future<String>
-
Save an object to database
-
saveBytes(XFile imageFile, String path, {String? extensionFormat})
→ Future<String>
-
Uploads the selected Asset as XFile and returns file link
-
saveImage(XFile imageFile, String path, {String? extensionFormat = '.png'})
→ Future<String>
-
Uploads the selected image as XFile and returns a link
-
saveLocalImage(String path, Uint8List imageBytes, {String? extensionFormat = '.png'})
→ Future<String>
-
Saves the image to local storage
-
saveLocalJson(String path, Map<String, dynamic> value, {String? extensionFormat = '.json'})
→ Future<void>
-
Saves the json to local storage
-
saveLocalString(String path, String value, {String? extensionFormat = '.txt'})
→ Future<void>
-
Saves the string to local storage
-
saveLocalVideo(String path, Uint8List videoBytes, {String? extensionFormat = '.mp4'})
→ Future<String>
-
Saves the video to local storage
-
saveVideo(XFile videoFile, String path, {String? extensionFormat = '.mp4'})
→ Future<String>
-
Uploads the selected video as XFile and returns a link
-
selectAndUpload(String path, {ImageSource? source, bool isVideo = false, Color? backgroundColor = Colors.transparent, int maxImagesCount = 10, BuildContext? context, String? extensionFormat, bool showProgress = false})
→ Future<List<String>>
-
Select assets from gallery or camera and stores them in the variable selectedAssets.
-
selectAssets({bool isVideo = false, ImageSource? source, BuildContext? context, Color? backgroundColor = Colors.transparent, int maxImagesCount = 10})
→ Future<bool>
-
Select assets from gallery or camera and stores them in the variable selectedAssets.
-
uploadSelectedAssets(String path, {List<XFile>? selectedImages, BuildContext? context, String? extensionFormat, bool isVideo = false, bool showProgress = false})
→ Future<List<String>>
-
Upload the selectedAssets to the given
path
.