v3.1.0dotted_border
어떤 위젯에도 쉽게 점선 테두리를 추가할 수 있도록 해주는 플러터 패키지입니다.
1.7천좋아요 85.9만30일 다운로드160Pub 점수
AndroidiOSWebmacOSWindowsLinux
위젯 주변에 쉽게 점선 테두리를 추가할 수 있는 Flutter 패키지
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A flutter package to easily add dotted borders around widgets.
To use this package, add dotted_border as a dependency in your pubspec.yaml file.
Wrap DottedBorder widget around the child widget
DottedBorder(
child: Text(
'Rectangular Border',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
)
This package supports the following border options
DottedBorder(
options: RectDottedBorderOptions(
dashPattern: [10, 5],
strokeWidth: 2,
padding: EdgeInsets.all(16),
),
child: Text(
'Rectangular Border',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
)
You can also specify the Dash Sequence by passing in an Array of Doubles
RectDottedBorderOptions(
dashPattern: [10, 5],
strokeWidth: 2,
padding: EdgeInsets.all(16),
)
The above code block will render a dashed border with the following pattern:
You can also specify a customPath property and it will draw it for you using the provided dash pattern.
DottedBorder(
options: CustomPathDottedBorderOptions(
padding: const EdgeInsets.all(8),
color: Colors.purple,
strokeWidth: 2,
dashPattern: [10, 5],
customPath: (size) => Path()
..moveTo(0, size.height)
..relativeLineTo(size.width, 0),
),
child: const Text(
'Custom Path Border',
style: TextStyle(
color: Colors.purple,
fontWeight: FontWeight.bold,
),
),
)
Flutter dotted border image