ScreenShotHelperUtil 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
-
createDirectory({required BuildContext context, String? androidDirectoryPath})
→ Future<String>
-
To create the directory for saving the file
context is required
androidDirectoryPath is optional and default is Download directory path | if you want another android directory
For iOS the directory is Application Documents Directory
-
getFileNameForSave({required String fileNamePrefix, String fileExtension = ".png"})
→ String
-
Get file name for saving the image
fileNamePrefix is required, to be appended in the start of the file name
For example the fileNamePrefix is myfile_ then the file name returned would be myfile_(getFileNameForSaveResult)
fileExtension is the extension of the file that needs to saved, default is .png
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
takeAndSaveScreenShot({required BuildContext context, required GlobalKey<State<StatefulWidget>> repaintBoundaryKey, required String filename, required String imageToSaveCustomDirectoryName, required dynamic onScreenShotSavedCallback(ScreenShotHelperModel? screenShotHelperModel), String? androidSystemDirectoryPath, double? pixelRatio})
→ Future<void>
-
takes the screen shot and then save
context is required
repaintBoundaryKey is the Global key that you will have to assign to the repaint boundary widget
filename is the name of the file that want to save the screen shot with
imageToSaveCustomDirectoryName the custom directory inside the system directory | for creating a separate directory to save this image in
androidSystemDirectoryPath the system directory | for now only for Android, default is downloads directory for Android and for iOS is documents directory
onScreenShotSavedCallback is the call back with the model populated with the data about the method success, permission result and save success!
pixelRatio for screen ratio, default is 1
-
toString()
→ String
-
A string representation of this object.
inherited