Skip to content

Commit

Permalink
4.21.0
Browse files Browse the repository at this point in the history
Took 23 minutes
  • Loading branch information
Drawner committed Jul 23, 2024
1 parent 2c100dd commit 5fb3284
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

## 4.21.0
July 22, 2024
- AppState.errorStateName - String getter naming last State class throwing an error

## 4.20.0
July 14, 2024
- AppState class loops through all the app's StateX objects when an event occurs.
Expand Down
7 changes: 7 additions & 0 deletions lib/state_extended.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2783,7 +2783,10 @@ abstract class AppStateX<T extends StatefulWidget> extends StateX<T>

// Call the StateX's onError() function
if (caught && state != this) {
_errorStateName = name;
state.onError(details);
} else {
_errorStateName = null;
}
}
} catch (e, stack) {
Expand Down Expand Up @@ -2812,6 +2815,10 @@ abstract class AppStateX<T extends StatefulWidget> extends StateX<T>
/// Set to avoid infinite loop if in errors in the error routine.
bool _inErrorRoutine = false;

/// The name of the State object experiencing an error
String get errorStateName => _errorStateName ?? '';
String? _errorStateName;

/// Catch and explicitly handle the error.
void catchError(
Exception? ex, {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: state_extended
description: This class extends the capabilities of Flutter's State class and includes a controller.
version: 4.20.0+1
version: 4.21.0
homepage: https://www.andrioussolutions.com
repository: https://github.com/AndriousSolutions/state_extended

Expand Down

0 comments on commit 5fb3284

Please sign in to comment.