Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Changelog


## 1.2.3 - 2020-11-12

### Fixed
* [GFProgressBar] issue.
* [GFBottomSheet] minor issue.
* [GFIconButton] wrong touch issue. #195
* [GFDropdown] minor issue.
* [GFCarousel] issue. #185
* Many more minor improvements.



## 1.2.2 - 2020-10-02

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
## Screenshot
<p align="center">
<a target="_blank" href="https://docs.getwidget.dev/">
<img src="https://ik.imagekit.io/ionicfirebaseapp/GitHub_1_O8ZlrxSIo.png" alt="GetWidget Screens">
<img src="https://ik.imagekit.io/ionicfirebaseapp/GitHub_Image_updated_u9eSV6fDY-.png" alt="GetWidget Screens">
</a>
</p>

Expand Down Expand Up @@ -113,4 +113,4 @@ Support this project with your organization. Your logo will show up here with a
<a href="https://opencollective.com/getwidget/organization/6/website"><img src="https://opencollective.com/getwidget/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/getwidget/organization/7/website"><img src="https://opencollective.com/getwidget/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/getwidget/organization/8/website"><img src="https://opencollective.com/getwidget/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/getwidget/organization/9/website"><img src="https://opencollective.com/getwidget/organization/9/avatar.svg"></a>
<a href="https://opencollective.com/getwidget/organization/9/website"><img src="https://opencollective.com/getwidget/organization/9/avatar.svg"></a>
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.2.2"
version: "1.2.3"
matcher:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.4"
version: "1.3.0-nullsafety.3"
path:
dependency: transitive
description:
Expand All @@ -99,7 +99,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.2"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -143,4 +143,4 @@ packages:
source: hosted
version: "2.1.0-nullsafety.3"
sdks:
dart: ">=2.10.0-110 <=2.11.0-213.1.beta"
dart: ">=2.10.0-110 <2.11.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: getwidget
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.
version: 1.2.2
version: 1.2.3
homepage: https://github.com/ionicfirebaseapp/getwidget

environment:
Expand Down
257 changes: 257 additions & 0 deletions test/loader_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:getwidget/getwidget.dart';

