Skip to content

Commit

Permalink
leading distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Oct 2, 2024
1 parent 21b2da9 commit 5f9e8ac
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
8 changes: 8 additions & 0 deletions packages/mix/lib/src/attributes/enum/enum_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ final class TextDirectionUtility<T extends Attribute>
const TextDirectionUtility(super.builder);
}

/// {@macro text_direction_utility}
@MixableEnumUtility()
final class TextLeadingDistributionUtility<T extends Attribute>
extends MixUtility<T, TextLeadingDistribution>
with _$TextLeadingDistributionUtility {
const TextLeadingDistributionUtility(super.builder);
}

/// {@macro tile_mode_utility}
@MixableEnumUtility()
final class TileModeUtility<T extends Attribute> extends MixUtility<T, TileMode>
Expand Down
18 changes: 18 additions & 0 deletions packages/mix/lib/src/attributes/enum/enum_util.g.dart

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

Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ final class TextHeightBehaviorUtility<T extends Attribute>
(v) => only(applyHeightToLastDescent: v),
);

late final leadingDistribution = TextLeadingDistributionUtility(
(v) => only(leadingDistribution: v),
);

TextHeightBehaviorUtility(super.builder)
: super(valueToDto: (v) => v.toDto());

T leadingDistribution(TextLeadingDistribution distribution) => builder(
TextHeightBehaviorDto(leadingDistribution: distribution),
);

@Deprecated("Use the utilities instead")
T call(TextHeightBehavior value) => builder(value.toDto());

Expand Down

0 comments on commit 5f9e8ac

Please sign in to comment.