Skip to content

Instantly share code, notes, and snippets.

@barbswatanabe
Created July 23, 2018 01:32
Show Gist options
  • Save barbswatanabe/b1c07d71f6b00d247b105148c616fd91 to your computer and use it in GitHub Desktop.
Save barbswatanabe/b1c07d71f6b00d247b105148c616fd91 to your computer and use it in GitHub Desktop.
Zoom with drag and drop - Flutter
...
class _MyHomePageState extends State<MyHomePage> {
File _image;
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Stack(
children: <Widget>[
new Container(
child: _image == null ? null : new Image.file(_image),
),
new Positioned(
bottom: 15.0,
left: 15.0,
child: new FloatingActionButton(
onPressed: _initGallery,
child: new Icon(Icons.collections),
),
),
],
),
floatingActionButton: new FloatingActionButton(
onPressed: _initCamera,
child: new Icon(Icons.camera_alt),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment