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