diff --git a/lib/classes/utils.dart b/lib/classes/utils.dart index 572c09e..09fab3f 100644 --- a/lib/classes/utils.dart +++ b/lib/classes/utils.dart @@ -310,17 +310,23 @@ class Utils { } static String formatDateDefault(String date) { - if (date.toLowerCase().contains("t")) { - date = date.toLowerCase().split("t")[0]; - // return DateFormat('yyyy-MM-dd').format(DateFormat('dd-MM-yyyy').parseLoose(date)); - return DateFormat('dd-MM-yyyy').format(DateFormat('yyyy-MM-dd').parseLoose(date)); - } else { - if(date.toLowerCase().split("-")[1].length == 3) { - return DateFormat('dd-MM-yyyy').format(DateFormat('dd-MMM-yyyy').parseLoose(date)); + if (date.isNotEmpty) { + if (date.toLowerCase().contains("t")) { + date = date.toLowerCase().split("t")[0]; + if (!date.contains("00:00:00")) { + date = date + ' 00:00:00'; + } + return date; } else { - return DateFormat('dd-MM-yyyy').format(DateFormat('yyyy-MM-dd').parseLoose(date)); + if (date.toLowerCase().split("-")[1].length == 3) { + return DateFormat('dd-MM-yyyy').format(DateFormat('dd-MMM-yyyy').parseLoose(date)); + } else { + return DateFormat('dd-MM-yyyy').format(DateFormat('yyyy-MM-dd').parseLoose(date)); + } + // return DateFormat('yyyy-MM-dd').format(DateFormat('dd-MM-yyyy').parseLoose(date)); } - // return DateFormat('yyyy-MM-dd').format(DateFormat('dd-MM-yyyy').parseLoose(date)); + } else { + return date; } } diff --git a/lib/provider/chat_provider_model.dart b/lib/provider/chat_provider_model.dart index 5f28b0b..a96080b 100644 --- a/lib/provider/chat_provider_model.dart +++ b/lib/provider/chat_provider_model.dart @@ -828,7 +828,7 @@ class ChatProviderModel with ChangeNotifier, DiagnosticableTreeMixin { void deleteData() { List exists = [], unique = []; - exists.addAll(searchedChats!); + if(searchedChats != null) exists.addAll(searchedChats!); exists.addAll(favUsersList!); Map profileMap = {}; for (ChatUser item in exists) { diff --git a/lib/ui/login/new_password_screen.dart b/lib/ui/login/new_password_screen.dart index 8bb1443..217e049 100644 --- a/lib/ui/login/new_password_screen.dart +++ b/lib/ui/login/new_password_screen.dart @@ -102,8 +102,8 @@ class _NewPasswordScreenState extends State { passwordConstraintsUI(LocaleKeys.minimum8Characters.tr(), password.text.length >= 8), 8.height, passwordConstraintsUI(LocaleKeys.doNotAddRepeatingLetters.tr(), checkRepeatedChars(password.text)), - 8.height, - passwordConstraintsUI(LocaleKeys.itShouldContainSpecialCharacter.tr(), checkRegEx(r'[!@#$%^&*(),.?":{}|<>]')), + // 8.height, + // passwordConstraintsUI(LocaleKeys.itShouldContainSpecialCharacter.tr(), checkRegEx(r'[!@#$%^&*(),.?":{}|<>]')), 8.height, passwordConstraintsUI(LocaleKeys.confirmPasswordMustMatch.tr(), password.text.isNotEmpty && password.text == confirmPassword.text), ], @@ -146,11 +146,11 @@ class _NewPasswordScreenState extends State { bool hasUppercase = password.contains(RegExp(r'[A-Z]')); bool hasDigits = password.contains(RegExp(r'[0-9]')); bool hasLowercase = password.contains(RegExp(r'[a-z]')); - bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]')); + // bool hasSpecialCharacters = password.contains(RegExp(r'[!@#$%^&*(),.?":{}|<>]')); bool hasMinLength = password.length >= minLength; bool isMatched = password == confirmPassword.text; - return hasDigits && hasUppercase && hasLowercase && hasSpecialCharacters && hasMinLength && isMatched && checkRepeatedChars(password); + return hasDigits && hasUppercase && hasLowercase && hasMinLength && isMatched && checkRepeatedChars(password); } bool checkRepeatedChars(String password) {