prosapp_web_app has chat, dashboard, calendar, support, 13 providers and Fluro URL routing. Keep Dockerfile + nginx.conf from previous prosappweb. Upgrade google_fonts 6.2.1 → 8.1.0 (Dart 3.12 compat fix). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
712 B
Dart
36 lines
712 B
Dart
import 'package:prosapp_web_app/models/region_entity.dart';
|
|
|
|
class CountryEntity {
|
|
final String name;
|
|
final List<RegionEntity> regions;
|
|
|
|
const CountryEntity({
|
|
required this.name,
|
|
required this.regions,
|
|
});
|
|
|
|
Map<String, Object?> toDocument() {
|
|
return {
|
|
'name': name,
|
|
'states': regions,
|
|
};
|
|
}
|
|
|
|
static CountryEntity fromDocument(Map<String, dynamic> doc) {
|
|
return CountryEntity(
|
|
name: doc['name'] as String,
|
|
regions: (doc['states'] as List)
|
|
.map((region) => RegionEntity.fromDocument(region))
|
|
.toList(),
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return '''CountryEntity {
|
|
name: $name
|
|
regions: $regions
|
|
}''';
|
|
}
|
|
}
|