按下按钮时如何在动态GridView中显示文本?

时间:2019-07-19 10:43:54

标签: flutter

我想在动态gridview中显示文本,当按下按钮时,其值应显示在textview内的gridview中。

child: GridView.count(
            crossAxisCount: 7,
            childAspectRatio: 1,
            padding: const EdgeInsets.all(10.0),
            mainAxisSpacing: 15.0,
            crossAxisSpacing: 15.0,
            children: wordList.map((String data) {
              return Card(
                color: Colors.teal,
                child: Text("",
                  textAlign: TextAlign.center,
                ),
              );
            }).toList(),
          )

screenshot showing the gridview and buttons

0 个答案:

没有答案