This commit is contained in:
Hillel Coren 2019-12-05 21:08:04 +02:00
parent 3a5db88e53
commit fe5416772c
3 changed files with 12 additions and 11 deletions

View File

@ -159,6 +159,7 @@ Future<AppState> _initialState(bool isTesting) async {
}
String currentRoute;
/*
if (kIsWeb && prefState.isDesktop) {
currentRoute = html.window.location.hash.replaceFirst('#', '');
@ -279,12 +280,7 @@ class InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
buttonColor: const Color(0xFF0D5D91),
),
title: 'Invoice Ninja',
routes: isNotMobile(context)
? {
LoginScreen.route: (context) => LoginScreen(),
MainScreen.route: (context) => MainScreen(),
}
: {
routes: {
LoginScreen.route: (context) => LoginScreen(),
DashboardScreenBuilder.route: (context) =>
DashboardScreenBuilder(),

View File

@ -261,7 +261,7 @@ Middleware<AppState> _createLoadState(
ViewMainScreen(navigator: Navigator.of(action.context)));
}
}).catchError((Object error) {
print('Refresh Data: $error');
print('Error (app_middleware): $error');
store.dispatch(UserLogout(action.context));
});
store.dispatch(RefreshData(

View File

@ -13,6 +13,7 @@ import 'package:invoiceninja_flutter/ui/dashboard/dashboard_chart.dart';
import 'package:invoiceninja_flutter/ui/dashboard/dashboard_screen_vm.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/utils/platforms.dart';
class DashboardPanels extends StatelessWidget {
const DashboardPanels({
@ -45,6 +46,8 @@ class DashboardPanels extends StatelessWidget {
currencies.insert(0, kCurrencyAll);
}
final localization = AppLocalization.of(context);
final hasMultipleCurrencies =
memoizedHasMultipleCurrencies(company, clientMap, groupMap);
return Material(
color: Theme.of(context).backgroundColor,
@ -72,7 +75,9 @@ class DashboardPanels extends StatelessWidget {
),
onTap: () => _showDateOptions(context),
),
SizedBox(width: 8.0),
isMobile(context) && !hasMultipleCurrencies
? Spacer()
: SizedBox(width: 8.0),
IconButton(
icon: Icon(Icons.navigate_before),
onPressed: () => viewModel.onOffsetChanged(1),
@ -84,11 +89,11 @@ class DashboardPanels extends StatelessWidget {
? () => viewModel.onOffsetChanged(-1)
: null,
),
SizedBox(width: 8.0),
Spacer(),
if (memoizedHasMultipleCurrencies(company, clientMap, groupMap))
if (hasMultipleCurrencies)
Row(
children: <Widget>[
SizedBox(width: 8.0),
Spacer(),
DropdownButtonHideUnderline(
child: DropdownButton<String>(
items: memoizedGetCurrencyIds(company, clientMap, groupMap)