Href

This article shows how to create an underlined text opening url in browser similar to <a href /> tag.

Dependencies

First we need to add url_launcher package in pubspec.yaml

dependencies:
  flutter:
    sdk: flutter

  url_launcher: ^5.0.1
  // https://pub.dartlang.org/packages/url_launcher

Widget

Create a new widget called href.
The Text widget is surrounded by InkWell widget that allows us to have an action event, here onTap event.

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

Widget href(String text, Color textColor, String url) {
  return InkWell(
    child: Text(
      text,
      style: TextStyle(color: textColor, decoration: TextDecoration.underline),
    ),
    onTap: () async {
      if (await canLaunch(url)) {
        await launch(url);
      } else {
        throw 'Could not launch $url';
      }
    },
  );
}

Call widget

href('Awesome tips and tricks', Colors.white, 'http://www.leutbounpaseuth.me'),