NeshanLocationPickerUiConfig class
UI configuration for NeshanLocationPicker.
Contains builder functions for customizing the three core UI components:
- Address display widget (top of map)
- Accept button (bottom of map)
- Center marker (indicates selected location)
Pass this to NeshanLocationPicker.locationPickerUiConfig parameter. All builders are optional - if null, default implementations will be used.
Example - Custom Address Display
NeshanLocationPickerUiConfig(
addressDisplayBuilder: (context, data) {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (data.isLoading)
CircularProgressIndicator(),
if (data.formattedAddress != null)
Text(data.formattedAddress!),
if (data.fullResponse?.city != null)
Text('City: ${data.fullResponse!.city}'),
],
),
);
},
)
Example - Custom Accept Button
NeshanLocationPickerUiConfig(
acceptButtonBuilder: (context, data) {
return ElevatedButton.icon(
onPressed: data.onPressed,
icon: Icon(Icons.check),
label: Text('Confirm ${data.currentAddress ?? "Location"}'),
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(vertical: 16),
),
);
},
)
Example - Custom Marker
NeshanLocationPickerUiConfig(
centerMarkerBuilder: (context) {
return Icon(
Icons.location_pin,
size: 48,
color: Colors.red,
);
},
)
Constructors
- NeshanLocationPickerUiConfig({AddressDisplayBuilder? addressDisplayBuilder, AcceptButtonBuilder? acceptButtonBuilder, CenterMarkerBuilder? centerMarkerBuilder})
-
Creates a UI configuration for location picker.
const
Properties
- acceptButtonBuilder → AcceptButtonBuilder?
-
Optional builder for the accept button at the bottom of the map.
final
- addressDisplayBuilder → AddressDisplayBuilder?
-
Optional builder for the address display widget at the top of the map.
final
- centerMarkerBuilder → CenterMarkerBuilder?
-
Optional builder for the center marker indicating the selected location.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited