add auth register

This commit is contained in:
Phuoc Nguyen
2025-11-07 15:55:02 +07:00
parent ce7396f729
commit 9e55983d82
16 changed files with 2376 additions and 110 deletions

View File

@@ -0,0 +1,60 @@
/// Domain Entity: City
///
/// Represents a city/province for address selection.
library;
/// City Entity
class City {
/// Unique city identifier
final String name;
/// City code (e.g., "01", "02")
final String code;
/// Display name
final String cityName;
const City({
required this.name,
required this.code,
required this.cityName,
});
/// Create from JSON map
factory City.fromJson(Map<String, dynamic> json) {
return City(
name: json['name'] as String,
code: json['code'] as String,
cityName: json['city_name'] as String,
);
}
/// Convert to JSON map
Map<String, dynamic> toJson() {
return {
'name': name,
'code': code,
'city_name': cityName,
};
}
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is City &&
other.name == name &&
other.code == code &&
other.cityName == cityName;
}
@override
int get hashCode {
return Object.hash(name, code, cityName);
}
@override
String toString() {
return 'City(name: $name, code: $code, cityName: $cityName)';
}
}