Skip to content
53 changes: 39 additions & 14 deletions lib/components/accordian/gf_accordian.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -105,9 +112,19 @@ class _GFAccordionState extends State<GFAccordion>
});
},
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),
Expand All @@ -126,12 +143,20 @@ class _GFAccordionState extends State<GFAccordion>
),
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,
Expand Down
109 changes: 51 additions & 58 deletions lib/components/alert/gf_alert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -83,66 +84,58 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {

@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height,
),
FadeTransition(
opacity: animation,
child: Column(
children: <Widget>[
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>[
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: <Widget>[
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>[
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(),
],
),
),
),
],
],
),
);
}
}
56 changes: 26 additions & 30 deletions lib/components/toast/gf_floating_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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();
Expand All @@ -45,32 +47,26 @@ class _GFFloatingWidgetState extends State<GFFloatingWidget> {
height: MediaQuery.of(context).size.height,
child: widget.body ?? Container(),
),
Container(
// color: widget.child!=null? widget.color: null,
child: Stack(
children: <Widget>[
Positioned(
child: Container(
alignment: Alignment.topLeft,
// color: widget.child!=null? widget.color: null,
color: widget.blur ? Colors.black38 : null,
child: Stack(
children: <Widget>[
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: <Widget>[
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(),
)
],
),
))
],
);
Expand Down