From c83c1d4d77df036f95a3461c13ddc48ed12878be Mon Sep 17 00:00:00 2001 From: Ankit Mahato Date: Thu, 20 Apr 2023 22:09:58 +0530 Subject: [PATCH] New function to compute dark mode color --- lib/utils/ui_utils.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/utils/ui_utils.dart b/lib/utils/ui_utils.dart index 7879e3a9..aeaf1b1a 100644 --- a/lib/utils/ui_utils.dart +++ b/lib/utils/ui_utils.dart @@ -19,7 +19,7 @@ Color getResponseStatusCodeColor(int? statusCode, } } if (brightness == Brightness.dark) { - col = Color.alphaBlend(col.withOpacity(kOpacityDarkModeBlend), kColorWhite); + col = getDarkModeColor(col); } return col; } @@ -48,7 +48,14 @@ Color getHTTPMethodColor(HTTPVerb method, break; } if (brightness == Brightness.dark) { - col = Color.alphaBlend(col.withOpacity(kOpacityDarkModeBlend), kColorWhite); + col = getDarkModeColor(col); } return col; } + +Color getDarkModeColor(Color col) { + return Color.alphaBlend( + col.withOpacity(kOpacityDarkModeBlend), + kColorWhite, + ); +}