Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 如何使用Flatter_标记清除选定的标记?_Flutter - Fatal编程技术网

Flutter 如何使用Flatter_标记清除选定的标记?

Flutter 如何使用Flatter_标记清除选定的标记?,flutter,Flutter,我需要在我的应用程序中使用标记。为此,我找到了Flatter_标签库。我的问题是,当我单击按钮时,我不知道如何清除选定的标记 FlutterTagging( textFieldDecoration: InputDecoration( border: OutlineInputBorder(), hintText: "Tags", labelText: "Enter tags"), addButtonWidget: _buil

我需要在我的应用程序中使用标记。为此,我找到了Flatter_标签库。我的问题是,当我单击按钮时,我不知道如何清除选定的标记

FlutterTagging(
     textFieldDecoration: InputDecoration(
         border: OutlineInputBorder(),
         hintText: "Tags",
         labelText: "Enter tags"),
     addButtonWidget: _buildAddButton(),
     chipsColor: Colors.pinkAccent,
     chipsFontColor: Colors.white,
     deleteIcon: Icon(Icons.cancel,color: Colors.white),
     chipsPadding: EdgeInsets.all(2.0),
     chipsFontSize: 14.0,
     chipsSpacing: 5.0,
     chipsFontFamily: 'helvetica_neue_light',
     suggestionsCallback: (pattern) async {
       return await TagSearchService.getSuggestions(pattern);
       },
     onChanged: (result) {
       setState(() {
         text = result.toString();
         });
       },
)

我在这里看到两种选择:

  • 分叉库并添加将清除
    Map\u selectedTagValues
    变量的方法
  • 在您的小部件中启动
    Key taggingKey=UniqueKey()
    (),将其传递给
    flattertaging
    ,并在需要重置时调用
    Key.currentState.reset()

  • 我怎样才能把钥匙传给图书馆?用叉子叉图书馆