update
This commit is contained in:
parent
a56ed92863
commit
bda39a56d0
12 changed files with 144 additions and 105 deletions
|
|
@ -0,0 +1,15 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class ImageWidget extends StatelessWidget {
|
||||
final String imagePath;
|
||||
final double size;
|
||||
final bool measureByHeight;
|
||||
const ImageWidget({super.key, required this.imagePath, required this.size, required this.measureByHeight});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return (measureByHeight)
|
||||
? Image.asset(imagePath, height: size, cacheHeight: (size * MediaQuery.of(context).devicePixelRatio).round())
|
||||
: Image.asset(imagePath, width: size, cacheWidth: (size * MediaQuery.of(context).devicePixelRatio).round());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue