nank1ro / flutter-shadcn-ui

shadcn-ui ported in Flutter. Awesome UI components for Flutter, fully customizable.
https://mariuti.com/shadcn-ui
MIT License
847 stars 52 forks source link

ShadButton: There should have Gap property between of Icon and Text #107

Closed moshOntong-IT closed 1 month ago

moshOntong-IT commented 1 month ago
 child: Row(
                          mainAxisSize: MainAxisSize.min,
                          crossAxisAlignment: effectiveCrossAxisAlignment,
                          mainAxisAlignment: effectiveMainAxisAlignment,
                          children: [
                            if (icon != null) icon,
                       <<<<<<<<<here>>>>>>>>>>>
                            if (widget.text != null)
                              DefaultTextStyle(
                                style: theme.textTheme.small.copyWith(
                                  color: hasPressedForegroundColor && pressed
                                      ? pressedForegroundColor(theme)
                                      : hovered
                                          ? hoverForeground(theme)
                                          : foreground(theme),
                                  decoration: textDecoration(
                                    theme,
                                    hovered: hovered,
                                  ),
                                  decorationColor: foreground(theme),
                                  decorationStyle: TextDecorationStyle.solid,
                                ),
                                textAlign: TextAlign.center,
                                child: widget.text!,
                              ),
                          ],
                        ),

There should have double gap this indicate the space gap between the icon and text. But we should have assert that the mainAxisAlignment should be null before implementing gap

moshOntong-IT commented 1 month ago

https://pub.dev/packages/gap

This package is also good

nank1ro commented 1 month ago

I could add the gap property, but it won't use that package. I know it is just a Sizedbox(width) No need to introduce potential errors for the mainAxisAlignment