【问题标题】:Flutter: How to remove the divider lines in CupertinoDatePicker?Flutter:如何删除 CupertinoDatePicker 中的分隔线?
【发布时间】:2020-05-13 01:06:04
【问题描述】:

在进行编码演练时,我从未找到摆脱分隔线的方法。 我怎样才能做到这一点?有关更多信息,我刚刚通过复制 CupertinoDatePicker 类创建了一个新的自定义类。

【问题讨论】:

    标签: flutter flutter-cupertino cupertinopicker


    【解决方案1】:

    由于您复制了 CupertinoDatePicker 类,只需从 /src/cupertino/

    中删除 picker.dart_buildMagnifierScreen() 方法中的边框
    /// Draws the magnifier borders.
      Widget _buildMagnifierScreen() {
        final Color resolvedBorderColor = CupertinoDynamicColor.resolve(_kHighlighterBorder, context);
    
        return IgnorePointer(
          child: Center(
            child: Container(
              decoration: BoxDecoration(
                // remove this attribute
                border: Border(
                  top: BorderSide(width: 0.0, color: resolvedBorderColor),
                  bottom: BorderSide(width: 0.0, color: resolvedBorderColor),
                ),
              ),
              constraints: BoxConstraints.expand(
                height: widget.itemExtent * widget.magnification,
              ),
            ),
          ),
        );
      }
    

    【讨论】:

      猜你喜欢
      • 2014-02-10
      • 2017-03-12
      • 2011-02-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-13
      • 1970-01-01
      相关资源
      最近更新 更多