toImageWidget method
Implementation
Widget toImageWidget({double? height, double? width, int turns = 0}) {
if (kIsWeb || path.isEmpty) {
return FutureBuilder(
future: readAsBytes(),
builder: (context, snapshot) {
if (snapshot.hasData) {
return RotatedBox(
quarterTurns: turns,
child: Image.memory(
snapshot.data!,
height: height,
width: width,
),
);
} else {
return Container();
}
},
);
}
return RotatedBox(
quarterTurns: turns,
child: Image.file(
File(path),
width: width,
height: height,
fit: BoxFit.fill,
),
);
}