Skip to content

Commit

Permalink
review names
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Oct 18, 2024
1 parent 78ffce4 commit 92ccb1f
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 80 deletions.
20 changes: 10 additions & 10 deletions packages/remix/lib/src/components/menu_item/menu_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ part 'menu_item_widget.dart';
@MixableSpec()
class MenuItemSpec extends Spec<MenuItemSpec>
with _$MenuItemSpec, Diagnosticable {
final BoxSpec container;
final FlexSpec mainFlex;
final FlexSpec textFlex;
final BoxSpec outerContainer;
final FlexSpec contentLayout;
final FlexSpec titleSubtitleLayout;
final IconSpec icon;
final TextSpec title;
final TextSpec subtitle;
Expand All @@ -28,20 +28,20 @@ class MenuItemSpec extends Spec<MenuItemSpec>
static const from = _$MenuItemSpec.from;

const MenuItemSpec({
FlexSpec? mainFlex,
FlexSpec? textFlex,
BoxSpec? outerContainer,
FlexSpec? contentLayout,
FlexSpec? titleSubtitleLayout,
IconSpec? icon,
TextSpec? title,
TextSpec? subtitle,
BoxSpec? container,
super.modifiers,
super.animated,
}) : mainFlex = mainFlex ?? const FlexSpec(),
textFlex = textFlex ?? const FlexSpec(),
}) : outerContainer = outerContainer ?? const BoxSpec(),
contentLayout = contentLayout ?? const FlexSpec(),
titleSubtitleLayout = titleSubtitleLayout ?? const FlexSpec(),
icon = icon ?? const IconSpec(),
title = title ?? const TextSpec(),
subtitle = subtitle ?? const TextSpec(),
container = container ?? const BoxSpec();
subtitle = subtitle ?? const TextSpec();

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
Expand Down
116 changes: 62 additions & 54 deletions packages/remix/lib/src/components/menu_item/menu_item.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions packages/remix/lib/src/components/menu_item/menu_item_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ class MenuItemStyle extends SpecStyle<MenuItemSpecUtility> {
Style makeStyle(SpecConfiguration<MenuItemSpecUtility> spec) {
final $ = spec.utilities;

final textFlex = $.textFlex.chain
final titleSubtitleLayout = $.titleSubtitleLayout.chain
..mainAxisAlignment.start()
..crossAxisAlignment.start()
..mainAxisSize.min()
..wrap.expanded()
..gap(4.0);

final mainFlex = $.mainFlex.chain..gap(12.0);
final contentLayout = $.contentLayout.gap(12.0);

final title = $.title.style.fontSize(14.0);

Expand All @@ -23,7 +23,7 @@ class MenuItemStyle extends SpecStyle<MenuItemSpecUtility> {
..style.color.grey.shade600()
..maxLines(2);

final container = $.container.chain
final outerContainer = $.outerContainer.chain
..padding(12)
..borderRadius(12);

Expand All @@ -37,11 +37,11 @@ class MenuItemStyle extends SpecStyle<MenuItemSpecUtility> {
);

return Style.create([
textFlex,
mainFlex,
titleSubtitleLayout,
contentLayout,
title,
subtitle,
container,
outerContainer,
icon,
spec.on.disabled(disabled),
]);
Expand Down
14 changes: 7 additions & 7 deletions packages/remix/lib/src/components/menu_item/menu_item_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class FortalezaMenuItemStyle extends MenuItemStyle {
final $ = spec.utilities;

final baseStyle = super.makeStyle(spec);
final textFlex = $.textFlex.chain..gap.$space(1);
final titleSubtitleLayout = $.titleSubtitleLayout.chain..gap.$space(1);

final mainFlex = $.mainFlex.chain..gap.$space(3);
final contentLayout = $.contentLayout.chain..gap.$space(3);
final title = $.title.chain
..style.$text(2)
..style.color.resetDirectives()
Expand All @@ -21,14 +21,14 @@ class FortalezaMenuItemStyle extends MenuItemStyle {
..style.color.resetDirectives()
..style.color.$neutral(9);

final container = $.container.chain
final outerContainer = $.outerContainer.chain
..padding.all.$space(3)
..padding.right.$space(4)
..borderRadius.all.$radius(2);

final icon = $.icon.color.$neutral(11);

final hovered = $.container.color.$accent(2);
final hovered = $.outerContainer.color.$accent(2);

final disabled = $.chain
..title.style.color.$neutral(9)
Expand All @@ -37,11 +37,11 @@ class FortalezaMenuItemStyle extends MenuItemStyle {

return Style.create([
baseStyle(),
textFlex,
mainFlex,
titleSubtitleLayout,
contentLayout,
title,
subtitle,
container,
outerContainer,
icon,
spec.on.hover(hovered),
spec.on.disabled(disabled),
Expand Down
Loading

0 comments on commit 92ccb1f

Please sign in to comment.