Refactor dark mode color blending to extension method

Moved dark mode color blending logic to a Color extension (toDark) in the design system. Updated usages in ui_utils.dart and related tests to use the new extension. Removed the old getDarkModeColor function for cleaner and more idiomatic code organization.
This commit is contained in:
Ankit Mahato
2025-08-05 21:17:39 +05:30
parent d1fe07ac8d
commit be16016d95
5 changed files with 24 additions and 30 deletions

View File

@@ -0,0 +1,9 @@
import 'package:flutter/material.dart';
import '../tokens/colors.dart';
extension ColorExtension on Color {
Color get toDark => Color.alphaBlend(
withValues(alpha: kOpacityDarkModeBlend),
kColorWhite,
);
}

View File

@@ -1 +1,2 @@
export 'color_extensions.dart';
export 'context_extensions.dart';