Initial commit
This commit is contained in:
commit
e5c20d673f
73 changed files with 2128 additions and 0 deletions
24
lib/widgets/image_widget.dart
Normal file
24
lib/widgets/image_widget.dart
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class ImageWidget extends StatelessWidget {
|
||||
final String imagePath;
|
||||
final double size;
|
||||
final bool measureByHeight;
|
||||
final bool? network;
|
||||
const ImageWidget(
|
||||
{super.key, required this.imagePath, required this.size, required this.measureByHeight, this.network});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return (network == true)
|
||||
? (measureByHeight)
|
||||
? Image.network(imagePath,
|
||||
height: size, cacheHeight: (size * MediaQuery.of(context).devicePixelRatio).round())
|
||||
: Image.network(imagePath,
|
||||
width: size, cacheWidth: (size * MediaQuery.of(context).devicePixelRatio).round())
|
||||
: (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