I have created a Flutter app and I am trying to integrate the Google Calendar API. As part of the process, I need to add a privacy policy link to the web version.
I have added the privacy policy to my website in the root directory and I can view the privacy policy by adding button via LinkTile in the side menu. However, this is not a link because when I try to view the html page it does nothing.
How do I get this to display as an html file in a browser window?
How do I get this to register with Google?
Here is the code I am using:
ListTile(
leading: const Icon(
Icons.private_connectivity,
color: Colors.blueAccent,
),
title: const Text('Privacy Policy'),
onTap: () {
if (kIsWeb) {
const PropertyWebViewScreenContainer('https://dealdiligencecentral.com/privacy_policy.html'); <<< This line does not work
} else {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const PrivacyPolicyScreen()));
}
;
},
),
If the user is on a mobile device it will display on a new screen. If the user is on the web I want it to display in a new browser window.
How do I do this so Google will recognize it as a link?
Thanks
2
Answers
you can simply use this code inside your onTap
You can try out the
[url_launcher][1]
package, which allows you to open URLs in a browser.Check out the below example.