角がなんか違う
丸くしたのに角が薄く出てしまう。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var value = await showModalBottomSheet<Answers>(
isScrollControlled: true,
context: context,
backgroundColor: Colors.transparent,
builder: (BuildContext context){
return new Container(
height: 260,
margin: EdgeInsets.all(0.0),
padding: new EdgeInsets.all(0.0),
decoration:
BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.0),
topRight: Radius.circular(20.0)
),
color: Colors.white,
),
);
}
);
問題のコードです。
backgroundColor: Colors.transparent,
で、角が透明になったけど、その代わりにダークモード、ライトモード変更時、色を固定しないといけなくなった。
解決したコード。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var value = await showModalBottomSheet<Answers>(
isScrollControlled: true,
context: context,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(15)),
),
builder: (BuildContext context){
return new Container(
height: 260,
margin: EdgeInsets.all(0.0),
padding: new EdgeInsets.all(0.0),
child: new Column(
children: <Widget>[
new Text('Demo'),
new Text('Friend Add'),
new Text(''),
new RaisedButton(onPressed: () => Navigator.pop(context, Answers.OK), child: new Text('OK'),),
new RaisedButton(onPressed: () => Navigator.pop(context, Answers.CLOSE), child: new Text('Close'),)
]
));
}
);