diff --git a/lib/src/form/src/controller.dart b/lib/src/form/src/controller.dart index cc9a205..8e54996 100644 --- a/lib/src/form/src/controller.dart +++ b/lib/src/form/src/controller.dart @@ -38,13 +38,16 @@ class AstromicFormController extends FormController { }) : super(controllers: extraControllers) { // Add states and messages based on initial controller. _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 get allControllers => Map.fromEntries({ + ...?controllers, + ...?super.controllers, + }.entries.map((MapEntry entry) => MapEntry(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. (AstromicFieldState, String? message)? getState(String fieldId) { if (fieldStates.containsKey(fieldId)) {