【问题标题】:How can I make my vertical bar tip to round in Flutter如何使我的垂直条尖端在 Flutter 中变圆
【发布时间】:2021-04-09 16:14:57
【问题描述】:

我的卡片小部件中有这个自定义垂直条,我正在尝试使垂直条在顶部和底部像设计一样有点圆,但我不知道该怎么做,所以我会如果我能得到任何帮助或建议,我将不胜感激。谢谢

  Widget verticalBarSeparator(String value) {
    final int data = int.parse(value);
    return Container(
        color: data < 0 ? Colors.red : Colors.green, height: 80, width: 4);
  }

这是我目前所拥有的

这就是我想要做的

【问题讨论】:

    标签: flutter mobile responsive-design flutter-layout flutter-animation


    【解决方案1】:

    也许你可以试试这个

    Widget verticalBarSeparator(String value) {
      final int data = int.parse(value);
      return Container(
        height: 80, 
        width: 4,
        decoration: ShapeDecoration(
          color: data < 0 ? Colors.red : Colors.green,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(10.0),
          ),
        ),
      );
    }
    

    【讨论】:

    • 它工作......非常感谢。我非常感谢您的帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-23
    • 1970-01-01
    • 2021-06-19
    • 1970-01-01
    • 1970-01-01
    • 2014-12-03
    相关资源
    最近更新 更多