removeDiacritics method
Implementation
String removeDiacritics() {
// Sử dụng biểu thức chính quy để loại bỏ dấu
return replaceAll(RegExp(r'[àáạảãâầấậẩẫăằắặẳẵ]'), 'a')
.replaceAll(RegExp(r'[èéẹẻẽêềếệểễ]'), 'e')
.replaceAll(RegExp(r'[ìíịỉĩ]'), 'i')
.replaceAll(RegExp(r'[òóọỏõôồốộổỗơờớợởỡ]'), 'o')
.replaceAll(RegExp(r'[ùúụủũưừứựửữ]'), 'u')
.replaceAll(RegExp(r'[ỳýỵỷỹ]'), 'y')
.replaceAll(RegExp(r'đ'), 'd')
.replaceAll(RegExp(r'[^a-zA-Z0-9]'), ' '); // Loại bỏ ký tự đặc biệt và thay thế bằng dấu cách
}