Skip to content

Commit b692e11

Browse files
Merge pull request #41 from ionicfirebaseapp/master
master pull
2 parents eecce8f + 47e2a3b commit b692e11

File tree

7 files changed

+392
-7
lines changed

7 files changed

+392
-7
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Changelog
22

33

4+
## 1.2.3 - 2020-11-12
5+
6+
### Fixed
7+
* [GFProgressBar] issue.
8+
* [GFBottomSheet] minor issue.
9+
* [GFIconButton] wrong touch issue. #195
10+
* [GFDropdown] minor issue.
11+
* [GFCarousel] issue. #185
12+
* Many more minor improvements.
13+
14+
15+
416
## 1.2.2 - 2020-10-02
517

618
### Fixed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
## Screenshot
2323
<p align="center">
2424
<a target="_blank" href="https://docs.getwidget.dev/">
25-
<img src="https://ik.imagekit.io/ionicfirebaseapp/GitHub_1_O8ZlrxSIo.png" alt="GetWidget Screens">
25+
<img src="https://ik.imagekit.io/ionicfirebaseapp/GitHub_Image_updated_u9eSV6fDY-.png" alt="GetWidget Screens">
2626
</a>
2727
</p>
2828

@@ -113,4 +113,4 @@ Support this project with your organization. Your logo will show up here with a
113113
<a href="https://opencollective.com/getwidget/organization/6/website"><img src="https://opencollective.com/getwidget/organization/6/avatar.svg"></a>
114114
<a href="https://opencollective.com/getwidget/organization/7/website"><img src="https://opencollective.com/getwidget/organization/7/avatar.svg"></a>
115115
<a href="https://opencollective.com/getwidget/organization/8/website"><img src="https://opencollective.com/getwidget/organization/8/avatar.svg"></a>
116-
<a href="https://opencollective.com/getwidget/organization/9/website"><img src="https://opencollective.com/getwidget/organization/9/avatar.svg"></a>
116+
<a href="https://opencollective.com/getwidget/organization/9/website"><img src="https://opencollective.com/getwidget/organization/9/avatar.svg"></a>

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ packages:
9292
path: ".."
9393
relative: true
9494
source: path
95-
version: "1.2.2"
95+
version: "1.2.3"
9696
matcher:
9797
dependency: transitive
9898
description:

pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ packages:
7373
name: meta
7474
url: "https://pub.dartlang.org"
7575
source: hosted
76-
version: "1.3.0-nullsafety.4"
76+
version: "1.3.0-nullsafety.3"
7777
path:
7878
dependency: transitive
7979
description:
@@ -99,7 +99,7 @@ packages:
9999
name: stack_trace
100100
url: "https://pub.dartlang.org"
101101
source: hosted
102-
version: "1.10.0-nullsafety.2"
102+
version: "1.10.0-nullsafety.1"
103103
stream_channel:
104104
dependency: transitive
105105
description:
@@ -143,4 +143,4 @@ packages:
143143
source: hosted
144144
version: "2.1.0-nullsafety.3"
145145
sdks:
146-
dart: ">=2.10.0-110 <=2.11.0-213.1.beta"
146+
dart: ">=2.10.0-110 <2.11.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: getwidget
22
description: GetWidget is open source libraries that come with pre-build 1000+ UI components. It makes development faster & more enjoyable. You can customize the component as per your need.
3-
version: 1.2.2
3+
version: 1.2.3
44
homepage: https://github.com/ionicfirebaseapp/getwidget
55

66
environment:

