class OtpSendRequest { final String phone; const OtpSendRequest({required this.phone}); Map toJson() => {'phone': _normalizePhone(phone)}; } class PhoneSessionRequest { final String phone; final String token; const PhoneSessionRequest({required this.phone, required this.token}); Map toJson() => { 'phone': _normalizePhone(phone), 'token': token, }; } String _normalizePhone(String input) { var normalized = input.trim(); normalized = normalized.replaceAll(RegExp(r'[\s\-\(\)]'), ''); if (normalized.startsWith('00') && normalized.length > 2) { return '+${normalized.substring(2)}'; } return normalized; }