【问题标题】:Flutter Hide Underline of Searchable Dropdown buttonFlutter隐藏可搜索下拉按钮的下划线
【发布时间】:2020-04-20 15:22:05
【问题描述】:

如何从 Searchable Drop down Button 中删除下划线,我尝试了各种选项组合,但 InputDecoration 找不到任何方法。

child: DropdownButtonHideUnderline(
    child: SearchableDropdown.single(
      items: this.searchableItems,
      value: this._selectSubordinate,
      hint: "Subordinate",
      searchHint: "Enter yoursubordinate name or Business code",
      onChanged: (value) {
        setState(() {
          this._selectSubordinate = value;
        });
      },
      isExpanded: true,
    ),
  ),

【问题讨论】:

    标签: flutter dropdown


    【解决方案1】:

    使用underline 属性:)

    SearchableDropdown.single(
          underline: Padding(
            padding: EdgeInsets.all(5),
          ),
          items: _serviceItems,
          value: selectedServiceVal,
          onChanged: (value) => setState(() {
            selectedServiceVal = value;
            _subjectTextController.text =
                '${selectedServiceVal ?? ''} - ${selectedCustomerVal ?? ''}';
          }),
          isExpanded: true,
        );
    


    参见。 Flutter 可搜索下拉版本
    https://pub.dev/packages/searchable_dropdown

    # searchable dropdown
      searchable_dropdown: ^1.1.3
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-31
      • 1970-01-01
      相关资源
      最近更新 更多