From ca4532a1ee9e6be771c16950bc0911cf1954860e Mon Sep 17 00:00:00 2001 From: nkloos <2020633@stud.hs-mannheim.de> Date: Tue, 20 Jun 2023 20:52:00 +0200 Subject: [PATCH] email fixed --- lib/Search/profile_company.dart | 1 - lib/Widgets/all_companies_widget.dart | 17 +++++++++-------- lib/jobs/job_details.dart | 19 +++++++++---------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lib/Search/profile_company.dart b/lib/Search/profile_company.dart index 5cba5c1..97f5383 100644 --- a/lib/Search/profile_company.dart +++ b/lib/Search/profile_company.dart @@ -42,7 +42,6 @@ class _ProfileScreenState extends State { void _sendEmail() async { { - //TODO Mail senden funktioniert noch nicht final Uri params = Uri( scheme: "mailto", path: email, diff --git a/lib/Widgets/all_companies_widget.dart b/lib/Widgets/all_companies_widget.dart index a3e5db5..f68248e 100644 --- a/lib/Widgets/all_companies_widget.dart +++ b/lib/Widgets/all_companies_widget.dart @@ -23,14 +23,15 @@ class AllWorkersWidget extends StatefulWidget { class _AllWorkersWidgetState extends State { void _mailTo() async { - var mailUrl = "mailto: ${widget.userEmail}"; - print("widget.userEmail ${widget.userEmail}"); - - if (await canLaunchUrlString(mailUrl)) { - await launchUrlString(mailUrl); - } else { - print("error"); - throw "Error Occured"; + { + final Uri params = Uri( + scheme: "mailto", + path: widget.userEmail, + query: + "subject=Hey from JobFinder", + ); + final url = params.toString(); + launchUrlString(url); } } diff --git a/lib/jobs/job_details.dart b/lib/jobs/job_details.dart index 3fd98be..1ee1529 100644 --- a/lib/jobs/job_details.dart +++ b/lib/jobs/job_details.dart @@ -102,16 +102,15 @@ class _JobDetailsScreenState extends State { } applyForJob() { - //TODO Mail senden funktioniert noch nicht - final Uri params = Uri( - scheme: "mailto", - path: emailCompany, - query: - "subject=Applying for $jobTitle&body=Hello, please attach Resume CV file", - ); - final url = params.toString(); - launchUrlString(url); - addNewApplicants(); + final Uri params = Uri( + scheme: "mailto", + path: emailCompany, + query: + "subject=Hey from JobFinder", + ); + final url = params.toString(); + launchUrlString(url); + } void addNewApplicants() async {