Routes
This commit is contained in:
parent
589884db11
commit
1a459647b4
|
|
@ -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/client_screen.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/client/edit/client_edit_vm.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/client/view/client_view_vm.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/dashboard/dashboard_screen.dart';
|
||||||
import 'package:redux/redux.dart';
|
import 'package:redux/redux.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/client/client_actions.dart';
|
import 'package:invoiceninja_flutter/redux/client/client_actions.dart';
|
||||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||||
|
|
@ -68,8 +69,10 @@ Middleware<AppState> _viewClientList() {
|
||||||
next(action);
|
next(action);
|
||||||
|
|
||||||
store.dispatch(UpdateCurrentRoute(ClientScreen.route));
|
store.dispatch(UpdateCurrentRoute(ClientScreen.route));
|
||||||
|
|
||||||
Navigator.of(action.context).pushNamedAndRemoveUntil(
|
Navigator.of(action.context).pushNamedAndRemoveUntil(
|
||||||
ClientScreen.route, (Route<dynamic> route) => false);
|
ClientScreen.route, ModalRoute.withName(DashboardScreen.route));
|
||||||
|
//Navigator.of(action.context).pushNamedAndRemoveUntil(ClientScreen.route, (Route<dynamic> route) => false);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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/ui/settings/settings_screen.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.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:redux/redux.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
|
@ -46,7 +44,7 @@ class AppDrawer extends StatelessWidget {
|
||||||
|
|
||||||
final _multipleCompanies = Align(
|
final _multipleCompanies = Align(
|
||||||
alignment: FractionalOffset.bottomLeft,
|
alignment: FractionalOffset.bottomLeft,
|
||||||
child: DropdownButtonHideUnderline(
|
child: viewModel.companies.isNotEmpty ? DropdownButtonHideUnderline(
|
||||||
child: DropdownButton<String>(
|
child: DropdownButton<String>(
|
||||||
value: viewModel.selectedCompanyIndex,
|
value: viewModel.selectedCompanyIndex,
|
||||||
items: viewModel.companies
|
items: viewModel.companies
|
||||||
|
|
@ -68,7 +66,7 @@ class AppDrawer extends StatelessWidget {
|
||||||
viewModel.onCompanyChanged(context, value);
|
viewModel.onCompanyChanged(context, value);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
) : Container(),
|
||||||
);
|
);
|
||||||
|
|
||||||
final Store<AppState> store = StoreProvider.of<AppState>(context);
|
final Store<AppState> store = StoreProvider.of<AppState>(context);
|
||||||
|
|
@ -90,8 +88,11 @@ class AppDrawer extends StatelessWidget {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Image.asset('assets/images/logo.png',
|
child: viewModel.selectedCompany.logoUrl != null &&
|
||||||
width: 100.0, height: 100.0)),
|
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 &&
|
child: viewModel.selectedCompany.logoUrl != null &&
|
||||||
viewModel.selectedCompany.logoUrl.isNotEmpty
|
viewModel.selectedCompany.logoUrl.isNotEmpty
|
||||||
|
|
|
||||||
|
|
@ -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/ui/app/loading_indicator.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||||
import 'package:invoiceninja_flutter/utils/templates.dart';
|
import 'package:invoiceninja_flutter/utils/templates.dart';
|
||||||
|
import 'package:flutter_html_view/flutter_html_view.dart';
|
||||||
|
|
||||||
class InvoiceEmailView extends StatefulWidget {
|
class InvoiceEmailView extends StatefulWidget {
|
||||||
final EmailInvoiceVM viewModel;
|
final EmailInvoiceVM viewModel;
|
||||||
|
|
@ -171,14 +172,12 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
/*
|
|
||||||
Container(
|
Container(
|
||||||
//color: Colors.white,
|
//color: Colors.white,
|
||||||
child: HtmlView(
|
child: HtmlView(
|
||||||
data: emailBody,
|
data: emailBody,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
*/
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -48,37 +48,40 @@ class _DashboardViewState extends State<DashboardView>
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
final store = StoreProvider.of<AppState>(context);
|
final store = StoreProvider.of<AppState>(context);
|
||||||
|
|
||||||
return Scaffold(
|
return WillPopScope(
|
||||||
drawer: AppDrawerBuilder(),
|
onWillPop: () async => false,
|
||||||
appBar: AppBar(
|
child: Scaffold(
|
||||||
title: ListFilter(
|
drawer: AppDrawerBuilder(),
|
||||||
title: AppLocalization.of(context).dashboard,
|
appBar: AppBar(
|
||||||
onFilterChanged: (value) {
|
title: ListFilter(
|
||||||
store.dispatch(FilterCompany(value));
|
title: AppLocalization.of(context).dashboard,
|
||||||
},
|
onFilterChanged: (value) {
|
||||||
),
|
|
||||||
actions: <Widget>[
|
|
||||||
ListFilterButton(
|
|
||||||
onFilterPressed: (String value) {
|
|
||||||
store.dispatch(FilterCompany(value));
|
store.dispatch(FilterCompany(value));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
actions: <Widget>[
|
||||||
bottom: store.state.uiState.filter != null ? null : TabBar(
|
ListFilterButton(
|
||||||
controller: _controller,
|
onFilterPressed: (String value) {
|
||||||
tabs: [
|
store.dispatch(FilterCompany(value));
|
||||||
Tab(
|
},
|
||||||
text: localization.overview,
|
|
||||||
),
|
|
||||||
Tab(
|
|
||||||
text: localization.activity,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
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,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,11 +78,8 @@ class SettingsListVM {
|
||||||
new FlatButton(
|
new FlatButton(
|
||||||
child: Text(localization.ok.toUpperCase()),
|
child: Text(localization.ok.toUpperCase()),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final navigator = Navigator.of(context);
|
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||||
while (navigator.canPop()) {
|
LoginScreen.route, (Route<dynamic> route) => false);
|
||||||
navigator.pop();
|
|
||||||
}
|
|
||||||
navigator.pushNamed(LoginScreen.route);
|
|
||||||
store.dispatch(UserLogout());
|
store.dispatch(UserLogout());
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
|
|
||||||
51
pubspec.lock
51
pubspec.lock
|
|
@ -92,6 +92,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.5.5"
|
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:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -174,11 +181,32 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
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:
|
flutter_driver:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
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:
|
flutter_localizations:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|
@ -544,6 +572,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.3"
|
version: "1.0.3"
|
||||||
|
synchronized:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: synchronized
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.5.1+1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -579,6 +614,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.0+5"
|
version: "0.9.0+5"
|
||||||
|
uuid:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: uuid
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.3"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -586,6 +628,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.8"
|
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:
|
vm_service_client:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -616,4 +665,4 @@ packages:
|
||||||
version: "2.1.15"
|
version: "2.1.15"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.0.0-dev.65 <=2.0.0-dev.69.5.flutter-eab492385c"
|
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"
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ dependencies:
|
||||||
share: ^0.5.2
|
share: ^0.5.2
|
||||||
intl: ^0.15.6
|
intl: ^0.15.6
|
||||||
flutter_pdf_viewer: ^0.0.2
|
flutter_pdf_viewer: ^0.0.2
|
||||||
#flutter_html_view: ^0.5.2
|
flutter_html_view: ^0.5.2
|
||||||
google_sign_in: ^3.0.4
|
google_sign_in: ^3.0.4
|
||||||
firebase_auth: ^0.5.14
|
firebase_auth: ^0.5.14
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue