mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Add progress indicators to a bunch o' stuff
This commit is contained in:
parent
dba45c7600
commit
b1b85a33f8
8 changed files with 172 additions and 96 deletions
|
|
@ -16,6 +16,11 @@ abstract class RefreshableState<T extends StatefulWidget> extends State<T> {
|
|||
// Current tab index (used for widgets which display bottom tabs)
|
||||
int tabIndex = 0;
|
||||
|
||||
// Bool indicator
|
||||
bool loading = false;
|
||||
|
||||
bool get loaded => !loading;
|
||||
|
||||
// Update current tab selection
|
||||
void onTabSelectionChanged(int index) {
|
||||
setState(() {
|
||||
|
|
@ -45,8 +50,16 @@ abstract class RefreshableState<T extends StatefulWidget> extends State<T> {
|
|||
}
|
||||
|
||||
Future<void> refresh() async {
|
||||
|
||||
setState(() {
|
||||
loading = true;
|
||||
});
|
||||
|
||||
await request(context);
|
||||
setState(() {});
|
||||
|
||||
setState(() {
|
||||
loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
// Function to construct an appbar (override if needed)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue