Improving the UX/UI of Image widget (#470)

pull/471/head
Develeste 3 years ago committed by GitHub
parent b72a701e65
commit f47301745c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 55
      lib/src/widgets/image.dart

@ -10,20 +10,59 @@ class ImageTapWrapper extends StatelessWidget {
final ImageProvider? imageProvider;
@override
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
constraints: BoxConstraints.expand(
height: MediaQuery.of(context).size.height,
),
child: GestureDetector(
onTapDown: (_) {
Navigator.pop(context);
},
child: PhotoView(
imageProvider: imageProvider,
),
child: Stack(
children: [
PhotoView(
imageProvider: imageProvider,
loadingBuilder: (context, event) {
return Container(
color: Colors.black,
child: Center(
child: CircularProgressIndicator(),
),
);
},
),
Positioned(
right: 10.0,
top: MediaQuery.of(context).padding.top + 10.0,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Stack(
children: [
Opacity(
opacity: 0.2,
child: Container(
height: 30.0,
width: 30.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black87,
),
),
),
Positioned(
top: 0,
bottom: 0,
left: 0,
right: 0,
child: Icon(Icons.close,
color: Colors.grey[400], size: 28.0),
)
],
),
),
),
],
),
),
);

Loading…
Cancel
Save