【发布时间】:2020-04-21 18:59:35
【问题描述】:
我只是想在这个 ui 中添加 2 个按钮:
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('VIDEOCALL'),
),
body: Center(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
height: 400,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: TextField(
controller: _channelController,
decoration: InputDecoration(
errorText:
_validateError ? 'Channel name is mandatory' : null,
border: UnderlineInputBorder(
borderSide: BorderSide(width: 1),
),
hintText: 'ENTER ENTRY CODE',
),
))
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Row(
children: <Widget>[
Expanded(
child: RaisedButton(
onPressed: onJoin,
child: Text('Join'),
color: Colors.blueAccent,
textColor: Colors.white,
),
)
],
),
)
],
),
),
),
);
}
但我无法添加它。 有时我有一个孩子已经定义了错误,或者即使代码被接受,它也不会在屏幕上弹出。
【问题讨论】:
-
好吧,我说我什么都试过了,但我没有重新启动我的系统。似乎只是重新启动系统解决了这个问题,现在我可以使用代码 new RaisedButton.... 并且它可以正常工作。