@@ -111,7 +111,7 @@ class _GFIconButtonState extends State<GFIconButton> {
111111 BoxShadow boxShadow;
112112 double height;
113113 double width;
114- double iconPixel;
114+ double iconPixel = 18 ;
115115
116116 @override
117117 void initState () {
@@ -230,31 +230,34 @@ class _GFIconButtonState extends State<GFIconButton> {
230230 } else if (widget.size == GFSize .MEDIUM ) {
231231 height = 35.0 ;
232232 width = 35.0 ;
233- iconPixel = 18 .0 ;
233+ iconPixel = 28 .0 ;
234234 } else if (widget.size == GFSize .LARGE ) {
235235 height = 40.0 ;
236236 width = 40.0 ;
237- iconPixel = 18.0 ;
238- } else {
239- height = 35.0 ;
240- width = 35.0 ;
241- iconPixel = 18.0 ;
237+ iconPixel = 38.0 ;
242238 }
243239
244240 Widget result = Container (
245- height: widget.shape == GFIconButtonShape .circle ? height + 6.0 : height,
246- width: widget.shape == GFIconButtonShape .pills
247- ? width + 10
248- : widget.shape == GFIconButtonShape .circle
249- ? height + 6
250- : width,
241+ // height: widget.shape == GFIconButtonShape.circle ? height + 6.0 : height,
242+ // width: widget.shape == GFIconButtonShape.pills
243+ // ? width + 10
244+ // : widget.shape == GFIconButtonShape.circle
245+ // ? height + 6
246+ // : width,
251247 padding: widget.padding,
252- child: IconTheme .merge (
253- data: IconThemeData (
254- size: widget.iconSize > 0.0 ? widget.iconSize : iconPixel,
255- color: getIconColor (),
248+ child: SizedBox (
249+ height: widget.iconSize != 0 ? widget.iconSize : iconPixel,
250+ width: widget.iconSize != 0 ? widget.iconSize : iconPixel,
251+ child: Align (
252+ alignment: Alignment .center,
253+ child: IconTheme .merge (
254+ data: IconThemeData (
255+ size: widget.iconSize > 0.0 ? widget.iconSize : iconPixel,
256+ color: getIconColor (),
257+ ),
258+ child: widget.icon,
259+ ),
256260 ),
257- child: widget.icon,
258261 ),
259262 );
260263
@@ -308,46 +311,42 @@ class _GFIconButtonState extends State<GFIconButton> {
308311 child: Focus (
309312 focusNode: widget.focusNode,
310313 autofocus: widget.autofocus,
311- child: ConstrainedBox (
312- constraints: const BoxConstraints (maxWidth: 60 , maxHeight: 60 ),
313- child: Container (
314- height:
315- widget.shape == GFIconButtonShape .circle ? height + 6 : height,
316- width: widget.shape == GFIconButtonShape .pills
317- ? width + 10
318- : widget.shape == GFIconButtonShape .circle
319- ? height + 6
320- : width,
321- decoration:
322- widget.type == GFButtonType .solid ? getBoxShadow () : null ,
323- child: Material (
324- shape: widget.type == GFButtonType .transparent
325- ? null
326- : widget.borderShape ?? shapeBorderType,
327- color: widget.onPressed != null
328- ? getColor ()
329- : getDisabledFillColor (),
330- type: widget.type == GFButtonType .transparent
331- ? MaterialType .transparency
332- : MaterialType .button,
333- child: InkResponse (
334- onTap: widget.onPressed,
335- child: result,
336- focusColor: widget.focusColor ?? Theme .of (context).focusColor,
337- hoverColor: widget.hoverColor ?? Theme .of (context).hoverColor,
338- highlightColor:
339- widget.highlightColor ?? Theme .of (context).highlightColor,
340- splashColor:
341- widget.splashColor ?? Theme .of (context).splashColor,
342- radius: math.max (
343- Material .defaultSplashRadius,
344- (widget.iconSize +
345- math.min (
346- widget.padding.horizontal,
347- widget.padding.vertical,
348- )) *
349- 0.7 ),
350- ),
314+ child: Container (
315+ // height:
316+ // widget.shape == GFIconButtonShape.circle ? height + 6 : height,
317+ // width: widget.shape == GFIconButtonShape.pills
318+ // ? width + 10
319+ // : widget.shape == GFIconButtonShape.circle
320+ // ? height + 6
321+ // : width,
322+ decoration: widget.type == GFButtonType .solid ? getBoxShadow () : null ,
323+ child: Material (
324+ shape: widget.type == GFButtonType .transparent
325+ ? null
326+ : widget.borderShape ?? shapeBorderType,
327+ color:
328+ widget.onPressed != null ? getColor () : getDisabledFillColor (),
329+ type: widget.type == GFButtonType .transparent
330+ ? MaterialType .transparency
331+ : MaterialType .button,
332+ child: InkResponse (
333+ onTap: widget.onPressed,
334+ child: result,
335+ focusColor: widget.focusColor ?? Theme .of (context).focusColor,
336+ hoverColor: widget.hoverColor ?? Theme .of (context).hoverColor,
337+ highlightColor:
338+ widget.highlightColor ?? Theme .of (context).highlightColor,
339+ splashColor: widget.splashColor ?? Theme .of (context).splashColor,
340+ radius: math.max (
341+ Material .defaultSplashRadius,
342+ (widget.iconSize > 0.0
343+ ? widget.iconSize
344+ : iconPixel +
345+ math.min (
346+ widget.padding.horizontal,
347+ widget.padding.vertical,
348+ )) *
349+ 0.7 ),
351350 ),
352351 ),
353352 ),
0 commit comments