虚线

此包允许您使用 Flutter 绘制虚线。

dotted_line

用法

参数 默认值 描述
direction Axis.horizontal 整个虚线的方向。
lineLength double.infinity 整个虚线的长度。
lineThickness 1.0 整个虚线的厚度。
dashLength 4.0 破折号的长度。
dashColor Colors.black 破折号的颜色。
dashRadius 0.0 破折号的半径。
dashGapLength 4.0 破折号间隔的长度。
dashGapColor Colors.transparent 破折号间隔的颜色。
dashGapRadius 0.0 破折号间隔的半径。

可以不带参数使用。

import 'package:dotted_line/dotted_line.dart';

DottedLine()

您也可以通过指定参数来自定义。

import 'package:dotted_line/dotted_line.dart';

DottedLine(
  direction: Axis.horizontal,
  lineLength: double.infinity,
  lineThickness: 1.0,
  dashLength: 4.0,
  dashColor: Colors.black,
  dashRadius: 0.0,
  dashGapLength: 4.0,
  dashGapColor: Colors.transparent,
  dashGapRadius: 0.0,
)

示例

示例代码可以在example包中找到。
您可以尝试更改所有参数。

GitHub

https://github.com/umechanhika/dotted_line