
[英]Flutter - How can I add rows to a PaginatedDataTable by taking values from a TextField?
[英]I want to add rows values to a data table, through the textfield using flutter
我需要将值添加到数据表中,这些值应该是从文本字段检索的值
值正在添加到数据表中,但是现在我想添加多行,行值通过Textfield设置,还有一个是如何在Datatable中使用可除数
//数据表//
DataTable(
columns: <DataColumn>[
DataColumn(
label: Text("DATA"),
),
],
rows: <DataRow>[
DataRow(
cells:<DataCell> [
DataCell(
Text(_stext)
),
//文本域 //
TextField(
controller: _controller,
maxLength: 8,
decoration: InputDecoration(
suffixIcon: IconButton(
onPressed: ()
{
_controller.clear();
},
icon: Icon(
Icons.clear,
color: Colors.black54,
),
),
border: new OutlineInputBorder(
borderRadius: const BorderRadius.all(
const Radius.circular(20.0),
),
),
),),
Center(
child: RaisedButton(
onPressed: _onPressed,
color: Colors.redAccent,
child: Text('Add'),
),
),
你有尝试过吗?
cells:<DataCell> [
DataCell(
Text(_controller.text)
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.