Skip to content

Commit d69bdb4

Browse files
authored
Merge pull request #37 from ionicfirebaseapp/master
main repo merge
2 parents 07dcb4d + 6c5a649 commit d69bdb4

File tree

7 files changed

+280
-411
lines changed

7 files changed

+280
-411
lines changed

example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class MyApp extends StatelessWidget {
1414
);
1515
}
1616

17-
//
1817
class MyHomePage extends StatefulWidget {
1918
@override
2019
_MyHomePageState createState() => _MyHomePageState();

example/pubspec.lock

Lines changed: 0 additions & 264 deletions
Original file line numberDiff line numberDiff line change
@@ -1,264 +0,0 @@
1-
# Generated by pub
2-
# See https://dart.dev/tools/pub/glossary#lockfile
3-
packages:
4-
async:
5-
dependency: transitive
6-
description:
7-
name: async
8-
url: "https://pub.dartlang.org"
9-
source: hosted
10-
version: "2.5.0-nullsafety"
11-
boolean_selector:
12-
dependency: transitive
13-
description:
14-
name: boolean_selector
15-
url: "https://pub.dartlang.org"
16-
source: hosted
17-
version: "2.1.0-nullsafety"
18-
characters:
19-
dependency: transitive
20-
description:
21-
name: characters
22-
url: "https://pub.dartlang.org"
23-
source: hosted
24-
version: "1.1.0-nullsafety.2"
25-
charcode:
26-
dependency: transitive
27-
description:
28-
name: charcode
29-
url: "https://pub.dartlang.org"
30-
source: hosted
31-
version: "1.2.0-nullsafety"
32-
clock:
33-
dependency: transitive
34-
description:
35-
name: clock
36-
url: "https://pub.dartlang.org"
37-
source: hosted
38-
version: "1.1.0-nullsafety"
39-
collection:
40-
dependency: transitive
41-
description:
42-
name: collection
43-
url: "https://pub.dartlang.org"
44-
source: hosted
45-
version: "1.15.0-nullsafety.2"
46-
convert:
47-
dependency: transitive
48-
description:
49-
name: convert
50-
url: "https://pub.dartlang.org"
51-
source: hosted
52-
version: "2.1.1"
53-
cupertino_icons:
54-
dependency: "direct main"
55-
description:
56-
name: cupertino_icons
57-
url: "https://pub.dartlang.org"
58-
source: hosted
59-
version: "0.1.3"
60-
fake_async:
61-
dependency: transitive
62-
description:
63-
name: fake_async
64-
url: "https://pub.dartlang.org"
65-
source: hosted
66-
version: "1.1.0-nullsafety"
67-
flutter:
68-
dependency: "direct main"
69-
description: flutter
70-
source: sdk
71-
version: "0.0.0"
72-
flutter_svg:
73-
dependency: "direct main"
74-
description:
75-
name: flutter_svg
76-
url: "https://pub.dartlang.org"
77-
source: hosted
78-
version: "0.18.1"
79-
flutter_test:
80-
dependency: "direct dev"
81-
description: flutter
82-
source: sdk
83-
version: "0.0.0"
84-
flutter_web_plugins:
85-
dependency: transitive
86-
description: flutter
87-
source: sdk
88-
version: "0.0.0"
89-
getwidget:
90-
dependency: "direct main"
91-
description:
92-
path: ".."
93-
relative: true
94-
source: path
95-
version: "1.1.3"
96-
matcher:
97-
dependency: transitive
98-
description:
99-
name: matcher
100-
url: "https://pub.dartlang.org"
101-
source: hosted
102-
version: "0.12.10-nullsafety"
103-
meta:
104-
dependency: transitive
105-
description:
106-
name: meta
107-
url: "https://pub.dartlang.org"
108-
source: hosted
109-
version: "1.3.0-nullsafety.2"
110-
path:
111-
dependency: transitive
112-
description:
113-
name: path
114-
url: "https://pub.dartlang.org"
115-
source: hosted
116-
version: "1.8.0-nullsafety"
117-
path_drawing:
118-
dependency: transitive
119-
description:
120-
name: path_drawing
121-
url: "https://pub.dartlang.org"
122-
source: hosted
123-
version: "0.4.1+1"
124-
path_parsing:
125-
dependency: transitive
126-
description:
127-
name: path_parsing
128-
url: "https://pub.dartlang.org"
129-
source: hosted
130-
version: "0.1.4"
131-
petitparser:
132-
dependency: transitive
133-
description:
134-
name: petitparser
135-
url: "https://pub.dartlang.org"
136-
source: hosted
137-
version: "3.0.4"
138-
platform_detect:
139-
dependency: transitive
140-
description:
141-
name: platform_detect
142-
url: "https://pub.dartlang.org"
143-
source: hosted
144-
version: "1.4.0"
145-
plugin_platform_interface:
146-
dependency: transitive
147-
description:
148-
name: plugin_platform_interface
149-
url: "https://pub.dartlang.org"
150-
source: hosted
151-
version: "1.0.2"
152-
pub_semver:
153-
dependency: transitive
154-
description:
155-
name: pub_semver
156-
url: "https://pub.dartlang.org"
157-
source: hosted
158-
version: "1.4.4"
159-
sky_engine:
160-
dependency: transitive
161-
description: flutter
162-
source: sdk
163-
version: "0.0.99"
164-
source_span:
165-
dependency: transitive
166-
description:
167-
name: source_span
168-
url: "https://pub.dartlang.org"
169-
source: hosted
170-
version: "1.8.0-nullsafety"
171-
stack_trace:
172-
dependency: transitive
173-
description:
174-
name: stack_trace
175-
url: "https://pub.dartlang.org"
176-
source: hosted
177-
version: "1.10.0-nullsafety"
178-
stream_channel:
179-
dependency: transitive
180-
description:
181-
name: stream_channel
182-
url: "https://pub.dartlang.org"
183-
source: hosted
184-
version: "2.1.0-nullsafety"
185-
string_scanner:
186-
dependency: transitive
187-
description:
188-
name: string_scanner
189-
url: "https://pub.dartlang.org"
190-
source: hosted
191-
version: "1.1.0-nullsafety"
192-
term_glyph:
193-
dependency: transitive
194-
description:
195-
name: term_glyph
196-
url: "https://pub.dartlang.org"
197-
source: hosted
198-
version: "1.2.0-nullsafety"
199-
test_api:
200-
dependency: transitive
201-
description:
202-
name: test_api
203-
url: "https://pub.dartlang.org"
204-
source: hosted
205-
version: "0.2.19-nullsafety"
206-
typed_data:
207-
dependency: transitive
208-
description:
209-
name: typed_data
210-
url: "https://pub.dartlang.org"
211-
source: hosted
212-
version: "1.3.0-nullsafety.2"
213-
url_launcher:
214-
dependency: "direct main"
215-
description:
216-
name: url_launcher
217-
url: "https://pub.dartlang.org"
218-
source: hosted
219-
version: "5.5.3"
220-
url_launcher_linux:
221-
dependency: transitive
222-
description:
223-
name: url_launcher_linux
224-
url: "https://pub.dartlang.org"
225-
source: hosted
226-
version: "0.0.1+1"
227-
url_launcher_macos:
228-
dependency: transitive
229-
description:
230-
name: url_launcher_macos
231-
url: "https://pub.dartlang.org"
232-
source: hosted
233-
version: "0.0.1+7"
234-
url_launcher_platform_interface:
235-
dependency: transitive
236-
description:
237-
name: url_launcher_platform_interface
238-
url: "https://pub.dartlang.org"
239-
source: hosted
240-
version: "1.0.8"
241-
url_launcher_web:
242-
dependency: transitive
243-
description:
244-
name: url_launcher_web
245-
url: "https://pub.dartlang.org"
246-
source: hosted
247-
version: "0.1.3+2"
248-
vector_math:
249-
dependency: transitive
250-
description:
251-
name: vector_math
252-
url: "https://pub.dartlang.org"
253-
source: hosted
254-
version: "2.1.0-nullsafety.2"
255-
xml:
256-
dependency: transitive
257-
description:
258-
name: xml
259-
url: "https://pub.dartlang.org"
260-
source: hosted
261-
version: "4.2.0"
262-
sdks:
263-
dart: ">=2.10.0-0.0.dev <2.10.0"
264-
flutter: ">=1.18.0-6.0.pre <2.0.0"
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import 'dart:ui';
2+
import 'package:flutter/material.dart';
3+
import 'package:getwidget/components/border/gf_dashed_border.dart';
4+
import 'package:getwidget/types/gf_border_type.dart';
5+
6+
class GFBorder extends StatelessWidget {
7+
GFBorder({
8+
@required this.child,
9+
this.color = Colors.black,
10+
this.strokeWidth = 1,
11+
this.type = GFBorderType.Rect,
12+
this.dashedLine = const <double>[3, 1],
13+
this.padding = const EdgeInsets.all(10),
14+
this.radius = const Radius.circular(0),
15+
this.customPath,
16+
}) : assert(child != null),
17+
assert(_isValiddashedLine(dashedLine), 'Invalid dash pattern');
18+
19+
/// child of type [Widget] which can be any component or text , etc
20+
final Widget child;
21+
22+
/// padding of time [EdgeInsets] where in padding is given to the border types
23+
final EdgeInsets padding;
24+
25+
/// storkeWidth of type [double] which is used to define the thickness of the border
26+
final double strokeWidth;
27+
28+
/// color of type [Color] or GFColor which is used to change the color of the border type
29+
final Color color;
30+
31+
/// dashedLine of type [List<double>] which is used for the linear and simple dashed line of border
32+
final List<double> dashedLine;
33+
34+
/// type of [GFBorderType] which is used to define the different types of borders ie, circle, Rect, RRect and oval
35+
final GFBorderType type;
36+
37+
/// radius of type [Radius] used to give a curved border only when the border type is RRect, in other cases radius will not work
38+
final Radius radius;
39+
40+
/// customPath of type [PathBuilder] used for drawing the paths
41+
final PathBuilder customPath;
42+
43+
@override
44+
Widget build(BuildContext context) => Stack(
45+
children: <Widget>[
46+
Positioned.fill(
47+
child: CustomPaint(
48+
painter: DashedType(
49+
strokeWidth: strokeWidth,
50+
radius: radius,
51+
color: color,
52+
type: type,
53+
dashedLine: dashedLine,
54+
customPath: customPath,
55+
),
56+
),
57+
),
58+
Container(padding: padding, child: child),
59+
],
60+
);
61+
}
62+
63+
/// the value of dashedLine cannot be 0 or null, it should have some definite and proper value
64+
bool _isValiddashedLine(List<double> dash) {
65+
final Set<double> _dashSet = dash.toSet();
66+
if (_dashSet == null) {
67+
return false;
68+
}
69+
if (_dashSet.length == 1 && _dashSet.elementAt(0) == 0.0) {
70+
return false;
71+
}
72+
if (_dashSet.isEmpty) {
73+
return false;
74+
}
75+
return true;
76+
}

0 commit comments

Comments
 (0)