utils/widget_utils library

Common utilities for widget state management.

Copyright (C) 2026, Software Innovation Institute, ANU.

Licensed under the GNU General Public License, Version 3 (the "License").

License: https://opensource.org/license/gpl-3-0.

Authors: Miduo

Mixins

AuthStateManagement<T extends StatefulWidget>
Mixin for managing authentication state in widgets.

Functions

addPostFrameCallback(State<StatefulWidget> state, VoidCallback callback) → void
Post-frame callback helper that checks mounted state.
executeWithLoading({required State<StatefulWidget> state, required void setLoading(bool), void setError(String?)?, required Future<void> operation()}) Future<bool>
Execute an async operation with automatic error handling and loading state.
safeSetState(State<StatefulWidget> state, VoidCallback fn) → void
Safe setState wrapper that checks mounted state.