diff --git a/lib/Search/profile_company.dart b/lib/Search/profile_company.dart index 46c476e..3e58ad7 100644 --- a/lib/Search/profile_company.dart +++ b/lib/Search/profile_company.dart @@ -1,6 +1,8 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; import '../Widgets/bottom_nav_bar.dart'; import '../services/global_variables.dart'; @@ -39,6 +41,20 @@ class _ProfileScreenState extends State { getUserData(); } + void _sendEmail() async { + { + //TODO Mail senden funktioniert noch nicht + final Uri params = Uri( + scheme: "mailto", + path: email, + query: + "subject=Hey from JobFinder", + ); + final url = params.toString(); + launchUrlString(url); + } + } + void getUserData() async { try { setState(() { @@ -143,6 +159,11 @@ class _ProfileScreenState extends State { ), ), ), + if (!_isSameUser && email != null) + IconButton( + onPressed: _sendEmail, + icon: Icon(Icons.mail), + ), ], ), bottomNavigationBar: BottomNavigationBarForApp(indexNum: 3),