master #81

Closed
malo wants to merge 322 commits from master into feat/bloc_layout/new-package
2 changed files with 58 additions and 18 deletions
Showing only changes of commit 8c06f98624 - Show all commits

View File

@ -33,8 +33,28 @@ class NavigationItem extends StatelessWidget {
children: [ children: [
if (selected) if (selected)
Container( Container(
height: 5, height: ThemeHelper.getThemeElement<double, double>(
width: 70, [
context
.themeExtension<TopBarThemeExtension>()
?.selectedIndicatorHeight,
// TODO: move default value
5,
],
valueValidator: (value) => value != null,
transform: (value) => value,
),
width: ThemeHelper.getThemeElement<double, double>(
[
context
.themeExtension<TopBarThemeExtension>()
?.selectedIndicatorWidth,
// TODO: move default value
70,
],
valueValidator: (value) => value != null,
transform: (value) => value,
),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100), borderRadius: BorderRadius.circular(100),
color: ThemeHelper.getThemeElement<Color, Color>( color: ThemeHelper.getThemeElement<Color, Color>(
@ -49,22 +69,37 @@ class NavigationItem extends StatelessWidget {
), ),
), ),
), ),
SizedBox( ConstrainedBox(
height: 50, constraints: BoxConstraints(
child: Center( minWidth: ThemeHelper.getThemeElement<double, double>(
child: Text( [
item.data, context
style: ThemeHelper.getThemeElement<TextStyle, TextStyle>( .themeExtension<TopBarThemeExtension>()
[ ?.selectedIndicatorWidth,
context.textTheme.titleMedium, // TODO: move default value
context 70,
.themeExtension<TopBarThemeExtension>() ],
?.subTitleStyle, valueValidator: (value) => value != null,
item.style, transform: (value) => value,
], ) ?? double.infinity,
combine: (value, element) => value?.merge(element), ),
valueValidator: (value) => value != null, child: SizedBox(
transform: (value) => value, height: 50,
child: Center(
child: Text(
item.data,
style: ThemeHelper.getThemeElement<TextStyle, TextStyle>(
[
context.textTheme.titleMedium,
context
.themeExtension<TopBarThemeExtension>()
?.subTitleStyle,
item.style,
],
combine: (value, element) => value?.merge(element),
valueValidator: (value) => value != null,
transform: (value) => value,
),
), ),
), ),
), ),

View File

@ -25,6 +25,8 @@ abstract class TopBarThemeExtension
this.secondaryColor, this.secondaryColor,
this.titleStyle, this.titleStyle,
this.subTitleStyle, this.subTitleStyle,
this.selectedIndicatorHeight,
this.selectedIndicatorWidth,
}); });
final MultiColor? backgroundColors; final MultiColor? backgroundColors;
@ -33,4 +35,7 @@ abstract class TopBarThemeExtension
final TextStyle? titleStyle; final TextStyle? titleStyle;
final TextStyle? subTitleStyle; final TextStyle? subTitleStyle;
final double? selectedIndicatorHeight;
final double? selectedIndicatorWidth;
} }