how to make flutter hyperlink?

Issue

how do I create an email hyperlin in flutter?
////////////////////////////////////////////////////////////

import 'package:flutter/material.dart';


showAlertDialog(BuildContext context) {
  AlertDialog alert = const AlertDialog(
    title: Text('Contact us'),
    content: Text(
        'Please contact our team via email: **myemail@email.com**', //hyperlink
    ),
  );
  showDialog(
    context: context,
    builder: (BuildContext context){
      return alert;
    },
  );
}

Solution

Uri emailLanuch = Uri(
    scheme: 'mailto',
    path: "myemail@email.com",
  );
  showAlertDialog(BuildContext context) {

    AlertDialog alert =AlertDialog(
      title: Text('Contact us'),
      content: ,
      actions: [
        TextButton(
          onPressed: () async {
            await launch(emailLanuch.toString());
          },
          child: Text("myemail@email.com"),
        ),
      ],
    );
    showDialog(
      context: context,
      builder: (BuildContext context){
        return alert;
      },
    );
  }

Answered By – Hammad Ali

Answer Checked By – Terry (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.