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

@@ -49,7 +49,7 @@ void main() {
expect(find.byType(SizedBox), findsOneWidget);
expect(find.text('DEL'), findsOneWidget);
expect(find.text('GET'), findsNothing);
Color colDelDarkMode = getDarkModeColor(kColorHttpMethodDelete);
Color colDelDarkMode = kColorHttpMethodDelete.toDark;
final delTextWithColor = find.byWidgetPredicate(
(widget) => widget is Text && widget.style!.color == colDelDarkMode);
expect(delTextWithColor, findsOneWidget);