@@ -4,7 +4,7 @@ import 'package:flutter/gestures.dart';
44import 'package:flutter/rendering.dart' ;
55import 'package:flutter/widgets.dart' ;
66import 'package:flutter/material.dart' ;
7- import 'package:ui_kit/shape/gf_shape .dart' ;
7+ import 'package:ui_kit/shape/gf_button_shape .dart' ;
88import 'package:ui_kit/size/gf_size.dart' ;
99import 'package:ui_kit/types/gf_type.dart' ;
1010import 'package:ui_kit/position/gf_position.dart' ;
@@ -87,8 +87,8 @@ class GFButton extends StatefulWidget {
8787 /// Button type of [GFType] i.e, solid, outline, dashed
8888 final GFType type;
8989
90- /// Button type of [GFShape ] i.e, standard, pills, square, shadow, icons
91- final GFShape shape;
90+ /// Button type of [GFButtonShape ] i.e, standard, pills, square, shadow, icons
91+ final GFButtonShape shape;
9292
9393 /// Pass [GFColor] or [Color]
9494 final dynamic color;
@@ -175,9 +175,9 @@ class GFButton extends StatefulWidget {
175175 MaterialTapTargetSize materialTapTargetSize,
176176 this .child,
177177 this .type = GFType .solid,
178- this .shape = GFShape .standard,
178+ this .shape = GFButtonShape .standard,
179179 this .color = GFColor .primary,
180- this .textColor = GFColor .dark ,
180+ this .textColor,
181181 this .position = GFPosition .start,
182182 this .size = GFSize .medium,
183183 this .borderSide,
@@ -213,16 +213,18 @@ class _GFButtonState extends State<GFButton> {
213213 Widget icon;
214214 Function onPressed;
215215 GFType type;
216- GFShape shape;
216+ GFButtonShape shape;
217217 double size;
218218 GFPosition position;
219219 BoxShadow boxShadow;
220220 final Set <MaterialState > _states = < MaterialState > {};
221221
222222 @override
223223 void initState () {
224+
225+ print ('ccccccccccc ${widget .textColor }' );
224226 this .color = getGFColor (widget.color);
225- this .textColor = getGFColor (widget.textColor);
227+ this .textColor = widget.type == GFType .outline && widget.textColor == null ? this .color : widget.textColor == null ? getGFColor ( GFColor .dark) : getGFColor (widget.textColor);
226228 this .child = widget.text != null ? Text (widget.text) : widget.child;
227229 this .icon = widget.icon;
228230 this .onPressed = widget.onPressed;
@@ -312,7 +314,7 @@ class _GFButtonState extends State<GFButton> {
312314 final Color themeColor =
313315 Theme .of (context).colorScheme.onSurface.withOpacity (0.12 );
314316 final BorderSide outlineBorder = BorderSide (
315- color: widget.borderSide == null ? themeColor : widget.borderSide.color,
317+ color: this .color == null ? themeColor : widget.borderSide == null ? this .color : widget.borderSide.color,
316318 width: widget.borderSide? .width ?? 1.0 ,
317319 );
318320
@@ -340,13 +342,13 @@ class _GFButtonState extends State<GFButton> {
340342
341343
342344
343- if (this .shape == GFShape .pills) {
345+ if (this .shape == GFButtonShape .pills) {
344346 shape = RoundedRectangleBorder (
345347 borderRadius: BorderRadius .circular (50.0 ), side: shapeBorder);
346- } else if (this .shape == GFShape .square) {
348+ } else if (this .shape == GFButtonShape .square) {
347349 shape = RoundedRectangleBorder (
348350 borderRadius: BorderRadius .circular (0.0 ), side: shapeBorder);
349- } else if (this .shape == GFShape .standard) {
351+ } else if (this .shape == GFButtonShape .standard) {
350352 shape = RoundedRectangleBorder (
351353 borderRadius: BorderRadius .circular (5.0 ), side: shapeBorder);
352354 } else {
@@ -361,8 +363,8 @@ class _GFButtonState extends State<GFButton> {
361363 }else {
362364 return BoxDecoration (
363365 color: widget.type == GFType .transparent || widget.type == GFType .outline ? Colors .transparent : this .color,
364- borderRadius: widget.shape == GFShape .pills ? BorderRadius .circular (50.0 ) :
365- widget.shape == GFShape .standard ? BorderRadius .circular (5.0 ) : BorderRadius .zero,
366+ borderRadius: widget.shape == GFButtonShape .pills ? BorderRadius .circular (50.0 ) :
367+ widget.shape == GFButtonShape .standard ? BorderRadius .circular (5.0 ) : BorderRadius .zero,
366368 boxShadow: [
367369 widget.boxShadow == null && widget.buttonBoxShadow == true ? BoxShadow (
368370 color: themeColor,
@@ -643,8 +645,8 @@ class _RenderInputPadding extends RenderShiftedBox {
643645// /// Button type of [GFType] i.e, solid, outline, dashed
644646// final GFType type;
645647//
646- // /// Button type of [GFShape ] i.e, standard, pills, square, shadow, icons
647- // final GFShape shape;
648+ // /// Button type of [GFButtonShape ] i.e, standard, pills, square, shadow, icons
649+ // final GFButtonShape shape;
648650//
649651// /// Pass [GFColor] or [Color]
650652// final dynamic color;
@@ -712,7 +714,7 @@ class _RenderInputPadding extends RenderShiftedBox {
712714// MaterialTapTargetSize materialTapTargetSize,
713715// this.child,
714716// this.type,
715- // this.shape = GFShape .standard,
717+ // this.shape = GFButtonShape .standard,
716718// this.color,
717719// this.textColor = GFColor.dark,
718720// this.position = GFPosition.start,
@@ -748,7 +750,7 @@ class _RenderInputPadding extends RenderShiftedBox {
748750// Widget icon;
749751// Function onPressed;
750752// GFType type;
751- // GFShape shape;
753+ // GFButtonShape shape;
752754// double size;
753755// GFPosition position;
754756// BoxShadow boxShadow;
@@ -889,13 +891,13 @@ class _RenderInputPadding extends RenderShiftedBox {
889891//
890892// ShapeBorder shape;
891893//
892- // if (this.shape == GFShape .pills) {
894+ // if (this.shape == GFButtonShape .pills) {
893895// shape = RoundedRectangleBorder(
894896// borderRadius: BorderRadius.circular(50.0), side: shapeBorder);
895- // } else if (this.shape == GFShape .square) {
897+ // } else if (this.shape == GFButtonShape .square) {
896898// shape = RoundedRectangleBorder(
897899// borderRadius: BorderRadius.circular(0.0), side: shapeBorder);
898- // } else if (this.shape == GFShape .standard) {
900+ // } else if (this.shape == GFButtonShape .standard) {
899901// shape = RoundedRectangleBorder(
900902// borderRadius: BorderRadius.circular(5.0), side: shapeBorder);
901903// } else {
@@ -937,8 +939,8 @@ class _RenderInputPadding extends RenderShiftedBox {
937939// constraints: this.icon == null ? BoxConstraints(minHeight: 26.0, minWidth: 88.0) :
938940// BoxConstraints(minHeight: 26.0, minWidth: 98.0),
939941// decoration: BoxDecoration(
940- // borderRadius: widget.shape == GFShape .pills ? BorderRadius.circular(50.0) :
941- // widget.shape == GFShape .standard ? BorderRadius.circular(5.0) : BorderRadius.zero,
942+ // borderRadius: widget.shape == GFButtonShape .pills ? BorderRadius.circular(50.0) :
943+ // widget.shape == GFButtonShape .standard ? BorderRadius.circular(5.0) : BorderRadius.zero,
942944// boxShadow: [
943945// widget.boxShadow == null && widget.buttonBoxShadow == true ? BoxShadow(
944946// color: widget.color.withOpacity(0.4),
0 commit comments