BaseMessage class
Methods
-
addField(String fieldName, {FieldType? fieldType, dynamic initialValue, bool isRequired = false, String? description})
→ void
-
inherited
-
addFieldFormatter(String fieldName, String formatter(String))
→ void
-
inherited
-
checkInitializationConditions()
→ bool
-
Override this method in the class to provide initialization conditions
Return true if all required conditions are met
override
-
checkInitialized(String componentName)
→ bool
-
Check initialization state
Returns true if initialized, false otherwise
inherited
-
clearFields()
→ void
-
Clears all fields
inherited
-
clearTouchedState()
→ void
-
inherited
-
doAnalyticsTrackEvent(HujBaseAnalyticsServiceRouter router)
→ Future<void>
-
-
endHandleMessage()
→ void
-
-
enrichData(ExternalServicesMgr services, LocalStoreMgr localStore, PresentationMgr presentation)
→ Future<void>
-
Enriches message with data from services before processing
-
formatFieldValue(String fieldName, String value)
→ String
-
inherited
-
fromJson(Map<String, dynamic> json)
→ void
-
Populates message fields from JSON
-
getAllFields()
→ Map<String, dynamic>
-
inherited
-
getField(String fieldName)
→ dynamic
-
inherited
-
getFieldDescription(String fieldName)
→ String?
-
inherited
-
getFieldNames()
→ List<String>
-
inherited
-
getFieldType(String fieldName)
→ FieldType?
-
inherited
-
getValidationErrors()
→ Map<String, String?>
-
Returns validation errors for all fields
-
hasField(String fieldName)
→ bool
-
inherited
-
initialize()
→ bool
-
Try to initialize by checking conditions
Returns true if already initialized or successfully initialized now
inherited
-
initializeFields()
→ void
-
To be implemented by concrete messages
-
isFieldRequired(String fieldName)
→ bool
-
inherited
-
isFieldTouched(String fieldName)
→ bool
-
inherited
-
markInitialized()
→ void
-
Force mark as initialized (use with caution)
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
resetTouchedState()
→ void
-
inherited
-
setField(String fieldName, dynamic value)
→ void
-
inherited
-
setup()
→ void
-
Initializes the message and marks it initialized
-
showError(String message, Color textColor)
→ void
-
-
startHandleMessage()
→ void
-
-
toJson()
→ Map<String, dynamic>
-
Converts message fields to JSON
-
toString()
→ String
-
A string representation of this object.
inherited
-
touchField(String fieldName)
→ void
-
inherited
-
updateAppState(HujBaseApp hujBaseApp)
→ Future<void>
-
Updates App with message data
-
updateExternalServices(ExternalServicesMgr services)
→ Future<void>
-
Updates external services with message data
-
updateLocalStore(LocalStoreMgr localStore)
→ Future<void>
-
Updates local store with message data
-
updatePresentation(PresentationMgr presentation)
→ void
-
Updates presentation with message data
-
validate()
→ Map<String, String?>
-
Validates all fields and returns true if valid
-
validateFieldIfTouched(String fieldName)
→ String?
-
inherited
-
validateFields()
→ Map<String, String?>
-
inherited