You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
Dart
55 lines
1.5 KiB
Dart
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
showZoomImageDialog(BuildContext context, String url, {bool isNetworkImage = true}) {
|
|
showDialog(
|
|
context: context,
|
|
builder: (BuildContext context) => Dialog(
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12.0),
|
|
), //this right here
|
|
child: ShowZoomImage(url, isNetworkImage),
|
|
),
|
|
);
|
|
}
|
|
|
|
class ShowZoomImage extends StatelessWidget {
|
|
String url;
|
|
bool isNetworkImage = true;
|
|
|
|
ShowZoomImage(this.url, this.isNetworkImage);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
width: double.infinity,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: [
|
|
IconButton(
|
|
icon: Icon(Icons.close),
|
|
onPressed: () {
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
isNetworkImage
|
|
? CachedNetworkImage(
|
|
imageUrl: url,
|
|
height: MediaQuery.of(context).size.width / 1.4,
|
|
width: double.infinity,
|
|
)
|
|
: Image.asset(
|
|
url,
|
|
height: MediaQuery.of(context).size.width / 1.4,
|
|
width: double.infinity,
|
|
),
|
|
mHeight(12),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|