[0.1.2]
This commit is contained in:
@@ -38,13 +38,16 @@ class AstromicFormController extends FormController {
|
|||||||
}) : super(controllers: extraControllers) {
|
}) : super(controllers: extraControllers) {
|
||||||
// Add states and messages based on initial controller.
|
// Add states and messages based on initial controller.
|
||||||
_addInitialControllers();
|
_addInitialControllers();
|
||||||
|
|
||||||
// Listen on the error stream for values and push to the corresponding field state.
|
|
||||||
// if (errorStream != null) {
|
|
||||||
// _handleErrorStream();
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get all the available controllers with their current values
|
||||||
|
Map<String, String> get allControllers => Map<String, String>.fromEntries(<String, (String?, bool)>{
|
||||||
|
...?controllers,
|
||||||
|
...?super.controllers,
|
||||||
|
}.entries.map((MapEntry<String, (String?, bool)> entry) => MapEntry<String, String>(entry.key, value(entry.key))).toList());
|
||||||
|
|
||||||
|
bool hasKey(String id) => allControllers.containsKey(id);
|
||||||
|
|
||||||
/// Get the field state and message of a specific field using it's ID.
|
/// Get the field state and message of a specific field using it's ID.
|
||||||
(AstromicFieldState, String? message)? getState(String fieldId) {
|
(AstromicFieldState, String? message)? getState(String fieldId) {
|
||||||
if (fieldStates.containsKey(fieldId)) {
|
if (fieldStates.containsKey(fieldId)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user