Language class
Represents a language spoken in a country.
Constructors
- Language.new({required String code, required String name, required String nativeName, String? countryCode})
-
Language.fromJson(Map<
String, dynamic> json) -
Creates a Language instance from a JSON map.
factory
Properties
- code → String
-
The language code (e.g., 'pt' for Portuguese).
final
- country → Country?
-
Returns the associated Country object if countryCode is present.
no setter
- countryCode → String?
-
The country code associated with the language (e.g., 'BR' for Brazil).
This is optional and may not be present for all languages.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- name → String
-
The English name of the language (e.g., 'Portuguese').
final
- nativeName → String
-
The native name of the language (e.g., 'Português').
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts the Language instance to a JSON map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override