@@ -19,7 +19,20 @@ class EmailInvoiceView extends StatefulWidget {
19
19
}
20
20
21
21
class _EmailInvoiceViewState extends State <EmailInvoiceView > {
22
- String selectedTemplate = 'First Reminder' ;
22
+ String selectedTemplate;
23
+ String emailSubject;
24
+ String emailBody;
25
+
26
+ @override
27
+ void didChangeDependencies () {
28
+ super .didChangeDependencies ();
29
+ final localization = AppLocalization .of (context);
30
+ final company = widget.viewModel.company;
31
+
32
+ selectedTemplate = localization.initialEmail;
33
+ emailSubject = company.emailSubjectInvoice;
34
+ emailBody = company.emailBodyInvoice;
35
+ }
23
36
24
37
Widget _buildSend (BuildContext context) {
25
38
final localization = AppLocalization .of (context);
@@ -36,7 +49,17 @@ class _EmailInvoiceViewState extends State<EmailInvoiceView> {
36
49
value: selectedTemplate,
37
50
onChanged: (value) {
38
51
setState (() {
52
+ final localization = AppLocalization .of (context);
53
+ final company = widget.viewModel.company;
39
54
selectedTemplate = value;
55
+
56
+ switch (value) {
57
+ //case const :
58
+ }
59
+ selectedTemplate = localization.initialEmail;
60
+ emailSubject = company.emailSubjectInvoice;
61
+ emailBody = company.emailBodyInvoice;
62
+
40
63
});
41
64
},
42
65
items: [
@@ -77,7 +100,8 @@ class _EmailInvoiceViewState extends State<EmailInvoiceView> {
77
100
child: Container (
78
101
color: Colors .white,
79
102
child: HtmlView (
80
- data: widget.viewModel.company.emailBodyInvoice,
103
+ //data: widget.viewModel.company.emailBodyInvoice,
104
+ data: emailBody,
81
105
),
82
106
),
83
107
),
0 commit comments