From 756ad08bca868105d68bb505945da53bd4f1f3a9 Mon Sep 17 00:00:00 2001 From: Sandip Kakadiya Date: Thu, 12 Nov 2020 18:28:13 +0530 Subject: [PATCH 1/5] release 1.2.3 --- CHANGELOG.md | 12 ++++++++++++ example/pubspec.lock | 2 +- pubspec.lock | 6 +++--- pubspec.yaml | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e1efb3..0448aa8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/example/pubspec.lock b/example/pubspec.lock index 10b10812..2fe44bd7 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -92,7 +92,7 @@ packages: path: ".." relative: true source: path - version: "1.2.2" + version: "1.2.3" matcher: dependency: transitive description: diff --git a/pubspec.lock b/pubspec.lock index 65991e82..b308ac32 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: @@ -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" diff --git a/pubspec.yaml b/pubspec.yaml index 43a330e6..0dd14f28 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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: From 5fa9e723351160d4d6cc4d89359af996f370b7a0 Mon Sep 17 00:00:00 2001 From: ujjb <52951447+ujjb@users.noreply.github.com> Date: Fri, 13 Nov 2020 11:19:56 +0530 Subject: [PATCH 2/5] Update README.md updated screen image uploaded --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a26dd0be..1ee021fb 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ ## Screenshot

- GetWidget Screens + GetWidget Screens