test/loader_test.dart

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
import 'package:flutter/foundation.dart';
2+
import 'package:flutter/material.dart';
3+
import 'package:flutter_test/flutter_test.dart';
4+
import 'package:getwidget/getwidget.dart';
5+
6+
void main() {
7+
final Widget childWidget = Container(
8+
width: 111,
9+
height: 222,
10+
);
11+
12+
const iconOne = Icon(Icons.directions_bike_sharp);
13+
const iconTwo = Icon(Icons.directions_car);
14+
const iconThree = Icon(Icons.directions_bus);
15+
16+
const duration = Duration(milliseconds: 1000);
17+
18+
const firstColor = Colors.teal;
19+
const secondColor = Colors.tealAccent;
20+
const thirdColor = Colors.tealAccent;
21+
22+
const stroke = 4.0;
23+
24+
debugDefaultTargetPlatformOverride = TargetPlatform.iOS;
25+
26+
// testWidgets('Asserts.', (tester) async {
27+
// expect(
28+
// () => GFLoader(
29+
//
30+
// ),
31+
// throwsAssertionError,
32+
// );
33+
//
34+
// expect(
35+
// () => GFLoader(
36+
//
37+
// ),
38+
// throwsAssertionError,
39+
// );
40+
// });
41+
42+
testWidgets('GF Loader can be constructed', (tester) async {
43+
final GFLoader loader = GFLoader(
44+
loaderColorOne: firstColor,
45+
loaderColorTwo: secondColor,
46+
duration: duration,
47+
type: GFLoaderType.ios,
48+
loaderIconOne: iconOne,
49+
// androidLoaderColor : Colors.amber,
50+
loaderstrokeWidth: stroke,
51+
size: GFSize.MEDIUM,
52+
child: childWidget,
53+
);
54+
55+
final TestApp app = TestApp(loader);
56+
57+
await tester.pumpWidget(app);
58+
59+
await tester.pumpWidget(Container(child: childWidget));
60+
expect(find.byWidget(childWidget), findsOneWidget);
61+
await tester.pump(duration);
62+
63+
expect(app.loader.child, childWidget);
64+
expect(app.loader.loaderIconOne, iconOne);
65+
expect(app.loader.loaderColorOne, firstColor);
66+
expect(app.loader.loaderstrokeWidth, stroke);
67+
expect(app.loader.size, GFSize.MEDIUM);
68+
69+
debugDefaultTargetPlatformOverride = null;
70+
});
71+
72+
testWidgets('Basic GF Loader can be constructed', (tester) async {
73+
const GFLoader loader = GFLoader();
74+
75+
const TestApp app = TestApp(loader);
76+
77+
await tester.pumpWidget(app);
78+
});
79+
80+
testWidgets('GF Loader with icons can be constructed', (tester) async {
81+
const customType = GFLoaderType.custom;
82+
83+
const GFLoader loader = GFLoader(
84+
type: customType,
85+
duration: duration,
86+
loaderIconOne: iconOne,
87+
loaderIconTwo: iconTwo,
88+
loaderIconThree: iconThree,
89+
loaderstrokeWidth: stroke,
90+
);
91+
92+
const TestApp app = TestApp(loader);
93+
94+
await tester.pumpWidget(app);
95+
96+
await tester.pump(duration);
97+
98+
expect(app.loader.type, customType);
99+
expect(app.loader.loaderIconOne, iconOne);
100+
expect(app.loader.loaderIconTwo, iconTwo);
101+
expect(app.loader.loaderIconThree, iconThree);
102+
expect(app.loader.loaderstrokeWidth, stroke);
103+
});
104+
105+
// testWidgets('Asserts.', (tester) async {
106+
// // when type is null
107+
//
108+
// expect(() => GFLoader(
109+
// type: null,
110+
// loaderIconOne : iconOne,
111+
// loaderIconTwo: iconTwo,
112+
// loaderIconThree: iconThree,
113+
// ),
114+
// throwsAssertionError,
115+
// );
116+
// });
117+
118+
testWidgets('GF Loader with square type can be constructed', (tester) async {
119+
const customType = GFLoaderType.square;
120+
121+
const GFLoader loader = GFLoader(
122+
type: customType,
123+
duration: duration,
124+
loaderColorOne: firstColor,
125+
loaderColorTwo: secondColor,
126+
loaderColorThree: thirdColor,
127+
loaderstrokeWidth: stroke,
128+
);
129+
130+
const TestApp app = TestApp(loader);
131+
132+
await tester.pumpWidget(app);
133+
134+
await tester.pump(duration);
135+
136+
expect(app.loader.type, customType);
137+
expect(app.loader.loaderColorOne, firstColor);
138+
expect(app.loader.loaderColorTwo, secondColor);
139+
expect(app.loader.loaderColorThree, thirdColor);
140+
expect(app.loader.loaderstrokeWidth, stroke);
141+
});
142+
143+
testWidgets('GF Loader with round type can be constructed', (tester) async {
144+
const customType = GFLoaderType.circle;
145+
146+
const GFLoader loader = GFLoader(
147+
type: customType,
148+
duration: duration,
149+
loaderColorOne: firstColor,
150+
loaderColorTwo: secondColor,
151+
loaderColorThree: thirdColor,
152+
loaderstrokeWidth: stroke,
153+
);
154+
155+
const TestApp app = TestApp(loader);
156+
157+
await tester.pumpWidget(app);
158+
159+
await tester.pump(duration);
160+
161+
expect(app.loader.type, customType);
162+
expect(app.loader.loaderColorOne, firstColor);
163+
expect(app.loader.loaderColorTwo, secondColor);
164+
expect(app.loader.loaderColorThree, thirdColor);
165+
expect(app.loader.loaderstrokeWidth, stroke);
166+
});
167+
168+
testWidgets('GF Loader with android type loader can be constructed',
169+
(tester) async {
170+
const customType = GFLoaderType.android;
171+
const color = AlwaysStoppedAnimation<Color>(Colors.green);
172+
173+
const GFLoader loader =
174+
GFLoader(type: customType, androidLoaderColor: color);
175+
176+
const TestApp app = TestApp(loader);
177+
178+
await tester.pumpWidget(app);
179+
180+
expect(app.loader.type, customType);
181+
expect(app.loader.androidLoaderColor, color);
182+
});
183+
184+
// testWidgets('Asserts.', (tester) async {
185+
// // when type is null
186+
//
187+
// // expect(() => GFLoader(
188+
// // type: null,
189+
// // loaderIconOne : iconOne,
190+
// // loaderIconTwo: iconTwo,
191+
// // loaderIconThree: iconThree,
192+
// // ),
193+
// // throwsAssertionError,
194+
// //
195+
// // );
196+
//
197+
// const GFLoader loader = GFLoader(
198+
// type: null,
199+
// loaderIconOne : iconOne,
200+
// loaderIconTwo: iconTwo,
201+
// loaderIconThree: iconThree,
202+
// );
203+
//
204+
// const TestApp app = TestApp(loader);
205+
//
206+
// await tester.pumpWidget(app);
207+
//
208+
// expect(
209+
// tester.takeException(),
210+
// isA<FlutterError>().having(
211+
// (error) => error.message,
212+
// 'message',
213+
// 'Type should be custom for icons loader to display',
214+
// ),
215+
// );
216+
// });
217+
218+
testWidgets('GF Loader with custom loader can be constructed using child',
219+
(tester) async {
220+
const customType = GFLoaderType.custom;
221+
222+
final GFLoader loader = GFLoader(type: customType, child: childWidget);
223+
224+
final TestApp app = TestApp(loader);
225+
226+
await tester.pumpWidget(app);
227+
228+
await tester.pumpWidget(Container(child: childWidget));
229+
expect(find.byWidget(childWidget), findsOneWidget);
230+
await tester.pump(duration);
231+
232+
expect(app.loader.child, childWidget);
233+
expect(app.loader.type, customType);
234+
});
235+
}
236+
237+
class TestApp extends StatefulWidget {
238+
const TestApp(this.loader);
239+
240+
final GFLoader loader;
241+
242+
@override
243+
_TestAppState createState() => _TestAppState();
244+
}
245+
246+
class _TestAppState extends State<TestApp> {
247+
@override
248+
Widget build(BuildContext context) => MaterialApp(
249+
home: Scaffold(
250+
body: Column(
251+
children: [
252+
widget.loader,
253+
],
254+
),
255+
),
256+
);
257+
}

0 commit comments

Comments
 (0)