diff --git a/lib/components/accordian/gf_accordian.dart b/lib/components/accordian/gf_accordian.dart index 3713f143..e58f82b7 100644 --- a/lib/components/accordian/gf_accordian.dart +++ b/lib/components/accordian/gf_accordian.dart @@ -8,14 +8,15 @@ class GFAccordion extends StatefulWidget { this.content, this.titlebackgroundColor, this.collapsedIcon = const Icon(Icons.keyboard_arrow_down), - this.expandedIcon = - const Icon(Icons.keyboard_arrow_up, color: Colors.red), + this.expandedIcon = const Icon(Icons.keyboard_arrow_up), this.title, this.textStyle = const TextStyle(color: Colors.black, fontSize: 16), this.titlePadding, - this.descriptionPadding, - this.descriptionbackgroundColor, + this.contentbackgroundColor, + this.contentPadding, this.contentChild, + this.titleborderColor, + this.contentBorderColor, this.margin}) : super(key: key); @@ -47,14 +48,20 @@ class GFAccordion extends StatefulWidget { final EdgeInsets titlePadding; ///descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description - final EdgeInsets descriptionPadding; + final EdgeInsets contentPadding; /// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] description - final dynamic descriptionbackgroundColor; + final dynamic contentbackgroundColor; ///margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion] final EdgeInsets margin; + ///titleborderColor of type [Color] or [GFColor] which is used to change the border color of title + final dynamic titleborderColor; + + ///contentBorderColor of type [Color] or [GFColor] which is used to change the border color of content + final dynamic contentBorderColor; + @override _GFAccordionState createState() => _GFAccordionState(); } @@ -105,9 +112,19 @@ class _GFAccordionState extends State }); }, child: Container( - color: widget.titlebackgroundColor != null - ? widget.titlebackgroundColor - : Colors.white, + decoration: BoxDecoration( + border: widget.titleborderColor == null + ? widget.titleborderColor + : Border( + top: BorderSide(color: Colors.black38), + left: BorderSide(color: Colors.black38), + right: BorderSide(color: Colors.black38), + bottom: BorderSide(color: Colors.black38)), + color: showAccordion + ? widget.titlebackgroundColor != null + ? widget.titlebackgroundColor + : Color(0xFFE0E0E0) + : widget.titlebackgroundColor), padding: widget.titlePadding != null ? widget.titlePadding : EdgeInsets.all(10), @@ -126,12 +143,20 @@ class _GFAccordionState extends State ), showAccordion ? Container( + decoration: BoxDecoration( + border: widget.contentBorderColor == null + ? widget.contentBorderColor + : Border( + bottom: BorderSide(color: Colors.black38), + left: BorderSide(color: Colors.black38), + right: BorderSide(color: Colors.black38)), + color: widget.contentbackgroundColor != null + ? widget.contentbackgroundColor + : Colors.white70, + ), width: MediaQuery.of(context).size.width, - color: widget.descriptionbackgroundColor != null - ? widget.descriptionbackgroundColor - : Colors.white70, - padding: widget.descriptionPadding != null - ? widget.descriptionPadding + padding: widget.contentPadding != null + ? widget.contentPadding : EdgeInsets.all(10), child: SlideTransition( position: offset, diff --git a/lib/components/alert/gf_alert.dart b/lib/components/alert/gf_alert.dart index 77147965..26d74006 100644 --- a/lib/components/alert/gf_alert.dart +++ b/lib/components/alert/gf_alert.dart @@ -56,6 +56,7 @@ class GFAlert extends StatefulWidget { ///type of [Widget] used for the buttons ie, OK, Cancel for the action in [GFAlert] final Widget bottombar; + @override _GFAlertState createState() => _GFAlertState(); } @@ -83,66 +84,58 @@ class _GFAlertState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { - return Stack( - children: [ - Container( - height: MediaQuery.of(context).size.height, - ), - FadeTransition( - opacity: animation, - child: Column( - children: [ - Container( - width: widget.type == GFAlertType.fullWidth - ? MediaQuery.of(context).size.width - : widget.width, - constraints: BoxConstraints(minHeight: 50.0), - margin: widget.type == GFAlertType.fullWidth - ? EdgeInsets.only(left: 0, right: 0) - : EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.all(15), - decoration: BoxDecoration( - borderRadius: widget.type == GFAlertType.basic - ? BorderRadius.circular(3.0) - : widget.type == GFAlertType.rounded - ? BorderRadius.circular(10.0) - : BorderRadius.zero, - color: widget.backgroundColor != null - ? GFColors.getGFColor(widget.backgroundColor) - : GFColors.getGFColor(GFColor.white), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.40), - blurRadius: 3.0) - ]), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - widget.title != null - ? Text(widget.title, style: widget.titleTextStyle) - : (widget.child ?? Container()), - SizedBox( - height: 10, - ), - Align( - alignment: widget.alignment != null - ? widget.alignment - : Alignment.topLeft, - child: widget.content != null - ? Text(widget.content, style: widget.textStyle) - : (widget.contentChild ?? Container()), - ), - SizedBox( - height: 10, - ), - widget.bottombar != null ? widget.bottombar : Container(), - ], + return FadeTransition( + opacity: animation, + child: Column( + children: [ + Container( + width: widget.type == GFAlertType.fullWidth + ? MediaQuery.of(context).size.width + : widget.width, + constraints: BoxConstraints(minHeight: 50.0), + margin: widget.type == GFAlertType.fullWidth + ? EdgeInsets.only(left: 0, right: 0) + : EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.all(15), + decoration: BoxDecoration( + borderRadius: widget.type == GFAlertType.basic + ? BorderRadius.circular(3.0) + : widget.type == GFAlertType.rounded + ? BorderRadius.circular(10.0) + : BorderRadius.zero, + color: widget.backgroundColor != null + ? GFColors.getGFColor(widget.backgroundColor) + : GFColors.getGFColor(GFColor.white), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.40), blurRadius: 3.0) + ]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + widget.title != null + ? Text(widget.title, style: widget.titleTextStyle) + : (widget.child ?? Container()), + SizedBox( + height: 10, + ), + Align( + alignment: widget.alignment != null + ? widget.alignment + : Alignment.topLeft, + child: widget.content != null + ? Text(widget.content, style: widget.textStyle) + : (widget.contentChild ?? Container()), + ), + SizedBox( + height: 10, ), - ), - ], + widget.bottombar != null ? widget.bottombar : Container(), + ], + ), ), - ), - ], + ], + ), ); } } diff --git a/lib/components/toast/gf_floating_widget.dart b/lib/components/toast/gf_floating_widget.dart index 28e71064..6e235562 100644 --- a/lib/components/toast/gf_floating_widget.dart +++ b/lib/components/toast/gf_floating_widget.dart @@ -9,8 +9,8 @@ class GFFloatingWidget extends StatefulWidget { this.child, this.horizontalPosition, this.verticalPosition, - this.color, - this.blur = false, + this.blurnessColor, + this.showblurness = false, this.body}) : super(key: key); @@ -26,9 +26,11 @@ class GFFloatingWidget extends StatefulWidget { /// verticalPosition of type [double] which aligns the child vertically across the body final double verticalPosition; - final dynamic color; + ///blurnessColor of tye [Color] or [GFColor] which is used to blur the backgroundColor when ever the [child] is used in [GFFloatingWidget] + final dynamic blurnessColor; - final bool blur; + ///type of bool which allows to show or hide the blurness of the backgroundColor whenever the [child] is used in [GFFloatingWidget] + final bool showblurness; @override _GFFloatingWidgetState createState() => _GFFloatingWidgetState(); @@ -45,32 +47,26 @@ class _GFFloatingWidgetState extends State { height: MediaQuery.of(context).size.height, child: widget.body ?? Container(), ), - Container( -// color: widget.child!=null? widget.color: null, - child: Stack( - children: [ - Positioned( - child: Container( - alignment: Alignment.topLeft, -// color: widget.child!=null? widget.color: null, - color: widget.blur ? Colors.black38 : null, - child: Stack( - children: [ - Positioned( - top: widget.verticalPosition != null - ? widget.verticalPosition - : 0.0, - left: widget.horizontalPosition != null - ? widget.horizontalPosition - : 0.0, - right: widget.horizontalPosition != null - ? widget.horizontalPosition - : 0.0, - child: widget.child ?? Container(), - ) - ], - ))), - ], + Positioned( + child: Container( + height: MediaQuery.of(context).size.height, + color: widget.showblurness ? widget.blurnessColor : null, + child: Stack( + children: [ + Positioned( + top: widget.verticalPosition != null + ? widget.verticalPosition + : 0.0, + left: widget.horizontalPosition != null + ? widget.horizontalPosition + : 0.0, + right: widget.horizontalPosition != null + ? widget.horizontalPosition + : 0.0, + child: widget.child ?? Container(), + ) + ], + ), )) ], );