From 3abff4b9da73636adb0c4637617714a4c3b04332 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sun, 2 Mar 2025 12:04:13 +0800 Subject: [PATCH] opt: string ext Signed-off-by: bggRGjQaUbCoE --- lib/utils/extension.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/utils/extension.dart b/lib/utils/extension.dart index eb0def5f..f364a36d 100644 --- a/lib/utils/extension.dart +++ b/lib/utils/extension.dart @@ -55,11 +55,8 @@ extension ListExt on List? { final _regExp = RegExp("^(http:)?//", caseSensitive: false); extension StringExt on String? { - String get http2https => - this == null ? '' : this!.replaceFirst(_regExp, "https://"); -} + String get http2https => this?.replaceFirst(_regExp, "https://") ?? ''; -extension StringNullExt on String? { bool get isNullOrEmpty => this == null || this!.isEmpty; }