GestureDetector( onTap: () { // 显示大图 showDialog( context: context, builder: (context) => AlertDialog( title: const Text('图片'), content: Image.file(File(imageUri.path)), actions: [ ElevatedButton( child: const Text('确定'), onPressed: () { Navigator.of(context).pop(); }, ), ], ), ); },
Flutter 点击图片显示大图
4 min read