void main() {
final Widget childWidget = Container(
width: 111,
height: 222,
);

const iconOne = Icon(Icons.directions_bike_sharp);
const iconTwo = Icon(Icons.directions_car);
const iconThree = Icon(Icons.directions_bus);

const duration = Duration(milliseconds: 1000);

const firstColor = Colors.teal;
const secondColor = Colors.tealAccent;
const thirdColor = Colors.tealAccent;

const stroke = 4.0;

debugDefaultTargetPlatformOverride = TargetPlatform.iOS;

// testWidgets('Asserts.', (tester) async {
// expect(
// () => GFLoader(
//
// ),
// throwsAssertionError,
// );
//
// expect(
// () => GFLoader(
//
// ),
// throwsAssertionError,
// );
// });

testWidgets('GF Loader can be constructed', (tester) async {
final GFLoader loader = GFLoader(
loaderColorOne: firstColor,
loaderColorTwo: secondColor,
duration: duration,
type: GFLoaderType.ios,
loaderIconOne: iconOne,
// androidLoaderColor : Colors.amber,
loaderstrokeWidth: stroke,
size: GFSize.MEDIUM,
child: childWidget,
);

final TestApp app = TestApp(loader);

await tester.pumpWidget(app);

await tester.pumpWidget(Container(child: childWidget));
expect(find.byWidget(childWidget), findsOneWidget);
await tester.pump(duration);

expect(app.loader.child, childWidget);
expect(app.loader.loaderIconOne, iconOne);
expect(app.loader.loaderColorOne, firstColor);
expect(app.loader.loaderstrokeWidth, stroke);
expect(app.loader.size, GFSize.MEDIUM);

debugDefaultTargetPlatformOverride = null;
});

testWidgets('Basic GF Loader can be constructed', (tester) async {
const GFLoader loader = GFLoader();

const TestApp app = TestApp(loader);

await tester.pumpWidget(app);
});

testWidgets('GF Loader with icons can be constructed', (tester) async {
const customType = GFLoaderType.custom;

const GFLoader loader = GFLoader(
type: customType,
duration: duration,
loaderIconOne: iconOne,
loaderIconTwo: iconTwo,
loaderIconThree: iconThree,
loaderstrokeWidth: stroke,
);

const TestApp app = TestApp(loader);

await tester.pumpWidget(app);

await tester.pump(duration);

expect(app.loader.type, customType);
expect(app.loader.loaderIconOne, iconOne);
expect(app.loader.loaderIconTwo, iconTwo);
expect(app.loader.loaderIconThree, iconThree);
expect(app.loader.loaderstrokeWidth, stroke);
});

// testWidgets('Asserts.', (tester) async {
// // when type is null
//
// expect(() => GFLoader(
// type: null,
// loaderIconOne : iconOne,
// loaderIconTwo: iconTwo,
// loaderIconThree: iconThree,
// ),
// throwsAssertionError,
// );
// });

testWidgets('GF Loader with square type can be constructed', (tester) async {
const customType = GFLoaderType.square;

const GFLoader loader = GFLoader(
type: customType,
duration: duration,
loaderColorOne: firstColor,
loaderColorTwo: secondColor,
loaderColorThree: thirdColor,
loaderstrokeWidth: stroke,
);

const TestApp app = TestApp(loader);

await tester.pumpWidget(app);

await tester.pump(duration);

expect(app.loader.type, customType);
expect(app.loader.loaderColorOne, firstColor);
expect(app.loader.loaderColorTwo, secondColor);
expect(app.loader.loaderColorThree, thirdColor);
expect(app.loader.loaderstrokeWidth, stroke);
});

testWidgets('GF Loader with round type can be constructed', (tester) async {
const customType = GFLoaderType.circle;

const GFLoader loader = GFLoader(
type: customType,
duration: duration,
loaderColorOne: firstColor,
loaderColorTwo: secondColor,
loaderColorThree: thirdColor,
loaderstrokeWidth: stroke,
);

const TestApp app = TestApp(loader);

await tester.pumpWidget(app);

await tester.pump(duration);

expect(app.loader.type, customType);
expect(app.loader.loaderColorOne, firstColor);
expect(app.loader.loaderColorTwo, secondColor);
expect(app.loader.loaderColorThree, thirdColor);
expect(app.loader.loaderstrokeWidth, stroke);
});

testWidgets('GF Loader with android type loader can be constructed',
(tester) async {
const customType = GFLoaderType.android;
const color = AlwaysStoppedAnimation<Color>(Colors.green);

const GFLoader loader =
GFLoader(type: customType, androidLoaderColor: color);

const TestApp app = TestApp(loader);

await tester.pumpWidget(app);

expect(app.loader.type, customType);
expect(app.loader.androidLoaderColor, color);
});

// testWidgets('Asserts.', (tester) async {
// // when type is null
//
// // expect(() => GFLoader(
// // type: null,
// // loaderIconOne : iconOne,
// // loaderIconTwo: iconTwo,
// // loaderIconThree: iconThree,
// // ),
// // throwsAssertionError,
// //
// // );
//
// const GFLoader loader = GFLoader(
// type: null,
// loaderIconOne : iconOne,
// loaderIconTwo: iconTwo,
// loaderIconThree: iconThree,
// );
//
// const TestApp app = TestApp(loader);
//
// await tester.pumpWidget(app);
//
// expect(
// tester.takeException(),
// isA<FlutterError>().having(
// (error) => error.message,
// 'message',
// 'Type should be custom for icons loader to display',
// ),
// );
// });

testWidgets('GF Loader with custom loader can be constructed using child',
(tester) async {
const customType = GFLoaderType.custom;

final GFLoader loader = GFLoader(type: customType, child: childWidget);

final TestApp app = TestApp(loader);

await tester.pumpWidget(app);

await tester.pumpWidget(Container(child: childWidget));
expect(find.byWidget(childWidget), findsOneWidget);
await tester.pump(duration);

expect(app.loader.child, childWidget);
expect(app.loader.type, customType);
});
}

class TestApp extends StatefulWidget {
const TestApp(this.loader);

final GFLoader loader;

@override
_TestAppState createState() => _TestAppState();
}

class _TestAppState extends State<TestApp> {
@override
Widget build(BuildContext context) => MaterialApp(
home: Scaffold(
body: Column(
children: [
widget.loader,
],
),
),
);
}
Loading