Fix loading spinners
This commit is contained in:
parent
00334fa91d
commit
afde837684
|
|
@ -278,8 +278,8 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
|
|||
@override
|
||||
String toString() {
|
||||
//return 'Settings: ${selectedCompanyState.company.settings}';
|
||||
return 'URL: ${authState.url}, ${selectedCompany.plan}';
|
||||
//return 'Is Testing: ${uiState.isTesting}';
|
||||
//return 'URL: ${authState.url}, ${selectedCompany.plan}';
|
||||
return 'Is Loading: $isLoading';
|
||||
//return 'Route: ${uiState.currentRoute}, Previous: ${uiState.previousRoute}, Layout: ${uiState.layout}, Menu: ${uiState.isMenuVisible}, History: ${uiState.isHistoryVisible}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class ClientList extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!viewModel.isLoaded) {
|
||||
return LoadingIndicator();
|
||||
return viewModel.isLoading ? LoadingIndicator() : SizedBox();
|
||||
} else if (viewModel.clientList.isEmpty) {
|
||||
return HelpText(AppLocalization.of(context).noRecordsFound);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,14 +121,18 @@ class DashboardPanels extends StatelessWidget {
|
|||
List<ChartDataGroup> currentData,
|
||||
List<ChartDataGroup> previousData,
|
||||
bool isLoaded}) {
|
||||
if (!isLoaded) {
|
||||
return LoadingIndicator(useCard: true);
|
||||
}
|
||||
|
||||
final localization = AppLocalization.of(context);
|
||||
final settings = viewModel.dashboardUIState;
|
||||
final state = viewModel.state;
|
||||
|
||||
if (!isLoaded) {
|
||||
if (state.isLoading) {
|
||||
return LoadingIndicator(useCard: true);
|
||||
} else {
|
||||
return SizedBox();
|
||||
}
|
||||
}
|
||||
|
||||
currentData.forEach((dataGroup) {
|
||||
final index = currentData.indexOf(dataGroup);
|
||||
dataGroup.chartSeries = <Series<dynamic, DateTime>>[
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class ExpenseList extends StatelessWidget {
|
|||
|
||||
widgets.add(Expanded(
|
||||
child: !viewModel.isLoaded
|
||||
? LoadingIndicator()
|
||||
? (viewModel.isLoading ? LoadingIndicator() : SizedBox())
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: viewModel.expenseList.isEmpty
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class InvoiceList extends StatelessWidget {
|
|||
: Container(),
|
||||
Expanded(
|
||||
child: !viewModel.isLoaded
|
||||
? LoadingIndicator()
|
||||
? (viewModel.isLoading ? LoadingIndicator() : SizedBox())
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: viewModel.invoiceList.isEmpty
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class PaymentList extends StatelessWidget {
|
|||
: Container(),
|
||||
Expanded(
|
||||
child: !viewModel.isLoaded
|
||||
? LoadingIndicator()
|
||||
? (viewModel.isLoading ? LoadingIndicator() : SizedBox())
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: viewModel.paymentList.isEmpty
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class ProductList extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!viewModel.isLoaded) {
|
||||
return LoadingIndicator();
|
||||
return viewModel.isLoading ? LoadingIndicator() : SizedBox();
|
||||
} else if (viewModel.productList.isEmpty) {
|
||||
return HelpText(AppLocalization.of(context).noRecordsFound);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class ProjectList extends StatelessWidget {
|
|||
: Container(),
|
||||
Expanded(
|
||||
child: !viewModel.isLoaded
|
||||
? LoadingIndicator()
|
||||
? (viewModel.isLoading ? LoadingIndicator() : SizedBox())
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: viewModel.projectList.isEmpty
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class TaskList extends StatelessWidget {
|
|||
: Container(),
|
||||
Expanded(
|
||||
child: !viewModel.isLoaded
|
||||
? LoadingIndicator()
|
||||
? (viewModel.isLoading ? LoadingIndicator() : SizedBox())
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: viewModel.taskList.isEmpty
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class VendorList extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Expanded(
|
||||
child: !viewModel.isLoaded
|
||||
? LoadingIndicator()
|
||||
? (viewModel.isLoading ? LoadingIndicator() : SizedBox())
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: viewModel.vendorList.isEmpty
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class StubList extends StatelessWidget {
|
|||
|
||||
Expanded(
|
||||
child: !viewModel.isLoaded
|
||||
? LoadingIndicator()
|
||||
? (viewModel.isLoading ? LoadingIndicator() : SizedBox())
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => viewModel.onRefreshed(context),
|
||||
child: viewModel.stubList.isEmpty
|
||||
|
|
|
|||
Loading…
Reference in New Issue