Skip to content

Add option to make link native, by using Link from url_launcher. #223

@polina-c

Description

@polina-c

First of all, thank you for putting markdown widget together and maintaining it. Now, when Flutter team discontinued their markdown, markdown_widget is the best option.

I want links on my websites to be native web links, that will mean two things:

  1. The links will behave as user expect links to behave on web pages. Fir example, I can Ctrl+Click them to open in new tab, or right click (or tap and hold) and select "Copy link address"
  2. The links will be discoverable by search engine and thus indexed that is very important for search engine optimization.

This is similar issue on Flutter repo for this: flutter/flutter#151919

This is example of button that uses Link from url_launcher, that implements device's native link:

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

/// A floating action button.
class Button1 extends StatelessWidget {
  const Button1(
    this.url,
    this.label,
  );

  final Url url;
  final String label;

  @override
  Widget build(BuildContext context) {
    return Link(
      uri: url,
      builder: (context, followLink) {
        return FilledButton(
          onPressed: followLink,
          child: Text(label),
        );
      },
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions