diff --git a/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart b/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart index 824a7781..8b608cb0 100644 --- a/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart +++ b/packages/wyatt_ui_kit/lib/src/components/bars/widgets/navigation_item.dart @@ -33,8 +33,28 @@ class NavigationItem extends StatelessWidget { children: [ if (selected) Container( - height: 5, - width: 70, + height: ThemeHelper.getThemeElement( + [ + context + .themeExtension() + ?.selectedIndicatorHeight, + // TODO: move default value + 5, + ], + valueValidator: (value) => value != null, + transform: (value) => value, + ), + width: ThemeHelper.getThemeElement( + [ + context + .themeExtension() + ?.selectedIndicatorWidth, + // TODO: move default value + 70, + ], + valueValidator: (value) => value != null, + transform: (value) => value, + ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(100), color: ThemeHelper.getThemeElement( @@ -49,22 +69,37 @@ class NavigationItem extends StatelessWidget { ), ), ), - SizedBox( - height: 50, - child: Center( - child: Text( - item.data, - style: ThemeHelper.getThemeElement( - [ - context.textTheme.titleMedium, - context - .themeExtension() - ?.subTitleStyle, - item.style, - ], - combine: (value, element) => value?.merge(element), - valueValidator: (value) => value != null, - transform: (value) => value, + ConstrainedBox( + constraints: BoxConstraints( + minWidth: ThemeHelper.getThemeElement( + [ + context + .themeExtension() + ?.selectedIndicatorWidth, + // TODO: move default value + 70, + ], + valueValidator: (value) => value != null, + transform: (value) => value, + ) ?? double.infinity, + ), + child: SizedBox( + height: 50, + child: Center( + child: Text( + item.data, + style: ThemeHelper.getThemeElement( + [ + context.textTheme.titleMedium, + context + .themeExtension() + ?.subTitleStyle, + item.style, + ], + combine: (value, element) => value?.merge(element), + valueValidator: (value) => value != null, + transform: (value) => value, + ), ), ), ), diff --git a/packages/wyatt_ui_kit/lib/src/domain/top_bar_theme_extension.dart b/packages/wyatt_ui_kit/lib/src/domain/top_bar_theme_extension.dart index 54965797..42a34410 100644 --- a/packages/wyatt_ui_kit/lib/src/domain/top_bar_theme_extension.dart +++ b/packages/wyatt_ui_kit/lib/src/domain/top_bar_theme_extension.dart @@ -25,6 +25,8 @@ abstract class TopBarThemeExtension this.secondaryColor, this.titleStyle, this.subTitleStyle, + this.selectedIndicatorHeight, + this.selectedIndicatorWidth, }); final MultiColor? backgroundColors; @@ -33,4 +35,7 @@ abstract class TopBarThemeExtension final TextStyle? titleStyle; final TextStyle? subTitleStyle; + + final double? selectedIndicatorHeight; + final double? selectedIndicatorWidth; }