I'm just new in flutter and now I have a problem in my dialog box. The problem is that my dialog box is becoming overflowed because of texts. So, now I want to make it scrollable so that texts still can be viewed. I already put a "SingleChildScrollView" on it but still doesn't work Please help.
My code:
_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,
),
],
)
],
),
);
});
}
My UI:
