From 0aaf3aa6df6d70f6cbe8c80721cf31629132b910 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 13 Aug 2018 09:12:26 -0700 Subject: [PATCH] Email templates --- invoiceninja_android.iml | 4 +- lib/ui/app/invoice/email_invoice_dialog.dart | 109 +++++++++++-------- pubspec.lock | 18 +-- 3 files changed, 74 insertions(+), 57 deletions(-) diff --git a/invoiceninja_android.iml b/invoiceninja_android.iml index b050030a1..f9005cc3e 100644 --- a/invoiceninja_android.iml +++ b/invoiceninja_android.iml @@ -23,5 +23,7 @@ + + - + \ No newline at end of file diff --git a/lib/ui/app/invoice/email_invoice_dialog.dart b/lib/ui/app/invoice/email_invoice_dialog.dart index eabf620d1..e7270e13d 100644 --- a/lib/ui/app/invoice/email_invoice_dialog.dart +++ b/lib/ui/app/invoice/email_invoice_dialog.dart @@ -43,67 +43,82 @@ class _EmailInvoiceViewState extends State { padding: const EdgeInsets.all(16.0), child: Row( children: [ - Expanded( - child: DropdownButtonHideUnderline( - child: DropdownButton( - value: selectedTemplate, - onChanged: (value) { - setState(() { - final localization = AppLocalization.of(context); - final company = widget.viewModel.company; - selectedTemplate = value; + DropdownButtonHideUnderline( + child: DropdownButton( + value: selectedTemplate, + onChanged: (value) { + setState(() { + final localization = AppLocalization.of(context); + final company = widget.viewModel.company; + selectedTemplate = value; - switch (value) { - //case const : - } - selectedTemplate = localization.initialEmail; - emailSubject = company.emailSubjectInvoice; - emailBody = company.emailBodyInvoice; - - }); - }, - items: [ - DropdownMenuItem( - child: Text(localization.initialEmail), - value: localization.initialEmail, - ), - DropdownMenuItem( - child: Text(localization.firstReminder), - value: localization.firstReminder, - ), - DropdownMenuItem( - child: Text(localization.secondReminder), - value: localization.secondReminder, - ), - DropdownMenuItem( - child: Text(localization.thirdReminder), - value: localization.thirdReminder, - ), - ], - ), + switch (value) { + //case const : + } + selectedTemplate = localization.initialEmail; + emailSubject = company.emailSubjectInvoice; + emailBody = company.emailBodyInvoice; + }); + }, + items: [ + DropdownMenuItem( + child: Text(localization.initialEmail), + value: localization.initialEmail, + ), + DropdownMenuItem( + child: Text(localization.firstReminder), + value: localization.firstReminder, + ), + DropdownMenuItem( + child: Text(localization.secondReminder), + value: localization.secondReminder, + ), + DropdownMenuItem( + child: Text(localization.thirdReminder), + value: localization.thirdReminder, + ), + ], ), ), + Expanded( + child: Container(), + ), SizedBox( width: 10.0, ), ElevatedButton( label: localization.send, color: Colors.orange, - onPressed: () { - - }, + onPressed: () {}, ) ], ), ), - SingleChildScrollView( - child: Container( - color: Colors.white, - child: HtmlView( - //data: widget.viewModel.company.emailBodyInvoice, - data: emailBody, + ListView( + shrinkWrap: true, + children: [ + Container( + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(13.0), + child: Text( + emailSubject, + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 16.0, + ), + ), + ), ), - ), + Container( + color: Colors.white, + child: HtmlView( + //data: widget.viewModel.company.emailBodyInvoice, + data: emailBody, + ), + ), + ], ), ], ); diff --git a/pubspec.lock b/pubspec.lock index 1a69f41db..1632b6bd8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -112,14 +112,14 @@ packages: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.3+2" code_builder: dependency: transitive description: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "3.1.2" collection: dependency: transitive description: @@ -154,7 +154,7 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.3" file: dependency: transitive description: @@ -168,7 +168,7 @@ packages: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "0.10.7" + version: "0.10.8" flutter: dependency: "direct main" description: flutter @@ -258,7 +258,7 @@ packages: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.1.2+1" html: dependency: transitive description: @@ -508,7 +508,7 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "0.8.3" + version: "0.8.3+1" source_map_stack_trace: dependency: transitive description: @@ -550,7 +550,7 @@ packages: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "0.0.14" + version: "0.0.14+1" string_scanner: dependency: transitive description: @@ -592,7 +592,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.0.3" utf: dependency: transitive description: @@ -650,5 +650,5 @@ packages: source: hosted version: "2.1.15" sdks: - dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.69.5.flutter-eab492385c" + dart: ">=2.0.0-dev.65 <=2.0.0-dev.69.5.flutter-eab492385c" flutter: ">=0.2.5 <2.0.0"