extension MapExt on Map { T? getCheck(K? key) { if (key == null || !containsKey(key)) { return null; } var value = this[key]; if (value is! T) { return null; } return value as T?; } } extension StringExt on String? { bool get isNullOrEmpty { return this == null || this!.isEmpty; } } extension ListExt on List? { bool get isNullOrEmpty { return this == null || this!.isEmpty; } } extension DateTimeExt on DateTime { String get yyyyMMddHHmmss => "$year-${month < 10 ? "$month".padLeft(2, "0") : month}-$day ${hour < 10 ? "$hour".padLeft(2, "0") : hour}:${minute < 10 ? "$minute".padLeft(2, "0") : minute}:${second < 10 ? "$second".padLeft(2, "0") : second}"; }