提交 b9d1a527 authored 作者: ritheshSalyan's avatar ritheshSalyan

Update Readme

上级 237ce298
## [0.3.0] - 10/02/2021 ## [0.3.0] - 10/02/2021
* breaking change capture method returns Uint8List instead of File. * breaking change capture method returns Uint8List instead of File.
* support for web and windows * support for web and windows
* Add captureAndSave method.
## [0.2.0] - 10/06/2020 ## [0.2.0] - 10/06/2020
......
...@@ -37,7 +37,7 @@ Screenshot( ...@@ -37,7 +37,7 @@ Screenshot(
), ),
``` ```
3) Take the screenshot by calling capture method. This will return a File 3) Take the screenshot by calling capture method. This will return a Uint8List
```dart ```dart
screenshotController.capture().then((Uint8List image) { screenshotController.capture().then((Uint8List image) {
...@@ -108,15 +108,22 @@ Example: ...@@ -108,15 +108,22 @@ Example:
<img src="assets/screenshot.png" alt="screenshot" width="400"/> <img src="assets/screenshot.png" alt="screenshot" width="400"/>
## Saving images to Specific Location
For this you can use captureAndSave method by passing directory location. By default, the captured image will be saved to Application Directory. Custom paths can be set using **path parameter**. Refer [path_provider](https://pub.dartlang.org/packages/path_provider)
### Note
>Method captureAndSave is not supported for web.
By defualt, the captured image will be saved to Application Directory. Custom paths can be set using **path parameter**. Refer [path_provider](https://pub.dartlang.org/packages/path_provider)
```dart ```dart
final directory = (await getApplicationDocumentsDirectory ()).path; //from path_provide package final directory = (await getApplicationDocumentsDirectory ()).path; //from path_provide package
String fileName = DateTime.now().toIso8601String(); String fileName = DateTime.now().microsecondsSinceEpoch;
path = '$directory/$fileName.png'; path = '$directory';
screenshotController.capture( screenshotController.captureAndSave(
path:path //set path where screenshot will be saved path //set path where screenshot will be saved
fileName:fileName
); );
``` ```
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论