Skip to content

Instantly share code, notes, and snippets.

@sahil280114
Created April 23, 2020 18:00
Show Gist options
  • Save sahil280114/8d3bbaba0ab0315d7e90d6c0858fd12b to your computer and use it in GitHub Desktop.
Save sahil280114/8d3bbaba0ab0315d7e90d6c0858fd12b to your computer and use it in GitHub Desktop.
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
imageURI == null
? Text('No image selected.')
: Image.file(imageURI, width: 300, height: 200, fit: BoxFit.cover),
Container(
margin: EdgeInsets.fromLTRB(0, 30, 0, 20),
child: RaisedButton(
onPressed: () => getImageFromCamera(),
child: Text('Click Here To Select Image From Camera'),
textColor: Colors.white,
color: Colors.blue,
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
)),
Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: RaisedButton(
onPressed: () => getImageFromGallery(),
child: Text('Click Here To Select Image From Gallery'),
textColor: Colors.white,
color: Colors.blue,
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
)),
Container(
margin: EdgeInsets.fromLTRB(0, 30, 0, 20),
child: RaisedButton(
onPressed: () => classifyImage(),
child: Text('Classify Image'),
textColor: Colors.white,
color: Colors.blue,
padding: EdgeInsets.fromLTRB(12, 12, 12, 12),
)),
result == null
? Text('Result')
: Text(result)
]))
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment