toImageWidget method

Widget toImageWidget({
  1. double? height,
  2. double? width,
  3. int turns = 0,
})

Implementation

Widget toImageWidget({double? height, double? width, int turns = 0}) {
  if (path.isEmpty) {
    throw Exception('Image path cannot be empty');
  }

  return RotatedBox(
    quarterTurns: turns,
    child: kIsWeb
        ? Image.network(
            path,
            height: height,
            width: width,
          )
        : Image.file(
            File(path),
            width: width,
            height: height,
            fit: BoxFit.fill,
          ),
  );
}