我是一个新的人,需要创建一个图库应用程序,它需要一个自定义对话框来显示所选图像,如何实现?
一般将军
showDialog(context: context,builder: (context) => _onTapImage(context)); // Call the Dialog. _onTapImage(BuildContext context) { return Stack( alignment: Alignment.center, children: <Widget>[ Image.network('https://via.placeholder.com/150',fit: BoxFit.contain,), // Show your Image Align( alignment: Alignment.topRight, child: RaisedButton.icon( color: Theme.of(context).accentColor, textColor: Colors.white, onPressed: () => Navigator.pop(context), icon: Icon( Icons.close, color: Colors.white, ), label: Text('Close')), ), ], ); }
1 回答
一般将军