提交 9df6f30e authored 作者: ritheshSalyan's avatar ritheshSalyan

update Readme

上级 de95fbdc
## [1.0.0-nullsafety.0] - 10/02/2021
* Add nullsafety
## [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
......
...@@ -50,7 +50,7 @@ class MyHomePage extends StatefulWidget { ...@@ -50,7 +50,7 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> { class _MyHomePageState extends State<MyHomePage> {
int _counter = 0; int _counter = 0;
Uint8List? _imageFile; // Uint8List? _imageFile;
//Create an instance of ScreenshotController //Create an instance of ScreenshotController
ScreenshotController screenshotController = ScreenshotController(); ScreenshotController screenshotController = ScreenshotController();
...@@ -90,18 +90,18 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -90,18 +90,18 @@ class _MyHomePageState extends State<MyHomePage> {
child: new Center( child: new Center(
child: Screenshot( child: Screenshot(
controller: screenshotController, controller: screenshotController,
child: Text("HEllo"), child: Text("You have pushed button $_counter times"),
), ),
), ),
), ),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
onPressed: () { onPressed: () {
_incrementCounter(); _incrementCounter();
_imageFile = null; // _imageFile = null;
screenshotController screenshotController
.capture(delay: Duration(milliseconds: 10)) .capture(delay: Duration(milliseconds: 10))
.then((Uint8List? image) async { .then((Uint8List? image) async {
_imageFile = image; // _imageFile = image;
if (image != null) { if (image != null) {
showDialog( showDialog(
context: context, context: context,
...@@ -112,7 +112,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -112,7 +112,7 @@ class _MyHomePageState extends State<MyHomePage> {
body: Center( body: Center(
child: Column( child: Column(
children: [ children: [
if (image != null) Image.memory(image), Image.memory(image),
], ],
)), )),
), ),
......
...@@ -8,7 +8,7 @@ description: A new Flutter project. ...@@ -8,7 +8,7 @@ description: A new Flutter project.
# build by specifying --build-name and --build-number, respectively. # build by specifying --build-name and --build-number, respectively.
# Read more about versioning at semver.org. # Read more about versioning at semver.org.
version: 1.0.0+1 version: 1.0.0+1
publish_to: none
environment: environment:
# sdk: '>=2.8.0 <3.0.0' # sdk: '>=2.8.0 <3.0.0'
sdk: '>=2.12.0-259.8.beta <3.0.0' sdk: '>=2.12.0-259.8.beta <3.0.0'
......
name: screenshot name: screenshot
description: Flutter Screenshot Package (Runtime). Capture any Widget as an image. description: Flutter Screenshot Package (Runtime). Capture any Widget as an image.
version: 0.3.0 version: 1.0.0-nullsafety.0
homepage: https://github.com/SachinGanesh/screenshot homepage: https://github.com/SachinGanesh/screenshot
environment: environment:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论