From 3cb8038be97c0adfd5d24c08c8bf6535be5ecb07 Mon Sep 17 00:00:00 2001 From: srinivas Date: Wed, 2 Sep 2020 11:30:20 +0530 Subject: [PATCH 1/2] GFaccordian, added border radius for title & content, changed variables camelCase letters --- example/pubspec.lock | 91 ++++++++------------- example/pubspec.yaml | 2 +- lib/components/accordian/gf_accordian.dart | 38 +++++---- pubspec.lock | 94 ++++++---------------- 4 files changed, 86 insertions(+), 139 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index ebc1d1bd..53123d5c 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,48 +1,48 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: + async: dependency: transitive description: - name: archive + name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" - args: + version: "2.4.2" + boolean_selector: dependency: transitive description: - name: args + name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" - async: + version: "2.0.0" + characters: dependency: transitive description: - name: async + name: characters url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" - boolean_selector: + version: "1.0.0" + charcode: dependency: transitive description: - name: boolean_selector + name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" - charcode: + version: "1.1.3" + clock: dependency: transitive description: - name: charcode + name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.0.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.14.13" convert: dependency: transitive description: @@ -50,13 +50,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" cupertino_icons: dependency: "direct main" description: @@ -64,6 +57,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -75,7 +75,7 @@ packages: name: flutter_svg url: "https://pub.dartlang.org" source: hosted - version: "0.17.1" + version: "0.18.1" flutter_test: dependency: "direct dev" description: flutter @@ -93,20 +93,13 @@ packages: relative: true source: path version: "1.1.3" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.8" meta: dependency: transitive description: @@ -120,14 +113,14 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.7.0" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "0.4.1+1" path_parsing: dependency: transitive description: @@ -135,20 +128,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0+1" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "3.0.4" plugin_platform_interface: dependency: transitive description: @@ -156,13 +142,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" sky_engine: dependency: transitive description: flutter @@ -174,14 +153,14 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.7.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.9.5" stream_channel: dependency: transitive description: @@ -209,14 +188,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.17" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.2.0" url_launcher: dependency: "direct main" description: @@ -258,7 +237,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "4.2.0" sdks: - dart: ">=2.4.0 <3.0.0" - flutter: ">=1.12.8 <2.0.0" + dart: ">=2.9.0-14.0.dev <3.0.0" + flutter: ">=1.18.0-6.0.pre <2.0.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 1bda3570..3aa763ea 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: getwidget: path: ../ cupertino_icons: ^0.1.2 - flutter_svg: ^0.17.1 + flutter_svg: ^0.18.0 url_launcher: ^5.4.1 dev_dependencies: diff --git a/lib/components/accordian/gf_accordian.dart b/lib/components/accordian/gf_accordian.dart index 82e0acfa..d722d479 100644 --- a/lib/components/accordian/gf_accordian.dart +++ b/lib/components/accordian/gf_accordian.dart @@ -6,21 +6,23 @@ class GFAccordion extends StatefulWidget { {Key key, this.titleChild, this.content, - this.collapsedTitlebackgroundColor = GFColors.WHITE, - this.expandedTitlebackgroundColor = const Color(0xFFE0E0E0), + this.collapsedTitleBackgroundColor = GFColors.WHITE, + this.expandedTitleBackgroundColor = const Color(0xFFE0E0E0), this.collapsedIcon = const Icon(Icons.keyboard_arrow_down), this.expandedIcon = const Icon(Icons.keyboard_arrow_up), this.title, this.textStyle = const TextStyle(color: Colors.black, fontSize: 16), this.titlePadding = const EdgeInsets.all(10), - this.contentbackgroundColor, + this.contentBackgroundColor, this.contentPadding = const EdgeInsets.all(10), this.contentChild, - this.titleborder = const Border(), + this.titleBorder = const Border(), this.contentBorder = const Border(), this.margin, this.showAccordion = false, - this.onToggleCollapsed}) + this.onToggleCollapsed, + this.titleBorderRadius = const BorderRadius.all(Radius.circular(0)), + this.contentBorderRadius = const BorderRadius.all(Radius.circular(0))}) : super(key: key); final Function(bool) onToggleCollapsed; @@ -38,10 +40,10 @@ class GFAccordion extends StatefulWidget { final Widget contentChild; /// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] title when it is collapsed - final Color collapsedTitlebackgroundColor; + final Color collapsedTitleBackgroundColor; /// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] title when it is expanded - final Color expandedTitlebackgroundColor; + final Color expandedTitleBackgroundColor; ///collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed final Widget collapsedIcon; @@ -62,17 +64,23 @@ class GFAccordion extends StatefulWidget { final EdgeInsets contentPadding; /// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] description - final Color contentbackgroundColor; + final Color contentBackgroundColor; ///margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion] final EdgeInsets margin; - ///titleborderColor of type [Color] or [GFColors] which is used to change the border color of title - final Border titleborder; + ///titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title + final Border titleBorder; ///contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content final Border contentBorder; + ///titleBorderRadius of type [Radius] which is used to change the border radius of title + final BorderRadius titleBorderRadius; + + ///contentBorderRadius of type [Radius] which is used to change the border radius of content + final BorderRadius contentBorderRadius; + @override _GFAccordionState createState() => _GFAccordionState(); } @@ -124,10 +132,11 @@ class _GFAccordionState extends State onTap: _toggleCollapsed, child: Container( decoration: BoxDecoration( - border: widget.titleborder, + borderRadius: widget.titleBorderRadius, + border: widget.titleBorder, color: showAccordion - ? widget.expandedTitlebackgroundColor - : widget.collapsedTitlebackgroundColor, + ? widget.expandedTitleBackgroundColor + : widget.collapsedTitleBackgroundColor, ), padding: widget.titlePadding, child: Row( @@ -146,8 +155,9 @@ class _GFAccordionState extends State showAccordion ? Container( decoration: BoxDecoration( + borderRadius: widget.contentBorderRadius, border: widget.contentBorder, - color: widget.contentbackgroundColor ?? Colors.white70, + color: widget.contentBackgroundColor ?? Colors.white70, ), width: MediaQuery.of(context).size.width, padding: widget.contentPadding, diff --git a/pubspec.lock b/pubspec.lock index 67a7df16..9477cdd7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,62 +1,55 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.11" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.4.2" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.0.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" - collection: + version: "1.1.3" + clock: dependency: transitive description: - name: collection + name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" - convert: + version: "1.0.1" + collection: dependency: transitive description: - name: convert + name: collection url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" - crypto: + version: "1.14.13" + fake_async: dependency: transitive description: - name: crypto + name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -67,20 +60,13 @@ packages: description: flutter source: sdk version: "0.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.6" + version: "0.12.8" meta: dependency: transitive description: @@ -94,28 +80,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0+1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" + version: "1.7.0" sky_engine: dependency: transitive description: flutter @@ -127,14 +92,14 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.7.0" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.9.5" stream_channel: dependency: transitive description: @@ -162,14 +127,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.11" + version: "0.2.17" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.2.0" vector_math: dependency: transitive description: @@ -177,12 +142,5 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "3.5.0" sdks: - dart: ">=2.4.0 <3.0.0" + dart: ">=2.9.0-14.0.dev <3.0.0" From ab301fc73c5967e47d0f95b4b660bbe6a2566610 Mon Sep 17 00:00:00 2001 From: srinivas Date: Wed, 2 Sep 2020 16:21:57 +0530 Subject: [PATCH 2/2] code reviewing the components --- lib/components/accordian/gf_accordian.dart | 6 +++--- lib/components/alert/gf_alert.dart | 2 +- lib/components/appbar/gf_appbar.dart | 2 +- lib/components/carousel/gf_carousel.dart | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/components/accordian/gf_accordian.dart b/lib/components/accordian/gf_accordian.dart index d722d479..5dcc25d2 100644 --- a/lib/components/accordian/gf_accordian.dart +++ b/lib/components/accordian/gf_accordian.dart @@ -17,7 +17,7 @@ class GFAccordion extends StatefulWidget { this.contentPadding = const EdgeInsets.all(10), this.contentChild, this.titleBorder = const Border(), - this.contentBorder = const Border(), + this.contentborder = const Border(), this.margin, this.showAccordion = false, this.onToggleCollapsed, @@ -73,7 +73,7 @@ class GFAccordion extends StatefulWidget { final Border titleBorder; ///contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content - final Border contentBorder; + final Border contentborder; ///titleBorderRadius of type [Radius] which is used to change the border radius of title final BorderRadius titleBorderRadius; @@ -156,7 +156,7 @@ class _GFAccordionState extends State ? Container( decoration: BoxDecoration( borderRadius: widget.contentBorderRadius, - border: widget.contentBorder, + border: widget.contentborder, color: widget.contentBackgroundColor ?? Colors.white70, ), width: MediaQuery.of(context).size.width, diff --git a/lib/components/alert/gf_alert.dart b/lib/components/alert/gf_alert.dart index c22306b3..8d42ed15 100644 --- a/lib/components/alert/gf_alert.dart +++ b/lib/components/alert/gf_alert.dart @@ -109,7 +109,7 @@ class _GFAlertState extends State with TickerProviderStateMixin { : GFColors.WHITE, boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.40), blurRadius: 3) + color: Colors.black.withOpacity(0.10), blurRadius: 2) ]), child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/components/appbar/gf_appbar.dart b/lib/components/appbar/gf_appbar.dart index d8905d0e..d8163122 100644 --- a/lib/components/appbar/gf_appbar.dart +++ b/lib/components/appbar/gf_appbar.dart @@ -524,7 +524,7 @@ class _GFAppBarState extends State { ); } - // The padding applies to the toolbar and tabbar, not the flexible space. + // The padding applies to the toolbar and tabBar, not the flexible space. if (widget.primary) { appBar = SafeArea( top: true, diff --git a/lib/components/carousel/gf_carousel.dart b/lib/components/carousel/gf_carousel.dart index 9f8cd410..e0248337 100644 --- a/lib/components/carousel/gf_carousel.dart +++ b/lib/components/carousel/gf_carousel.dart @@ -24,7 +24,6 @@ class GFCarousel extends StatefulWidget { this.pauseAutoPlayOnTouch, this.enlargeMainPage = false, this.onPageChanged, -// this.onPageIndex, this.scrollPhysics, this.scrollDirection = Axis.horizontal, }) : realPage = enableInfiniteScroll ? realPage + initialPage : initialPage,