@@ -113,4 +113,4 @@ Support this project with your organization. Your logo will show up here with a - \ No newline at end of file + From 4ea20ca3bb592559b9d36a9f96a64de44ca61027 Mon Sep 17 00:00:00 2001 From: deepikahr Date: Wed, 18 Nov 2020 10:45:04 +0530 Subject: [PATCH 3/5] test cases for loader component added --- test/loader_test.dart | 282 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 test/loader_test.dart diff --git a/test/loader_test.dart b/test/loader_test.dart new file mode 100644 index 00000000..18283172 --- /dev/null +++ b/test/loader_test.dart @@ -0,0 +1,282 @@ +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 childWidget = Container( + width: 111, + height: 222, + ); + + final iconOne = Icon(Icons.directions_bike_sharp); + final iconTwo = Icon(Icons.directions_car); + final iconThree = Icon(Icons.directions_bus); + + final duration = Duration(milliseconds: 1000); + + final firstColor = Colors.teal; + final secondColor = Colors.tealAccent; + final thirdColor = Colors.tealAccent.shade400; + + final 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 { + + final GFLoader loader = GFLoader( + + ); + + final TestApp app = TestApp(loader); + + await tester.pumpWidget(app); + + }); + + testWidgets('GF Loader with icons can be constructed', (tester) async { + + final customType = GFLoaderType.custom; + + final GFLoader loader = GFLoader( + type: customType, + duration: duration, + loaderIconOne : iconOne, + loaderIconTwo: iconTwo, + loaderIconThree: iconThree, + loaderstrokeWidth: stroke, + ); + + final 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 { + + final customType = GFLoaderType.square; + + final GFLoader loader = GFLoader( + type: customType, + duration: duration, + loaderColorOne: firstColor, + loaderColorTwo: secondColor, + loaderColorThree: thirdColor, + loaderstrokeWidth: stroke, + ); + + final 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 { + + final customType = GFLoaderType.circle; + + final GFLoader loader = GFLoader( + type: customType, + duration: duration, + loaderColorOne: firstColor, + loaderColorTwo: secondColor, + loaderColorThree: thirdColor, + loaderstrokeWidth: stroke, + ); + + final 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 { + + final customType = GFLoaderType.android; + final color = AlwaysStoppedAnimation(Colors.green); + + final GFLoader loader = GFLoader( + type: customType, + androidLoaderColor : color + ); + + final 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, + // // + // // ); + // + // final GFLoader loader = GFLoader( + // type: null, + // loaderIconOne : iconOne, + // loaderIconTwo: iconTwo, + // loaderIconThree: iconThree, + // ); + // + // final TestApp app = TestApp(loader); + // + // await tester.pumpWidget(app); + // + // expect( + // tester.takeException(), + // isA().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 { + + final 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 { + final GFLoader loader; + + TestApp(this.loader); + + @override + _TestAppState createState() => _TestAppState(); +} + +class _TestAppState extends State { + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + body: Column( + children: [ + widget.loader, + ], + ), + ), + ); + } +} From 00e06c7ee00dd17bc31b13a935a0674aff30bc0b Mon Sep 17 00:00:00 2001 From: deepikahr Date: Wed, 18 Nov 2020 11:11:36 +0530 Subject: [PATCH 4/5] type issue fixed in loader_test --- pubspec.lock | 6 +- test/loader_test.dart | 131 +++++++++++++++++------------------------- 2 files changed, 56 insertions(+), 81 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index b308ac32..65991e82 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -73,7 +73,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" path: dependency: transitive description: @@ -99,7 +99,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -143,4 +143,4 @@ packages: source: hosted version: "2.1.0-nullsafety.3" sdks: - dart: ">=2.10.0-110 <2.11.0" + dart: ">=2.10.0-110 <=2.11.0-213.1.beta" diff --git a/test/loader_test.dart b/test/loader_test.dart index 18283172..218aa74b 100644 --- a/test/loader_test.dart +++ b/test/loader_test.dart @@ -4,23 +4,22 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:getwidget/getwidget.dart'; void main() { - - final childWidget = Container( + final Widget childWidget = Container( width: 111, height: 222, ); - final iconOne = Icon(Icons.directions_bike_sharp); - final iconTwo = Icon(Icons.directions_car); - final iconThree = Icon(Icons.directions_bus); + const iconOne = Icon(Icons.directions_bike_sharp); + const iconTwo = Icon(Icons.directions_car); + const iconThree = Icon(Icons.directions_bus); - final duration = Duration(milliseconds: 1000); + const duration = Duration(milliseconds: 1000); - final firstColor = Colors.teal; - final secondColor = Colors.tealAccent; - final thirdColor = Colors.tealAccent.shade400; + const firstColor = Colors.teal; + const secondColor = Colors.tealAccent; + const thirdColor = Colors.tealAccent; - final stroke = 4.0; + const stroke = 4.0; debugDefaultTargetPlatformOverride = TargetPlatform.iOS; @@ -41,17 +40,16 @@ void main() { // }); 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 + 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); @@ -69,35 +67,29 @@ void main() { expect(app.loader.size, GFSize.MEDIUM); debugDefaultTargetPlatformOverride = null; - }); testWidgets('Basic GF Loader can be constructed', (tester) async { + const GFLoader loader = GFLoader(); - final GFLoader loader = GFLoader( - - ); - - final TestApp app = TestApp(loader); + const TestApp app = TestApp(loader); await tester.pumpWidget(app); - }); testWidgets('GF Loader with icons can be constructed', (tester) async { + const customType = GFLoaderType.custom; - final customType = GFLoaderType.custom; - - final GFLoader loader = GFLoader( + const GFLoader loader = GFLoader( type: customType, duration: duration, - loaderIconOne : iconOne, + loaderIconOne: iconOne, loaderIconTwo: iconTwo, loaderIconThree: iconThree, loaderstrokeWidth: stroke, ); - final TestApp app = TestApp(loader); + const TestApp app = TestApp(loader); await tester.pumpWidget(app); @@ -108,10 +100,8 @@ void main() { expect(app.loader.loaderIconTwo, iconTwo); expect(app.loader.loaderIconThree, iconThree); expect(app.loader.loaderstrokeWidth, stroke); - }); - // testWidgets('Asserts.', (tester) async { // // when type is null // @@ -126,10 +116,9 @@ void main() { // }); testWidgets('GF Loader with square type can be constructed', (tester) async { + const customType = GFLoaderType.square; - final customType = GFLoaderType.square; - - final GFLoader loader = GFLoader( + const GFLoader loader = GFLoader( type: customType, duration: duration, loaderColorOne: firstColor, @@ -138,7 +127,7 @@ void main() { loaderstrokeWidth: stroke, ); - final TestApp app = TestApp(loader); + const TestApp app = TestApp(loader); await tester.pumpWidget(app); @@ -149,14 +138,12 @@ void main() { 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; - final customType = GFLoaderType.circle; - - final GFLoader loader = GFLoader( + const GFLoader loader = GFLoader( type: customType, duration: duration, loaderColorOne: firstColor, @@ -165,7 +152,7 @@ void main() { loaderstrokeWidth: stroke, ); - final TestApp app = TestApp(loader); + const TestApp app = TestApp(loader); await tester.pumpWidget(app); @@ -176,29 +163,24 @@ void main() { 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 { + testWidgets('GF Loader with android type loader can be constructed', + (tester) async { + const customType = GFLoaderType.android; + const color = AlwaysStoppedAnimation(Colors.green); - final customType = GFLoaderType.android; - final color = AlwaysStoppedAnimation(Colors.green); + const GFLoader loader = + GFLoader(type: customType, androidLoaderColor: color); - final GFLoader loader = GFLoader( - type: customType, - androidLoaderColor : color - ); - - final TestApp app = TestApp(loader); + 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 // @@ -212,14 +194,14 @@ void main() { // // // // ); // - // final GFLoader loader = GFLoader( + // const GFLoader loader = GFLoader( // type: null, // loaderIconOne : iconOne, // loaderIconTwo: iconTwo, // loaderIconThree: iconThree, // ); // - // final TestApp app = TestApp(loader); + // const TestApp app = TestApp(loader); // // await tester.pumpWidget(app); // @@ -233,14 +215,11 @@ void main() { // ); // }); - testWidgets('GF Loader with custom loader can be constructed using child', (tester) async { - - final customType = GFLoaderType.custom; + 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 GFLoader loader = GFLoader(type: customType, child: childWidget); final TestApp app = TestApp(loader); @@ -252,15 +231,13 @@ void main() { expect(app.loader.child, childWidget); expect(app.loader.type, customType); - }); - } class TestApp extends StatefulWidget { - final GFLoader loader; + const TestApp(this.loader); - TestApp(this.loader); + final GFLoader loader; @override _TestAppState createState() => _TestAppState(); @@ -268,15 +245,13 @@ class TestApp extends StatefulWidget { class _TestAppState extends State { @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - body: Column( - children: [ - widget.loader, - ], + Widget build(BuildContext context) => MaterialApp( + home: Scaffold( + body: Column( + children: [ + widget.loader, + ], + ), ), - ), - ); - } + ); } From c0c192515c77414cb1937398d56875070acbad73 Mon Sep 17 00:00:00 2001 From: "Shravya.ckm" Date: Wed, 18 Nov 2020 13:29:27 +0530 Subject: [PATCH 5/5] done with typography testing --- pubspec.lock | 6 +- test/typography_test.dart | 116 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 test/typography_test.dart diff --git a/pubspec.lock b/pubspec.lock index 65991e82..b308ac32 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: @@ -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" diff --git a/test/typography_test.dart b/test/typography_test.dart new file mode 100644 index 00000000..5ba4d11e --- /dev/null +++ b/test/typography_test.dart @@ -0,0 +1,116 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:getwidget/getwidget.dart'; + +void main() { + final Widget childWidget = Container( + width: 11, + height: 22, + ); + + const icon = Icon(Icons.home); + const text = 'Hello'; + + const dividerRadius = BorderRadius.all(Radius.circular(2)); + const textcolor = GFColors.INFO; + const dividerposition = Alignment.center; + + testWidgets('GFTypograpgy can be created', (WidgetTester tester) async { + final GFTypography typography = GFTypography( + icon: icon, + dividerBorderRadius: dividerRadius, + text: text, + textColor: textcolor, + dividerAlignment: dividerposition, + type: GFTypographyType.typo2, + child: childWidget, + ); + + final TestApp app = TestApp(typography); + + await tester.pumpWidget(app); + + await tester.pumpWidget(Container(child: childWidget)); + expect(find.byWidget(childWidget), findsOneWidget); + + expect(app.typography.child, childWidget); + expect(app.typography.icon, icon); + expect(app.typography.dividerAlignment, Alignment.center); + expect(app.typography.dividerBorderRadius, dividerRadius); + expect(app.typography.textColor, textcolor); + }); + + testWidgets('GF Typography with divider', (tester) async { + const bool divider = true; + + const GFTypography typography = GFTypography( + showDivider: divider, + ); + + const TestApp app = TestApp(typography); + + expect(app.typography.showDivider, divider); + }); + + testWidgets('GF Typography with opacity', (tester) async { + final textopacity = Colors.black.withOpacity(0.56); + + final GFTypography typography = GFTypography( + textColor: textopacity, + ); + + final TestApp app = TestApp(typography); + + expect(app.typography.textColor, textopacity); + }); + + testWidgets('GF Typography with Custom Heading', (tester) async { + final textopacity = Colors.black.withOpacity(0.56); + const bool divider = true; + const icon = GFAvatar(); + const colorfilter = ColorFilter.mode(Colors.black, BlendMode.darken); + const bgImage = NetworkImage( + 'https://images.unsplash.com/photo-1547721064-da6cfb341d50', + ); + + final GFTypography typography = GFTypography( + textColor: textopacity, + showDivider: divider, + icon: icon, + backgroundImage: bgImage, + backgroundImagecolorFilter: colorfilter, + ); + + final TestApp app = TestApp(typography); + + expect(app.typography.textColor, textopacity); + expect(app.typography.showDivider, divider); + expect(app.typography.icon, icon); + expect(app.typography.backgroundImage, bgImage); + expect(app.typography.backgroundImagecolorFilter, colorfilter); + }); +} + +class TestApp extends StatefulWidget { + const TestApp(this.typography); + + final GFTypography typography; + + @override + _TestAppState createState() => _TestAppState(); +} + +class _TestAppState extends State { + @override + Widget build(BuildContext context) => MaterialApp( + home: Scaffold( + body: Column( + children: [ + Expanded( + child: widget.typography, + ) + ], + ), + ), + ); +}