From b9d27da865c0c0b8f7c547b4097034e6ef06997f Mon Sep 17 00:00:00 2001 From: Drawner Date: Sun, 26 Nov 2023 15:49:35 -0600 Subject: [PATCH] 4.8.4 --- CHANGELOG.md | 7 ++++++- lib/state_extended.dart | 10 +++++++--- pubspec.yaml | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e165ee0..61aadcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,12 @@ +## 4.8.4 +November 26, 2023 +- Allow for additional controllers to be added in a previous initAsync() + while (cnt < controllerList.length) { + ## 4.8.3 November 26, 2023 -- Allow additional controllers to call their initState() if added in a previous initState() call +- Allow for additional controllers to call their initState() if added in a previous initState() call while (cnt < controllerList.length) { - Container() to SizedBox() in splash_screen.dart diff --git a/lib/state_extended.dart b/lib/state_extended.dart index 8965d98..e28bfd4 100644 --- a/lib/state_extended.dart +++ b/lib/state_extended.dart @@ -211,8 +211,12 @@ abstract class StateX extends State // No 'setState()' functions are allowed to fully function at this point. _setStateAllowed = false; - for (final con in controllerList) { - // + int cnt = 0; + StateXController con; + + // While loop the active list itself so to allow for additional controllers to be added in a previous initAsync() + while (cnt < controllerList.length) { + con = controllerList[cnt]; try { final init = await con.initAsync(); if (!init) { @@ -263,7 +267,7 @@ abstract class StateX extends State int cnt = 0; StateXController con; - // Loop the active list itself the so additional controllers can be added in a previous initState() + // While loop the active list itself the so additional controllers can be added in a previous initState() while (cnt < controllerList.length) { con = controllerList[cnt]; // Add this to the _StateSets Map diff --git a/pubspec.yaml b/pubspec.yaml index 18cbed0..e2a5766 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: state_extended description: This class extends the capabilities of Flutter's State class and includes a controller. -version: 4.8.3 +version: 4.8.4 homepage: https://www.andrioussolutions.com repository: https://github.com/AndriousSolutions/state_extended