class NewBar extends StatelessWidget{
final MainAxisAlignment alignment;
final List<Widget> children;
final MainAxisSize mainAxisSize;
const NewBar({
Key key,
this.alignment: MainAxisAlignment.end,
this.mainAxisSize: MainAxisSize.max,
this.children: const <Widget>[],
}) : super(key: key);
@override
Widget build(BuildContext context) {
final double paddingUnit = ButtonTheme.of(context).padding.horizontal /
4.0;
return new Padding(
padding: new EdgeInsets.symmetric(
vertical: 2.0 * paddingUnit,
horizontal: paddingUnit
),
child: new Row(
mainAxisAlignment: alignment,
mainAxisSize: mainAxisSize,
children: children.map<Widget>((Widget child) {
return new Padding(
padding: new EdgeInsets.symmetric(horizontal: paddingUnit),
child: child
);
}).toList()
)
);
}
}
这只是按钮栏的一些代码。但它不显示任何内容。也许我把课程放在了错误的地方,或者我应该将一些东西返回到主应用程序。我是新来的。有任何想法吗?