Province class

Represents a province.

Constructors

Province({required int code, required String name, List<District> districts = const [], List<Ward> wards = const []})
Creates a new Province instance.
Province.fromJson(Map<String, dynamic> json)
Creates a new Province instance from a JSON object. Supports both v1 (3-level) and v2 (2-level) structures.
factory

Properties

code → int
The unique code of the province.
final
districts → List<District>
The list of districts within the province. This is only available in v1 (3-level structure). For v2 (2-level structure), this will be an empty list.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
The name of the province.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
wards → List<Ward>
The list of wards directly under the province. This is only available in v2 (2-level structure). For v1 (3-level structure), this will be an empty list.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited