diff --git a/.gitignore b/.gitignore index 39991f4e6..0771487f4 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,7 @@ #.android/ #.ios/ +lib/generated_plugin_registrant.dart .flutter-plugins-dependencies .env.dart key.properties diff --git a/lib/ui/app/menu_drawer.dart b/lib/ui/app/menu_drawer.dart index 5f2b68228..2ea04d15e 100644 --- a/lib/ui/app/menu_drawer.dart +++ b/lib/ui/app/menu_drawer.dart @@ -3,6 +3,7 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; import 'package:invoiceninja_flutter/ui/app/debug/state_inspector.dart'; +import 'package:invoiceninja_flutter/ui/app/dialogs/error_dialog.dart'; import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart'; import 'package:invoiceninja_flutter/ui/app/resources/cached_image.dart'; import 'package:invoiceninja_flutter/utils/pdf.dart'; @@ -351,23 +352,24 @@ class SidebarFooter extends StatelessWidget { return StateInspector(); }), ), - if (state.lastError.isNotEmpty) + IconButton( + icon: Icon(Icons.filter), + onPressed: () => viewPdf(InvoiceEntity(), context), + ), + if (state.lastError.isNotEmpty && !kReleaseMode) IconButton( icon: Icon( Icons.warning, color: Colors.red, ), - onPressed: () => viewPdf(InvoiceEntity(), context), - /* - onPressed: () => showDialog( - context: context, - builder: (BuildContext context) { - return ErrorDialog( - state.lastError, - clearErrorOnDismiss: true, - ); - }), - */ + onPressed: () => showDialog( + context: context, + builder: (BuildContext context) { + return ErrorDialog( + state.lastError, + clearErrorOnDismiss: true, + ); + }), ), /* if (!Platform.isIOS && @@ -439,13 +441,11 @@ class SidebarFooterCollapsed extends StatelessWidget { } void _showAbout(BuildContext context) { - final localization = AppLocalization.of(context); final ThemeData themeData = Theme.of(context); final TextStyle aboutTextStyle = themeData.textTheme.body2; final TextStyle linkStyle = - themeData.textTheme.body2.copyWith(color: themeData.accentColor); - + themeData.textTheme.body2.copyWith(color: themeData.accentColor); showAboutDialog( context: context, diff --git a/lib/utils/pdf.dart b/lib/utils/pdf.dart index 807e4eaa5..9d9731833 100644 --- a/lib/utils/pdf.dart +++ b/lib/utils/pdf.dart @@ -1,18 +1,15 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:invoiceninja_flutter/data/models/invoice_model.dart'; -/* -import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:invoiceninja_flutter/ui/app/loading_indicator.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:native_pdf_renderer/native_pdf_renderer.dart'; - */ Future viewPdf(InvoiceEntity invoice, BuildContext context) async { - /* final localization = AppLocalization.of(context); if (Platform.isIOS) { if (await canLaunch(invoice.invitationBorderlessLink)) { @@ -98,11 +95,8 @@ Future viewPdf(InvoiceEntity invoice, BuildContext context) async { ), ); }); - - */ } -/* Future> renderPDF(String url) async { url = //'https://staging.invoiceninja.com/download/gj5d2udwzowatfsjibarq4eyo4k0cvpd'; // one page @@ -123,4 +117,3 @@ Future> renderPDF(String url) async { return pages; } -*/ diff --git a/pubspec.lock b/pubspec.lock index 63fd4821f..84d6ece20 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -84,7 +84,7 @@ packages: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "4.3.0" built_collection: dependency: "direct main" description: @@ -190,6 +190,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.3" + extension: + dependency: transitive + description: + name: extension + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.5" faker: dependency: "direct dev" description: @@ -204,6 +211,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.1.0" + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "7.1.0" firebase_auth: dependency: "direct main" description: @@ -217,14 +231,21 @@ packages: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.2+1" + version: "0.4.3+1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+1" fixnum: dependency: transitive description: @@ -301,6 +322,11 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" font_awesome_flutter: dependency: "direct main" description: @@ -333,14 +359,21 @@ packages: name: google_sign_in url: "https://pub.dartlang.org" source: hosted - version: "4.0.14" + version: "4.1.1" google_sign_in_platform_interface: dependency: transitive description: name: google_sign_in_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.3" + google_sign_in_web: + dependency: transitive + description: + name: google_sign_in_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.2+1" graphs: dependency: transitive description: @@ -389,14 +422,14 @@ packages: name: image_picker url: "https://pub.dartlang.org" source: hosted - version: "0.6.2+1" + version: "0.6.2+3" in_app_purchase: dependency: "direct main" description: name: in_app_purchase url: "https://pub.dartlang.org" source: hosted - version: "0.2.2+3" + version: "0.2.2+4" intl: dependency: "direct main" description: @@ -488,6 +521,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" + native_pdf_renderer: + dependency: "direct main" + description: + name: native_pdf_renderer + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.1" node_interop: dependency: transitive description: @@ -543,7 +583,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.4.5" + version: "1.5.1" pedantic: dependency: transitive description: @@ -565,6 +605,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" pool: dependency: transitive description: @@ -641,21 +688,35 @@ packages: name: share url: "https://pub.dartlang.org" source: hosted - version: "0.6.3+4" + version: "0.6.3+5" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.4+8" + version: "0.5.6" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+2" shelf: dependency: transitive description: @@ -723,7 +784,7 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "1.1.7+3" + version: "1.2.0" stack_trace: dependency: transitive description: @@ -758,7 +819,7 @@ packages: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "2.1.0+2" + version: "2.1.1" term_glyph: dependency: transitive description: @@ -814,14 +875,28 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.2.7" + version: "5.4.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+2" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.5" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+2" usage: dependency: transitive description: @@ -849,7 +924,7 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.4" vm_service_client: dependency: transitive description: @@ -877,7 +952,7 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.3.17" + version: "0.3.18+1" xml: dependency: transitive description: @@ -901,4 +976,4 @@ packages: version: "0.8.0" sdks: dart: ">=2.6.0 <3.0.0" - flutter: ">=1.10.15-pre.148 <2.0.0" + flutter: ">=1.12.13+hotfix.4 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 88a9308f4..d97124886 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,7 +40,7 @@ dependencies: flutter_json_widget: ^1.0.2 webview_flutter: ^0.3.15+1 timeago: ^2.0.22 - #native_pdf_renderer: any + native_pdf_renderer: any flutter_typeahead: ^1.7.0 #quick_actions: ^0.2.1