Flutter:TextEditingController数组

时间:2019-10-17 13:12:12

标签: flutter

在flutter中设置<?= TabsX::widget([ 'encodeLabels' => false, 'options' => ['class' => 'charts-tab'], 'position'=>TabsX::POS_ABOVE, 'items' => [ [ // NO ajax: Renders fine! 'label' => Icon::show('chart-pie').'Label 1', 'content' => Yii::$app->controller->renderPartial('default_charts',['data'=>$data2]), 'active' => $tab == 1, ], [ // Ajax: Google Charts isn't rendering: 'label' => Icon::show('clipboard-list').'Empresas', //What do I have to pass in content????? The documentation is not accurate. 'content' => ??? 'linkOptions'=>['data-url'=>Url::to(['default/fetch-tabs?tab=2'])], 'active' => $tab == 2, ], ], ]);?> 数组的最佳方法是什么。我的意思是我需要获取一个TextEditingController(1到n)值的值数组并发送到服务器。

任何人都可以帮助实现这一目标吗?

我尝试了

Textfield

关于, 沙沙语

1 个答案:

答案 0 :(得分:0)

有很多方法可以做到这一点

List<TextEditingController> _controller = List.generate(74, (i) => TextEditingController());

List<TextEditingController> _controller = [];
for (int i = 1; i < 75; i++) _controller.add(TextEditingController());

List<TextEditingController> _controller = [
  for (int i = 1; i < 75; i++)
    TextEditingController()
];