Skip to content

Commit 59e51b4

Browse files
committed
modified the code
1 parent 58bf319 commit 59e51b4

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

example/lib/main.dart

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,23 @@ class _GFState extends State<GF> {
2323
@override
2424
Widget build(BuildContext context) {
2525
return Scaffold(
26-
body: Container(
27-
child: GFBorder(
28-
child: Text('gvhjnk'),
29-
type: GFBorderType.Oval,
30-
dashedLine: [2, 2],
26+
body: Row(children: [
27+
Container(
28+
child: GFBorder(
29+
child: Text('gvhjnk'),
30+
type: GFBorderType.Oval,
31+
dashedLine: [2, 2],
32+
),
3133
),
32-
));
34+
Container(
35+
child: GFBorder(
36+
child: Text('gvhjnk'),
37+
type: GFBorderType.Rect,
38+
radius: Radius.circular(30),
39+
dashedLine: [2, 0],
40+
),
41+
)
42+
]));
3343
}
3444
}
3545

lib/components/border/gf_dashed_border.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,13 @@ class CircularIntervalList<T> {
152152
}
153153
}
154154

155-
Path dashPath(
156-
Path source, {
157-
@required CircularIntervalList<double> dashedarray,
158-
DashOffset dashOffset,
159-
}) {
155+
Path dashPath(Path source,
156+
{@required CircularIntervalList<double> dashedarray,
157+
DashOffset dashOffset = const DashOffset.absolute(0)}) {
160158
assert(dashedarray != null);
161159
if (source == null) {
162160
return null;
163161
}
164-
if (dashOffset == null) {
165-
dashOffset = const DashOffset.absolute(0);
166-
}
167-
// dashOffset = dashOffset ?? const DashOffset.absolute(0);
168162

169163
final Path dest = Path();
170164
for (final PathMetric metric in source.computeMetrics()) {

0 commit comments

Comments
 (0)