StatePickerUtils<T> class

A helper class for managing and interacting with a list of states or regions.

This utility provides functionality for finding states by their attributes (such as code, name, or capital) and rendering state-specific images.

T represents the type of the state object.

Constructors

StatePickerUtils({required List<T> states, required String getCode(T), required String getName(T), required String getCapital(T), required String getImagePath(T)})
Constructs a StatePickerHelper with the provided state data and helper functions.

Properties

getCapital String Function(T)
A function that retrieves the capital city for a given state object.
final
getCode String Function(T)
A function that retrieves the code for a given state object.
final
getImagePath String Function(T)
A function that retrieves the image path for a given state object.
final
getName String Function(T)
A function that retrieves the name for a given state object.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
states List<T>
The list of states or regions to manage.
final

Methods

findStateByCapital(String capital) → T
Finds a state by its capital city.
findStateByCode(String code) → T
Finds a state by its unique code.
findStateByName(String name) → T
Finds a state by its name.
getImage({required BuildContext context, required String imagePath, required double height, required double width, required BoxFit fit}) Widget
Returns a widget to display the state's image with interactive zoom functionality.
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