如何使CustomPaint适合父窗口小部件?
return new Container(
color: Color(0xfffff4f0),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Expanded(
flex: 6,
child: FittedBox(
fit: BoxFit.contain,
child: widget CustomePaint() // Containers(),
)),
new Expanded(
flex: 4,
)
)
)
fit:BoxFit.contain适用于
Container(
height: 30,
width: 10
)
但不适用于在画布矩形上绘制的CustomePaint():
canvas.drawRect(new Rect.fromLTWH(0, 0, 10 , 30), new Paint()..color =
Colors.red);