diff --git a/lib/redux/client/client_middleware.dart b/lib/redux/client/client_middleware.dart index ae0490b99..6c1655aee 100644 --- a/lib/redux/client/client_middleware.dart +++ b/lib/redux/client/client_middleware.dart @@ -6,6 +6,7 @@ import 'package:invoiceninja_flutter/redux/ui/ui_actions.dart'; import 'package:invoiceninja_flutter/ui/client/client_screen.dart'; import 'package:invoiceninja_flutter/ui/client/edit/client_edit_vm.dart'; import 'package:invoiceninja_flutter/ui/client/view/client_view_vm.dart'; +import 'package:invoiceninja_flutter/ui/dashboard/dashboard_screen.dart'; import 'package:redux/redux.dart'; import 'package:invoiceninja_flutter/redux/client/client_actions.dart'; import 'package:invoiceninja_flutter/redux/app/app_state.dart'; @@ -68,8 +69,10 @@ Middleware _viewClientList() { next(action); store.dispatch(UpdateCurrentRoute(ClientScreen.route)); + Navigator.of(action.context).pushNamedAndRemoveUntil( - ClientScreen.route, (Route route) => false); + ClientScreen.route, ModalRoute.withName(DashboardScreen.route)); + //Navigator.of(action.context).pushNamedAndRemoveUntil(ClientScreen.route, (Route route) => false); }; } diff --git a/lib/ui/app/app_drawer.dart b/lib/ui/app/app_drawer.dart index 6fa960196..edb66d932 100644 --- a/lib/ui/app/app_drawer.dart +++ b/lib/ui/app/app_drawer.dart @@ -13,8 +13,6 @@ import 'package:invoiceninja_flutter/ui/app/app_drawer_vm.dart'; import 'package:invoiceninja_flutter/ui/settings/settings_screen.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - -//import 'package:cached_network_image/cached_network_image.dart'; import 'package:redux/redux.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -46,7 +44,7 @@ class AppDrawer extends StatelessWidget { final _multipleCompanies = Align( alignment: FractionalOffset.bottomLeft, - child: DropdownButtonHideUnderline( + child: viewModel.companies.isNotEmpty ? DropdownButtonHideUnderline( child: DropdownButton( value: viewModel.selectedCompanyIndex, items: viewModel.companies @@ -68,7 +66,7 @@ class AppDrawer extends StatelessWidget { viewModel.onCompanyChanged(context, value); }, ), - ), + ) : Container(), ); final Store store = StoreProvider.of(context); @@ -90,8 +88,11 @@ class AppDrawer extends StatelessWidget { children: [ Expanded( child: Center( - child: Image.asset('assets/images/logo.png', - width: 100.0, height: 100.0)), + child: viewModel.selectedCompany.logoUrl != null && + viewModel.selectedCompany.logoUrl.isNotEmpty + ? Image.network(viewModel.selectedCompany.logoUrl) + : Image.asset('assets/images/logo.png', + width: 100.0, height: 100.0)), /* child: viewModel.selectedCompany.logoUrl != null && viewModel.selectedCompany.logoUrl.isNotEmpty diff --git a/lib/ui/app/invoice/invoice_email_view.dart b/lib/ui/app/invoice/invoice_email_view.dart index db7458081..3dd548196 100644 --- a/lib/ui/app/invoice/invoice_email_view.dart +++ b/lib/ui/app/invoice/invoice_email_view.dart @@ -9,6 +9,7 @@ import 'package:invoiceninja_flutter/ui/app/lists/activity_list_tile.dart'; import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:invoiceninja_flutter/utils/templates.dart'; +import 'package:flutter_html_view/flutter_html_view.dart'; class InvoiceEmailView extends StatefulWidget { final EmailInvoiceVM viewModel; @@ -171,14 +172,12 @@ class _InvoiceEmailViewState extends State { ), ), ), - /* Container( //color: Colors.white, child: HtmlView( data: emailBody, ), ), - */ ], ), ), diff --git a/lib/ui/dashboard/dashboard_view.dart b/lib/ui/dashboard/dashboard_view.dart index 2f8b54c2b..dce014924 100644 --- a/lib/ui/dashboard/dashboard_view.dart +++ b/lib/ui/dashboard/dashboard_view.dart @@ -48,37 +48,40 @@ class _DashboardViewState extends State final localization = AppLocalization.of(context); final store = StoreProvider.of(context); - return Scaffold( - drawer: AppDrawerBuilder(), - appBar: AppBar( - title: ListFilter( - title: AppLocalization.of(context).dashboard, - onFilterChanged: (value) { - store.dispatch(FilterCompany(value)); - }, - ), - actions: [ - ListFilterButton( - onFilterPressed: (String value) { + return WillPopScope( + onWillPop: () async => false, + child: Scaffold( + drawer: AppDrawerBuilder(), + appBar: AppBar( + title: ListFilter( + title: AppLocalization.of(context).dashboard, + onFilterChanged: (value) { store.dispatch(FilterCompany(value)); }, ), - ], - bottom: store.state.uiState.filter != null ? null : TabBar( - controller: _controller, - tabs: [ - Tab( - text: localization.overview, - ), - Tab( - text: localization.activity, + actions: [ + ListFilterButton( + onFilterPressed: (String value) { + store.dispatch(FilterCompany(value)); + }, ), ], + bottom: store.state.uiState.filter != null ? null : TabBar( + controller: _controller, + tabs: [ + Tab( + text: localization.overview, + ), + Tab( + text: localization.activity, + ), + ], + ), + ), + body: CustomTabBarView( + viewModel: widget.viewModel, + controller: _controller, ), - ), - body: CustomTabBarView( - viewModel: widget.viewModel, - controller: _controller, ), ); } diff --git a/lib/ui/settings/settings_list_vm.dart b/lib/ui/settings/settings_list_vm.dart index cc4a53edb..6df366f31 100644 --- a/lib/ui/settings/settings_list_vm.dart +++ b/lib/ui/settings/settings_list_vm.dart @@ -78,11 +78,8 @@ class SettingsListVM { new FlatButton( child: Text(localization.ok.toUpperCase()), onPressed: () { - final navigator = Navigator.of(context); - while (navigator.canPop()) { - navigator.pop(); - } - navigator.pushNamed(LoginScreen.route); + Navigator.of(context).pushNamedAndRemoveUntil( + LoginScreen.route, (Route route) => false); store.dispatch(UserLogout()); }) ], diff --git a/pubspec.lock b/pubspec.lock index ff71e7267..afb42f30d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -92,6 +92,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.5.5" + cached_network_image: + dependency: transitive + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1+1" charcode: dependency: transitive description: @@ -174,11 +181,32 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1" + flutter_custom_tabs: + dependency: transitive + description: + name: flutter_custom_tabs + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0" flutter_driver: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_html_view: + dependency: "direct main" + description: + name: flutter_html_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.4" flutter_localizations: dependency: "direct main" description: flutter @@ -544,6 +572,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.3" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1+1" term_glyph: dependency: transitive description: @@ -579,6 +614,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.9.0+5" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.3" vector_math: dependency: transitive description: @@ -586,6 +628,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" + video_player: + dependency: transitive + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.4" vm_service_client: dependency: transitive description: @@ -616,4 +665,4 @@ packages: version: "2.1.15" sdks: dart: ">=2.0.0-dev.65 <=2.0.0-dev.69.5.flutter-eab492385c" - flutter: ">=0.1.4 <2.0.0" + flutter: ">=0.2.5 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 90a7888f6..b54eb5fbf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: share: ^0.5.2 intl: ^0.15.6 flutter_pdf_viewer: ^0.0.2 - #flutter_html_view: ^0.5.2 + flutter_html_view: ^0.5.2 google_sign_in: ^3.0.4 firebase_auth: ^0.5.14