RegionalBloc class
The RegionalBloc
class is an non-abstract class that represents a regional
bloc. It consists of a String
values that represents the name and acronym
of the regional bloc. The name
and acronym
fields are required and must
not be empty. The otherAcronyms
and otherNames
fields are non-required.
Example usage:
class SomeBloc extends RegionalBloc {
const SomeBloc({required super.name});
}
final bloc = SomeBloc(name: "Some Bloc", acronym: "SB");
print(bloc.name); // Prints: "Some Bloc"
Constructors
-
RegionalBloc({required String acronym, required String name, List<
String> ? otherAcronyms, List<String> ? otherNames}) -
Creates a new
RegionalBloc
object with the given name.const - RegionalBloc.fromAcronym(String acronym)
-
Creates a new
RegionalBloc
object from its acronym.factory - RegionalBloc.fromName(String name)
-
Creates a new
RegionalBloc
object from its name.factory
Properties
- acronym → String
-
The acronym of the bloc.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The name of the bloc.
finalinherited
-
otherAcronyms
→ List<
String> ? -
Other acronyms of the regional bloc.
final
-
otherNames
→ List<
String> ? -
Other names of the regional bloc.
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
-
toString(
{bool short = true}) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
maybeFromValue<
T extends Object> (T value, {T? where(RegionalBloc regionalBloc)?, Iterable< RegionalBloc> regionalBlocs = list}) → RegionalBloc? -
Creates a new
RegionalBloc
object from a value.
Constants
-
list
→ const List<
RegionalBloc> -
A list of all the regional blocs currently
supported by the
RegionalBloc
class.