From 65a06f159114536fe545d8ff50908c0a6ba7bfa6 Mon Sep 17 00:00:00 2001 From: "Michael W. Aziz" Date: Wed, 26 Mar 2025 13:12:56 +0200 Subject: [PATCH] [0.1.2] --- lib/src/form/src/controller.dart | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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)) {