美文网首页
flutter 画虚线

flutter 画虚线

作者: 心旷则神怡 | 来源:发表于2022-03-25 09:06 被阅读0次
import 'package:flutter/material.dart';

class DashedLine extends StatelessWidget {
  final Axis axis;
  final double dashedWidth;
  final double dashedHeight;
  final int count;
  final Color color;

  const DashedLine({
    required this.axis,
    required this.dashedWidth,
    required this.dashedHeight,
    this.color = Colors.red,
    this.count = 10
  }) ;

  @override
  Widget build(BuildContext context) {
    return Flex(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      direction: axis,
      children: List.generate(count,  ( _) {
        return SizedBox(
          width: dashedWidth,
          height: dashedHeight,
          child: DecoratedBox(
              decoration: BoxDecoration(color: color,)
          ),
        );
      }),
    );
  }
}

相关文章

  • flutter 画虚线

  • 。虚线。?。画。?。懂吗。?。

    。把。该。用。虚线。?。画。?。的。用。虚线。?。画。?。懂吗。?。 。这是。清理。?。大脑。?。的。重点。?。懂...

  • flutter draw虚线问题

    这是一个很好的绘制虚线的办法: 在flutter 中 canvas 没有直接绘制虚线的方法, 但是有drawlin...

  • 画虚线

    绘制一条水平的虚线

  • 画虚线

  • 画虚线

    - (void)drawLine { UIView*lineView = [[UIViewalloc]init];...

  • 画虚线

    注意事项: android:layerType="software"

  • 画虚线

    毕业之后才发现,数学都还给数学老师了。就连三角函数都忘了。请教大佬手把手教我老半天终于会画虚线了!做一下笔记,说不...

  • 画虚线

    //画虚线 (UIImage *)drawLineWithView:(UIImageView *)imageVie...

  • Flutter绘制虚线

    欢迎去看原文:http://tryenough.com/flutter-dotline 效果 实现方案 方案一: ...

网友评论

      本文标题:flutter 画虚线

      本文链接:https://www.haomeiwen.com/subject/cnukjrtx.html