我刚刚接触Flutter ,现在我的对话框中出现了一个问题.问题是,我的对话框因为文本而溢出.所以,现在我想让它可以滚动,这样文本仍然可以查看.我已经在上面放了一个"SingleChildScrollView",但仍然不起作用,请帮忙.
我的代码:
_viewingRequest(dynamic data) async {
return showDialog(
barrierDismissible: false,
context: _scaffoldKey.currentContext,
builder: (context) {
return SingleChildScrollView(
child: AlertDialog(
contentPadding: EdgeInsets.only(left: 25, right: 25),
title: Center(child: Text("Information")),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20.0))),
content: Container(
height: 200,
width: 300,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SizedBox(
height: 20,
),
Text(
'Name of requestor: ${data['Name_ofUser']}'
),
Text(
'Description:',
),
Text(
'${data['Help_Description']}',
),
Text(
'Type of help needed: ${data['Help_TypeNeeded']}',
)
],
),
),
actions: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.20,
child: RaisedButton(
child: new Text(
'Fund',
style: TextStyle(color: Colors.white),
),
color: Color(0xFF121A21),
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(30.0),
),
onPressed: () {
saveIssue();
Navigator.of(context).pop();
},
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.01,
),
Padding(
padding: const EdgeInsets.only(right: 70.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.20,
child: RaisedButton(
child: new Text(
'Cancel',
style: TextStyle(color: Colors.white),
),
color: Color(0xFF121A21),
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(30.0),
),
onPressed: () {
Navigator.of(context).pop();
},
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.02,
),
],
)
],
),
);
});
}
我的UI: