mirror of
https://github.com/foss42/apidash.git
synced 2025-08-19 01:41:08 +08:00
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:
@ -21,7 +21,7 @@ Color getResponseStatusCodeColor(int? statusCode,
|
||||
}
|
||||
}
|
||||
if (brightness == Brightness.dark) {
|
||||
col = getDarkModeColor(col);
|
||||
col = col.toDark;
|
||||
}
|
||||
return col;
|
||||
}
|
||||
@ -38,7 +38,7 @@ Color getAPIColor(
|
||||
APIType.graphql => kColorGQL,
|
||||
};
|
||||
if (brightness == Brightness.dark) {
|
||||
col = getDarkModeColor(col);
|
||||
col = col.toDark;
|
||||
}
|
||||
return col;
|
||||
}
|
||||
@ -57,13 +57,6 @@ Color getHTTPMethodColor(HTTPVerb? method) {
|
||||
return col;
|
||||
}
|
||||
|
||||
Color getDarkModeColor(Color col) {
|
||||
return Color.alphaBlend(
|
||||
col.withValues(alpha: kOpacityDarkModeBlend),
|
||||
kColorWhite,
|
||||
);
|
||||
}
|
||||
|
||||
double? getJsonPreviewerMaxRootNodeWidth(double w) {
|
||||
if (w < 300) {
|
||||
return 150;
|
||||
|
Reference in New Issue
Block a user