初始化

This commit is contained in:
谢宇宁
2026-09-15 15:44:13 +07:00
commit a23ba685e9
1065 changed files with 101122 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
/// 文本处理工具类
class TextUtil {
static bool isEmpty(String? text) {
return (null == text || text.isEmpty);
}
static bool isNotEmpty(String? text) {
return (null != text && text.isNotEmpty);
}
}
/// 解析后端下发的字符串数组:非数组(null/空串/对象/数字)一律给空数组,
/// 数组内的 null 丢掉,非字符串元素转字符串
List<String> parseStringList(dynamic value) {
if (value is! List) return [];
return value.where((e) => e != null).map((e) => e.toString()).toList();
}