CapitalInfo class final
A class that represents information about a country's capital.
The CapitalInfo class is a simple value object that represents information about a country's capital. It consists of a Capital object that represents the name of the capital, and a LatLng object that represents the location of the de facto capital. Both fields are required.
Example usage:
const capital = Capital("Ramallah", deJure: "Jerusalem");
const latLng = LatLng(31.9, 35.2);
const capitalInfo = CapitalInfo(capital: capital, latLng: latLng);
print(capitalInfo.capital); // Prints: Capital("Ramallah")
print(capitalInfo.latLng); // Prints: LatLng(latitude: 31.9, longitude: 35.2)
- Implemented types
- Available extensions
Constructors
- CapitalInfo({required Capital capital, required LatLng latLng})
-
Creates a new CapitalInfo object with the given capital
and location values.
const
Properties
Methods
-
copyWith(
{Capital? capital, LatLng? latLng}) → CapitalInfo -
Available on CapitalInfo, provided by the CapitalInfoExtension extension
Creates a copy of this object with the given fields replaced with the new values. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
{JsonCodec codec = const JsonCodec()}) → String -
Returns a JSON-encoded string representation of the object.
override
-
toMap(
) → JsonObjectMap -
Available on CapitalInfo, provided by the CapitalInfoExtension extension
Converts this object object to a JSON like map. -
toString(
{bool short = true}) → String -
A string representation of this object.
override
Operators
-
operator ==(
covariant CapitalInfo other) → bool -
The equality operator.
override