如何将所选项目分配给类别,例如“饮料”或“UML”颤动中

发布于 2025-01-16 05:38:52 字数 1357 浏览 2 评论 0原文

用户可以在此应用程序中以单词形式输入,然后创建一个类别并将其分配给它。但我不知道如何分配。 我现在可以通过 ListTile 选择输入。

Container(
                 color: (_selectedItems.contains(index)) ? Colors.blue.withOpacity(0.5) : Colors.transparent,
                 //select and import to a category
                 child: ListTile(
                    onTap: (){
                    if(_selectedItems.contains(index)){
                    setState(() {
                    _selectedItems.removeWhere((val) => val == index);
                    });
                    }
                    },
                    onLongPress: (){
                    if(! _selectedItems.contains(index)){
                    setState(() {
                    _selectedItems.add(index);
                    });
                    }
                    },
                    title: _showWords(index),
              ),
              );

此处我可以看到所有类别

当我单击一个类别时,我可以打开一个项目列表(用户输入):

在这里我可以选择项目,但是如何我可以将其导入到该类别吗?

User can make inputs as words in this app , and then create a category and assign it to it.But i don't know how it is possible to assign.
I can now select inputs by ListTile .

Container(
                 color: (_selectedItems.contains(index)) ? Colors.blue.withOpacity(0.5) : Colors.transparent,
                 //select and import to a category
                 child: ListTile(
                    onTap: (){
                    if(_selectedItems.contains(index)){
                    setState(() {
                    _selectedItems.removeWhere((val) => val == index);
                    });
                    }
                    },
                    onLongPress: (){
                    if(! _selectedItems.contains(index)){
                    setState(() {
                    _selectedItems.add(index);
                    });
                    }
                    },
                    title: _showWords(index),
              ),
              );

here i can see all categories

when i clicked a category, then i can open a list of items(user's inputs):

here i can select items , but how can i import it to the category?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半岛未凉 2025-01-23 05:38:52

使用int id、字符串名称、列表单词等创建一个类别类别(当用户创建该类别的实例时,必须自动分配类别ID,当用户点击类别时,保存选择的类别ID,然后当用户想要时添加一个单词,只需在“words”参数中添加一个单词即可。

Create a class Category with int id, String name, List words e.t.c. (category id must be assign automatically when the user creates an instance of that category, when the user taps the category, save the choosen category id, then when the user wants to add a word, just add a word to the "words" parameter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文