VpsFormPageConfig class abstract
App-specific configuration for form engine: base URL and optional custom success/fail UI. Submit logic is fixed in the engine (POST to sub_module_data); only success and failure UI can be customized.
The app implements this and provides it via VpsFormEngineConfig. Set baseUrl (and optionally per-module URL). Override buildSuccessPage and buildFailPage only if you want custom success/fail screens.
- Implementers
Constructors
Properties
- baseUrl → String
-
Base URL used for form submission (e.g. API base; can be per-module).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialStep → int
-
Step number at which the form screen is shown (1-based). Default 2 so
"form is step 2" (e.g. step 1 = category selection before form). The
engine uses this to show the correct step indicator and computes
totalStepsdynamically from initialStep and whether shouldRunPreConfirmFlow runs (form + location + station + confirm vs form + confirm).no setter - mapsApiKey → String?
-
Google Maps API key for location picker. Return null to show placeholder
for location fields (app can register custom builder instead).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showStepIndicator → bool
-
Whether to show the step indicator on the form and default confirm page.
Default true (visible). Overridable via VpsFormEngineConfig.showStepIndicator.
no setter
- showStepNumbers → bool
-
Whether to show step numbers (1, 2, 3...) inside the circles on the form
step indicator. Default true (numbered). When false, circles are filled
or unfilled without numbers. Overridable via VpsFormEngineConfig.showStepNumbers.
no setter
Methods
-
buildConfirmPage(
BuildContext context, Map< String, dynamic> payload) → Widget? - Optional custom confirm page. Return null to use the engine default.
-
buildEnhancedNarrativeReview(
BuildContext context, {required String enhancedNarrative, required List< String> narrativeKeys}) → Widget? - Optional custom review dialog for AI-enhanced narrative. Return a widget that, when shown in showDialog, pops with VpsEnhancedNarrativeReviewResult and optional String narrative. Return null to use the default dialog.
-
buildFailPage(
BuildContext context, Map< String, dynamic> payload, Object error) → Widget? - Optional custom fail page. Return null to use the engine default.
-
buildNarrativeDialog(
BuildContext context, List< String> questions) → Widget? - Optional custom Q&A dialog for AI narrative enhancement. Return a widget that, when shown in showDialog, pops with List<Map<String, String>> (question/answer pairs) on submit, or null when cancelled/skipped. Return null to use the default dialog.
-
buildSuccessPage(
BuildContext context, Map< String, dynamic> payload, dynamic response) → Widget? - Optional custom success page. Return null to use the engine default.
-
getStations(
) → Future< List< ?StationResponseModel> > - Optional source of stations for the default station picker. When null, the package uses RegistryDataSource.getRegistryWithStationsAndOfficers and its RegistryResult.stations if available.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onFormOpen(
BuildContext context, SubModule subModule) → void - Called when the form screen is opened. Optional lifecycle hook.
-
runPreConfirmFlow(
BuildContext context, SubModule subModule, Map< String, dynamic> payload) → Future<Map< String, dynamic> ?> -
Runs the pre-confirm flow (e.g. push occurrence location screen, then
station selection, merge results into
payload). Return the enriched payload to push confirm; return null to cancel (do not push confirm). Only called when shouldRunPreConfirmFlow returns true. -
shouldRunPreConfirmFlow(
SubModule subModule, String baseUrl) → bool - Optional pre-confirm flow (e.g. OB flow: occurrence location then police station). Return true when this module should run the flow before pushing the confirm page. Default: false.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited