From 523d6f1d920a2997241f9fcdaf2e23d4af7b5f61 Mon Sep 17 00:00:00 2001 From: Leo Farias Date: Tue, 23 Dec 2025 12:47:43 -0500 Subject: [PATCH 1/2] Clean up dead code and tests --- packages/mix/lib/mix.dart | 1 - .../src/properties/painting/color_mix.dart | 203 ------------------ .../properties/painting/decoration_mix.dart | 5 +- .../mix/lib/src/variants/variant_util.dart | 18 +- .../test/src/core/prop_token_ref_test.dart | 16 +- .../mix/test/src/core/style_builder_test.dart | 9 +- .../test/src/specs/text/text_style_test.dart | 4 - .../theme/material/material_tokens_test.dart | 75 ++++++- 8 files changed, 83 insertions(+), 248 deletions(-) delete mode 100644 packages/mix/lib/src/properties/painting/color_mix.dart diff --git a/packages/mix/lib/mix.dart b/packages/mix/lib/mix.dart index b30998bac..64b22210c 100644 --- a/packages/mix/lib/mix.dart +++ b/packages/mix/lib/mix.dart @@ -88,7 +88,6 @@ export 'src/properties/painting/border_mix.dart'; export 'src/properties/painting/border_radius_mix.dart'; export 'src/properties/painting/border_radius_util.dart'; export 'src/properties/painting/border_util.dart'; -export 'src/properties/painting/color_mix.dart'; export 'src/properties/painting/color_util.dart'; export 'src/properties/painting/decoration_image_mix.dart'; export 'src/properties/painting/decoration_image_util.dart'; diff --git a/packages/mix/lib/src/properties/painting/color_mix.dart b/packages/mix/lib/src/properties/painting/color_mix.dart deleted file mode 100644 index 6ed7b71f7..000000000 --- a/packages/mix/lib/src/properties/painting/color_mix.dart +++ /dev/null @@ -1,203 +0,0 @@ -// ignore_for_file: avoid-commented-out-code - -// import 'package:flutter/widgets.dart'; - -// import '../../core/directive.dart'; -// import '../../core/internal/color_values.dart'; -// import '../../core/prop.dart'; -// import '../../core/prop_source.dart'; -// import '../../theme/tokens/mix_token.dart'; - -// /// A Mix-compatible wrapper for Color values that provides a fluent API -// /// for color transformations and token resolution. -// /// -// /// ColorProp allows you to work with colors in the Mix framework while -// /// maintaining support for tokens, directives, and merging operations. -// class ColorProp extends Prop { -// static final red = ColorProp.value(ColorValues.red); -// static final pink = ColorProp.value(ColorValues.pink); -// static final purple = ColorProp.value(ColorValues.purple); -// static final deepPurple = ColorProp.value(ColorValues.deepPurple); -// static final indigo = ColorProp.value(ColorValues.indigo); -// static final blue = ColorProp.value(ColorValues.blue); -// static final lightBlue = ColorProp.value(ColorValues.lightBlue); -// static final cyan = ColorProp.value(ColorValues.cyan); -// static final teal = ColorProp.value(ColorValues.teal); -// static final green = ColorProp.value(ColorValues.green); -// static final lightGreen = ColorProp.value(ColorValues.lightGreen); -// static final lime = ColorProp.value(ColorValues.lime); -// static final yellow = ColorProp.value(ColorValues.yellow); -// static final amber = ColorProp.value(ColorValues.amber); -// static final orange = ColorProp.value(ColorValues.orange); -// static final deepOrange = ColorProp.value(ColorValues.deepOrange); -// static final brown = ColorProp.value(ColorValues.brown); -// static final grey = ColorProp.value(ColorValues.grey); -// static final blueGrey = ColorProp.value(ColorValues.blueGrey); -// static final redAccent = ColorProp.value(ColorValues.redAccent); -// static final pinkAccent = ColorProp.value(ColorValues.pinkAccent); -// static final purpleAccent = ColorProp.value(ColorValues.purpleAccent); -// static final deepPurpleAccent = ColorProp.value(ColorValues.deepPurpleAccent); -// static final indigoAccent = ColorProp.value(ColorValues.indigoAccent); -// static final blueAccent = ColorProp.value(ColorValues.blueAccent); -// static final lightBlueAccent = ColorProp.value(ColorValues.lightBlueAccent); -// static final cyanAccent = ColorProp.value(ColorValues.cyanAccent); -// static final tealAccent = ColorProp.value(ColorValues.tealAccent); -// static final greenAccent = ColorProp.value(ColorValues.greenAccent); -// static final lightGreenAccent = ColorProp.value(ColorValues.lightGreenAccent); -// static final limeAccent = ColorProp.value(ColorValues.limeAccent); -// static final yellowAccent = ColorProp.value(ColorValues.yellowAccent); -// static final amberAccent = ColorProp.value(ColorValues.amberAccent); -// static final orangeAccent = ColorProp.value(ColorValues.orangeAccent); -// static final deepOrangeAccent = ColorProp.value(ColorValues.deepOrangeAccent); -// static final transparent = ColorProp.value(ColorValues.transparent); -// static final black = ColorProp.value(ColorValues.black); -// static final white = ColorProp.value(ColorValues.white); -// static final black87 = ColorProp.value(ColorValues.black87); -// static final black54 = ColorProp.value(ColorValues.black54); -// static final black45 = ColorProp.value(ColorValues.black45); -// static final black38 = ColorProp.value(ColorValues.black38); -// static final black26 = ColorProp.value(ColorValues.black26); -// static final black12 = ColorProp.value(ColorValues.black12); -// static final white70 = ColorProp.value(ColorValues.white70); -// static final white60 = ColorProp.value(ColorValues.white60); -// static final white54 = ColorProp.value(ColorValues.white54); -// static final white38 = ColorProp.value(ColorValues.white38); -// static final white30 = ColorProp.value(ColorValues.white30); -// static final white24 = ColorProp.value(ColorValues.white24); -// static final white12 = ColorProp.value(ColorValues.white12); -// static final white10 = ColorProp.value(ColorValues.white10); - -// const ColorProp.create({super.source, super.directives, super.animation}) -// : super.internal(); - -// /// Creates a ColorMix from a color token. -// factory ColorProp.token(MixToken token) { -// return ColorProp.create(source: TokenPropSource(token)); -// } - -// /// Creates a ColorMix with a color directive applied. -// factory ColorProp.directive(Directive directive) { -// return ColorProp.create(directives: [directive]); -// } - -// factory ColorProp.value(Color color) { -// return ColorProp.create(source: ValuePropSource(color)); -// } - -// /// Creates a ColorMix with an opacity directive. -// factory ColorProp.withOpacity(double opacity) { -// return ColorProp.directive(OpacityColorDirective(opacity)); -// } - -// /// Creates a ColorMix with an alpha directive. -// factory ColorProp.withAlpha(int alpha) { -// return ColorProp.directive(AlphaColorDirective(alpha)); -// } - -// /// Creates a ColorMix with a darken directive. -// factory ColorProp.darken(int amount) { -// return ColorProp.directive(DarkenColorDirective(amount)); -// } - -// /// Creates a ColorMix with a lighten directive. -// factory ColorProp.lighten(int amount) { -// return ColorProp.directive(LightenColorDirective(amount)); -// } - -// /// Creates a ColorMix with a saturate directive. -// factory ColorProp.saturate(int amount) { -// return ColorProp.directive(SaturateColorDirective(amount)); -// } - -// /// Creates a ColorMix with a desaturate directive. -// factory ColorProp.desaturate(int amount) { -// return ColorProp.directive(DesaturateColorDirective(amount)); -// } - -// /// Creates a ColorMix with a tint directive. -// factory ColorProp.tint(int amount) { -// return ColorProp.directive(TintColorDirective(amount)); -// } - -// /// Creates a ColorMix with a shade directive. -// factory ColorProp.shade(int amount) { -// return ColorProp.directive(ShadeColorDirective(amount)); -// } - -// /// Creates a ColorMix with a withRed directive. -// factory ColorProp.withRed(int red) { -// return ColorProp.directive(WithRedColorDirective(red)); -// } - -// /// Creates a ColorMix with a withGreen directive. -// factory ColorProp.withGreen(int green) { -// return ColorProp.directive(WithGreenColorDirective(green)); -// } - -// /// Creates a ColorMix with a withBlue directive. -// factory ColorProp.withBlue(int blue) { -// return ColorProp.directive(WithBlueColorDirective(blue)); -// } - -// /// Creates a ColorMix from a nullable Color value. -// /// Returns null if the color is null, otherwise returns a ColorMix. -// static ColorProp? maybeValue(Color? color) { -// if (color == null) return null; - -// return ColorProp.value(color); -// } - -// /// Merges this ColorMix with a color directive. -// ColorProp directive(Directive directive) { -// return merge(ColorProp.directive(directive)); -// } - -// ColorProp darken(int amount) { -// return merge(ColorProp.darken(amount)); -// } - -// ColorProp lighten(int amount) { -// return merge(ColorProp.lighten(amount)); -// } - -// ColorProp saturate(int amount) { -// return merge(ColorProp.saturate(amount)); -// } - -// ColorProp desaturate(int amount) { -// return merge(ColorProp.desaturate(amount)); -// } - -// ColorProp tint(int amount) { -// return merge(ColorProp.tint(amount)); -// } - -// ColorProp shade(int amount) { -// return merge(ColorProp.shade(amount)); -// } - -// ColorProp withOpacity(double opacity) { -// return merge(ColorProp.withOpacity(opacity)); -// } - -// ColorProp withAlpha(int alpha) { -// return merge(ColorProp.withAlpha(alpha)); -// } - -// ColorProp withToken(MixToken token) { -// return merge(ColorProp.token(token)); -// } - -// @override -// ColorProp merge(ColorProp? other) { -// if (other == null) return this; - -// final merged = super.merge(other); - -// return ColorProp.create( -// source: merged.source, -// directives: merged.$directives, -// animation: merged.$animation, -// ); -// } -// } diff --git a/packages/mix/lib/src/properties/painting/decoration_mix.dart b/packages/mix/lib/src/properties/painting/decoration_mix.dart index 8313bb064..0c76efa7f 100644 --- a/packages/mix/lib/src/properties/painting/decoration_mix.dart +++ b/packages/mix/lib/src/properties/painting/decoration_mix.dart @@ -401,9 +401,8 @@ final class ShapeDecorationMix extends DecorationMix final shape = $shape; if (shape == null) return true; - // Check if it's a CircleBorderMix without eccentricity or RoundedRectangleBorderMix - // For now, we consider all CircleBorderMix as mergeable - // In the future, we might need to check eccentricity + // Only RoundedRectangleBorder shapes are mergeable right now. + // Other ShapeBorder types (e.g. CircleBorder) need dedicated merge handling. return shape is Prop; } diff --git a/packages/mix/lib/src/variants/variant_util.dart b/packages/mix/lib/src/variants/variant_util.dart index 49dfea0be..d1af15e09 100644 --- a/packages/mix/lib/src/variants/variant_util.dart +++ b/packages/mix/lib/src/variants/variant_util.dart @@ -266,22 +266,8 @@ class VariantAttributeBuilder> { return VariantStyle(variant, style); } - /// Creates a [VariantStyle] that applies the given styling elements - /// when this variant's condition is met. - /// - /// Supports both single and multiple style elements: - /// ```dart - /// // Single attribute - /// final hoverStyle = $on.hover($box.color.blue()); - /// - /// // Multiple attributes - /// final darkStyle = $on.dark( - /// $box.color.white(), - /// $text.style.color.black(), - /// ); - /// ``` - // This method has been removed as part of the MultiSpec/CompoundStyle cleanup. - // Variants should now be applied directly to specific spec types. + // Former attribute builder method removed as part of the + // MultiSpec/CompoundStyle cleanup. Apply variants directly to spec types. @override String toString() => 'VariantAttributeBuilder($variant)'; diff --git a/packages/mix/test/src/core/prop_token_ref_test.dart b/packages/mix/test/src/core/prop_token_ref_test.dart index bfdb439ff..d76b40d94 100644 --- a/packages/mix/test/src/core/prop_token_ref_test.dart +++ b/packages/mix/test/src/core/prop_token_ref_test.dart @@ -14,27 +14,27 @@ void main() { }); group('Current Behavior Tests', () { - test('ColorProp behavior - isAnyTokenRef detects it correctly', () { + test('ColorRef behavior - isAnyTokenRef detects it correctly', () { final colorToken = TestToken('test-color'); final colorRef = ColorRef(Prop.token(colorToken)); - // ColorProp should be detected as a token reference + // ColorRef should be detected as a token reference expect( isAnyTokenRef(colorRef), isTrue, - reason: 'Should detect ColorProp as token reference', + reason: 'Should detect ColorRef as token reference', ); - // ColorProp already has proper token behavior built-in + // ColorRef already has proper token behavior built-in expect( colorRef, PropMatcher.hasTokens, - reason: 'ColorProp should have token source', + reason: 'ColorRef should have token source', ); expect( colorRef, PropMatcher.isToken(colorToken), - reason: 'ColorProp should contain the original token', + reason: 'ColorRef should contain the original token', ); }); @@ -174,14 +174,14 @@ void main() { }); group('Verify detection functions work', () { - test('isAnyTokenRef detects ColorProp correctly', () { + test('isAnyTokenRef detects ColorRef correctly', () { final colorToken = TestToken('test-color'); final colorRef = ColorRef(Prop.token(colorToken)); expect( isAnyTokenRef(colorRef), isTrue, - reason: 'isAnyTokenRef should detect ColorProp', + reason: 'isAnyTokenRef should detect ColorRef', ); }); diff --git a/packages/mix/test/src/core/style_builder_test.dart b/packages/mix/test/src/core/style_builder_test.dart index 783acc520..d529626cb 100644 --- a/packages/mix/test/src/core/style_builder_test.dart +++ b/packages/mix/test/src/core/style_builder_test.dart @@ -76,7 +76,7 @@ void main() { }); testWidgets( - 'No animation driver when animation config is null', + 'Animation driver is still present when animation config is null', (tester) async { final boxAttribute = BoxStyler() .width(100) @@ -97,12 +97,9 @@ void main() { ), ); - // Verify that no animation wrapper is created - expect(find.byType(StyleAnimationBuilder), findsNothing); + // StyleSpecBuilder always wraps with StyleAnimationBuilder. + expect(find.byType(StyleAnimationBuilder), findsOneWidget); }, - skip: - // TODO: SHOULD REVIEW LATER: Skips because we are adding the animation driver everytime - true, ); testWidgets( diff --git a/packages/mix/test/src/specs/text/text_style_test.dart b/packages/mix/test/src/specs/text/text_style_test.dart index 32d5923b0..c86f6803a 100644 --- a/packages/mix/test/src/specs/text/text_style_test.dart +++ b/packages/mix/test/src/specs/text/text_style_test.dart @@ -381,10 +381,6 @@ void main() { expect(attribute.$softWrap, resolvesTo(true)); }); - test('maybeValue returns null for null spec', () { - expect(null, isNull); // TextStyling.maybeValue removed - }); - test('maybeValue returns attribute for non-null spec', () { const spec = TextSpec(overflow: TextOverflow.visible, maxLines: 1); final attribute = TextStyler( diff --git a/packages/mix/test/src/theme/material/material_tokens_test.dart b/packages/mix/test/src/theme/material/material_tokens_test.dart index 62a74ff65..0603aa770 100644 --- a/packages/mix/test/src/theme/material/material_tokens_test.dart +++ b/packages/mix/test/src/theme/material/material_tokens_test.dart @@ -63,12 +63,73 @@ void main() { ); }); - test( - 'Material 3 textStyles', - () { - // Skip: Token integration needs architectural review - tokens resolve to functions instead of TextStyle - }, - skip: 'Token integration needs architectural review', - ); + testWidgets('textStyles', (tester) async { + await tester.pumpWithMixScope(Container(), withMaterial: true); + final context = tester.element(find.byType(Container)); + final scope = MixScope.of(context); + final tokens = const MaterialTokens().textTheme; + final textTheme = Theme.of(context).textTheme; + + expect( + scope.getToken(tokens.displayLarge, context), + textTheme.displayLarge, + ); + expect( + scope.getToken(tokens.displayMedium, context), + textTheme.displayMedium, + ); + expect( + scope.getToken(tokens.displaySmall, context), + textTheme.displaySmall, + ); + expect( + scope.getToken(tokens.headlineLarge, context), + textTheme.headlineLarge, + ); + expect( + scope.getToken(tokens.headlineMedium, context), + textTheme.headlineMedium, + ); + expect( + scope.getToken(tokens.headlineSmall, context), + textTheme.headlineSmall, + ); + expect(scope.getToken(tokens.titleLarge, context), textTheme.titleLarge); + expect( + scope.getToken(tokens.titleMedium, context), + textTheme.titleMedium, + ); + expect(scope.getToken(tokens.titleSmall, context), textTheme.titleSmall); + expect(scope.getToken(tokens.bodyLarge, context), textTheme.bodyLarge); + expect(scope.getToken(tokens.bodyMedium, context), textTheme.bodyMedium); + expect(scope.getToken(tokens.bodySmall, context), textTheme.bodySmall); + expect(scope.getToken(tokens.labelLarge, context), textTheme.labelLarge); + expect(scope.getToken(tokens.labelMedium, context), textTheme.labelMedium); + expect(scope.getToken(tokens.labelSmall, context), textTheme.labelSmall); + + // Deprecated aliases + expect(scope.getToken(tokens.headline1, context), textTheme.displayLarge); + expect( + scope.getToken(tokens.headline2, context), + textTheme.displayMedium, + ); + expect(scope.getToken(tokens.headline3, context), textTheme.displaySmall); + expect( + scope.getToken(tokens.headline4, context), + textTheme.headlineMedium, + ); + expect( + scope.getToken(tokens.headline5, context), + textTheme.headlineSmall, + ); + expect(scope.getToken(tokens.headline6, context), textTheme.titleLarge); + expect(scope.getToken(tokens.subtitle1, context), textTheme.titleMedium); + expect(scope.getToken(tokens.subtitle2, context), textTheme.titleSmall); + expect(scope.getToken(tokens.bodyText1, context), textTheme.bodyLarge); + expect(scope.getToken(tokens.bodyText2, context), textTheme.bodyMedium); + expect(scope.getToken(tokens.caption, context), textTheme.bodySmall); + expect(scope.getToken(tokens.button, context), textTheme.labelLarge); + expect(scope.getToken(tokens.overline, context), textTheme.labelSmall); + }); }); } From 4175574035ddd9e090998fcfb2c5dc984b218d04 Mon Sep 17 00:00:00 2001 From: Leo Farias Date: Tue, 23 Dec 2025 16:38:25 -0500 Subject: [PATCH 2/2] chore: restore color_mix.dart and its export Keep commented color_mix.dart as reference code for future implementation. --- packages/mix/lib/mix.dart | 1 + .../src/properties/painting/color_mix.dart | 203 ++++++++++++++++++ 2 files changed, 204 insertions(+) create mode 100644 packages/mix/lib/src/properties/painting/color_mix.dart diff --git a/packages/mix/lib/mix.dart b/packages/mix/lib/mix.dart index 64b22210c..b30998bac 100644 --- a/packages/mix/lib/mix.dart +++ b/packages/mix/lib/mix.dart @@ -88,6 +88,7 @@ export 'src/properties/painting/border_mix.dart'; export 'src/properties/painting/border_radius_mix.dart'; export 'src/properties/painting/border_radius_util.dart'; export 'src/properties/painting/border_util.dart'; +export 'src/properties/painting/color_mix.dart'; export 'src/properties/painting/color_util.dart'; export 'src/properties/painting/decoration_image_mix.dart'; export 'src/properties/painting/decoration_image_util.dart'; diff --git a/packages/mix/lib/src/properties/painting/color_mix.dart b/packages/mix/lib/src/properties/painting/color_mix.dart new file mode 100644 index 000000000..6ed7b71f7 --- /dev/null +++ b/packages/mix/lib/src/properties/painting/color_mix.dart @@ -0,0 +1,203 @@ +// ignore_for_file: avoid-commented-out-code + +// import 'package:flutter/widgets.dart'; + +// import '../../core/directive.dart'; +// import '../../core/internal/color_values.dart'; +// import '../../core/prop.dart'; +// import '../../core/prop_source.dart'; +// import '../../theme/tokens/mix_token.dart'; + +// /// A Mix-compatible wrapper for Color values that provides a fluent API +// /// for color transformations and token resolution. +// /// +// /// ColorProp allows you to work with colors in the Mix framework while +// /// maintaining support for tokens, directives, and merging operations. +// class ColorProp extends Prop { +// static final red = ColorProp.value(ColorValues.red); +// static final pink = ColorProp.value(ColorValues.pink); +// static final purple = ColorProp.value(ColorValues.purple); +// static final deepPurple = ColorProp.value(ColorValues.deepPurple); +// static final indigo = ColorProp.value(ColorValues.indigo); +// static final blue = ColorProp.value(ColorValues.blue); +// static final lightBlue = ColorProp.value(ColorValues.lightBlue); +// static final cyan = ColorProp.value(ColorValues.cyan); +// static final teal = ColorProp.value(ColorValues.teal); +// static final green = ColorProp.value(ColorValues.green); +// static final lightGreen = ColorProp.value(ColorValues.lightGreen); +// static final lime = ColorProp.value(ColorValues.lime); +// static final yellow = ColorProp.value(ColorValues.yellow); +// static final amber = ColorProp.value(ColorValues.amber); +// static final orange = ColorProp.value(ColorValues.orange); +// static final deepOrange = ColorProp.value(ColorValues.deepOrange); +// static final brown = ColorProp.value(ColorValues.brown); +// static final grey = ColorProp.value(ColorValues.grey); +// static final blueGrey = ColorProp.value(ColorValues.blueGrey); +// static final redAccent = ColorProp.value(ColorValues.redAccent); +// static final pinkAccent = ColorProp.value(ColorValues.pinkAccent); +// static final purpleAccent = ColorProp.value(ColorValues.purpleAccent); +// static final deepPurpleAccent = ColorProp.value(ColorValues.deepPurpleAccent); +// static final indigoAccent = ColorProp.value(ColorValues.indigoAccent); +// static final blueAccent = ColorProp.value(ColorValues.blueAccent); +// static final lightBlueAccent = ColorProp.value(ColorValues.lightBlueAccent); +// static final cyanAccent = ColorProp.value(ColorValues.cyanAccent); +// static final tealAccent = ColorProp.value(ColorValues.tealAccent); +// static final greenAccent = ColorProp.value(ColorValues.greenAccent); +// static final lightGreenAccent = ColorProp.value(ColorValues.lightGreenAccent); +// static final limeAccent = ColorProp.value(ColorValues.limeAccent); +// static final yellowAccent = ColorProp.value(ColorValues.yellowAccent); +// static final amberAccent = ColorProp.value(ColorValues.amberAccent); +// static final orangeAccent = ColorProp.value(ColorValues.orangeAccent); +// static final deepOrangeAccent = ColorProp.value(ColorValues.deepOrangeAccent); +// static final transparent = ColorProp.value(ColorValues.transparent); +// static final black = ColorProp.value(ColorValues.black); +// static final white = ColorProp.value(ColorValues.white); +// static final black87 = ColorProp.value(ColorValues.black87); +// static final black54 = ColorProp.value(ColorValues.black54); +// static final black45 = ColorProp.value(ColorValues.black45); +// static final black38 = ColorProp.value(ColorValues.black38); +// static final black26 = ColorProp.value(ColorValues.black26); +// static final black12 = ColorProp.value(ColorValues.black12); +// static final white70 = ColorProp.value(ColorValues.white70); +// static final white60 = ColorProp.value(ColorValues.white60); +// static final white54 = ColorProp.value(ColorValues.white54); +// static final white38 = ColorProp.value(ColorValues.white38); +// static final white30 = ColorProp.value(ColorValues.white30); +// static final white24 = ColorProp.value(ColorValues.white24); +// static final white12 = ColorProp.value(ColorValues.white12); +// static final white10 = ColorProp.value(ColorValues.white10); + +// const ColorProp.create({super.source, super.directives, super.animation}) +// : super.internal(); + +// /// Creates a ColorMix from a color token. +// factory ColorProp.token(MixToken token) { +// return ColorProp.create(source: TokenPropSource(token)); +// } + +// /// Creates a ColorMix with a color directive applied. +// factory ColorProp.directive(Directive directive) { +// return ColorProp.create(directives: [directive]); +// } + +// factory ColorProp.value(Color color) { +// return ColorProp.create(source: ValuePropSource(color)); +// } + +// /// Creates a ColorMix with an opacity directive. +// factory ColorProp.withOpacity(double opacity) { +// return ColorProp.directive(OpacityColorDirective(opacity)); +// } + +// /// Creates a ColorMix with an alpha directive. +// factory ColorProp.withAlpha(int alpha) { +// return ColorProp.directive(AlphaColorDirective(alpha)); +// } + +// /// Creates a ColorMix with a darken directive. +// factory ColorProp.darken(int amount) { +// return ColorProp.directive(DarkenColorDirective(amount)); +// } + +// /// Creates a ColorMix with a lighten directive. +// factory ColorProp.lighten(int amount) { +// return ColorProp.directive(LightenColorDirective(amount)); +// } + +// /// Creates a ColorMix with a saturate directive. +// factory ColorProp.saturate(int amount) { +// return ColorProp.directive(SaturateColorDirective(amount)); +// } + +// /// Creates a ColorMix with a desaturate directive. +// factory ColorProp.desaturate(int amount) { +// return ColorProp.directive(DesaturateColorDirective(amount)); +// } + +// /// Creates a ColorMix with a tint directive. +// factory ColorProp.tint(int amount) { +// return ColorProp.directive(TintColorDirective(amount)); +// } + +// /// Creates a ColorMix with a shade directive. +// factory ColorProp.shade(int amount) { +// return ColorProp.directive(ShadeColorDirective(amount)); +// } + +// /// Creates a ColorMix with a withRed directive. +// factory ColorProp.withRed(int red) { +// return ColorProp.directive(WithRedColorDirective(red)); +// } + +// /// Creates a ColorMix with a withGreen directive. +// factory ColorProp.withGreen(int green) { +// return ColorProp.directive(WithGreenColorDirective(green)); +// } + +// /// Creates a ColorMix with a withBlue directive. +// factory ColorProp.withBlue(int blue) { +// return ColorProp.directive(WithBlueColorDirective(blue)); +// } + +// /// Creates a ColorMix from a nullable Color value. +// /// Returns null if the color is null, otherwise returns a ColorMix. +// static ColorProp? maybeValue(Color? color) { +// if (color == null) return null; + +// return ColorProp.value(color); +// } + +// /// Merges this ColorMix with a color directive. +// ColorProp directive(Directive directive) { +// return merge(ColorProp.directive(directive)); +// } + +// ColorProp darken(int amount) { +// return merge(ColorProp.darken(amount)); +// } + +// ColorProp lighten(int amount) { +// return merge(ColorProp.lighten(amount)); +// } + +// ColorProp saturate(int amount) { +// return merge(ColorProp.saturate(amount)); +// } + +// ColorProp desaturate(int amount) { +// return merge(ColorProp.desaturate(amount)); +// } + +// ColorProp tint(int amount) { +// return merge(ColorProp.tint(amount)); +// } + +// ColorProp shade(int amount) { +// return merge(ColorProp.shade(amount)); +// } + +// ColorProp withOpacity(double opacity) { +// return merge(ColorProp.withOpacity(opacity)); +// } + +// ColorProp withAlpha(int alpha) { +// return merge(ColorProp.withAlpha(alpha)); +// } + +// ColorProp withToken(MixToken token) { +// return merge(ColorProp.token(token)); +// } + +// @override +// ColorProp merge(ColorProp? other) { +// if (other == null) return this; + +// final merged = super.merge(other); + +// return ColorProp.create( +// source: merged.source, +// directives: merged.$directives, +// animation: merged.$animation, +// ); +// } +// }