Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Size _getImageSize(Image image) {
- return Size(image.width.toDouble(), image.height.toDouble());
- }
- Widget _buildBody() {
- return FutureBuilder<File>(
- future: _imageFile,
- builder: (BuildContext context, AsyncSnapshot<File> snapshot) {
- if (snapshot.connectionState == ConnectionState.done &&
- snapshot.hasData) {
- // return Image.file(snapshot.data);
- return Container(
- foregroundDecoration:
- TextDetectDecoration(_currentLabels, _getImageSize(Image.file(snapshot.data, fit: BoxFit.fitWidth))),
- child: Image.file(snapshot.data, fit: BoxFit.fitWidth));
- } else if (snapshot.error != null) {
- return const Text(
- 'Error picking image.',
- textAlign: TextAlign.center,
- );
- } else {
- return const Text(
- 'You have not yet picked an image.',
- textAlign: TextAlign.center,
- );
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement