Cretezy / linkify

Low-level link (text, URLs, emails) parsing library in Dart
https://pub.dartlang.org/packages/linkify
MIT License
62 stars 50 forks source link

Email is not recognized #5

Closed 33-Elephants closed 4 years ago

33-Elephants commented 5 years ago

It looks like email is not recognized for the following string: "test@google.com and http://google.com"

Cretezy commented 5 years ago

Can you give a full code example?

33-Elephants commented 5 years ago

Here you go:

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

class AppExperimentalWidget extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Center(
          child: Linkify(
            text     : "test@google.com and http://google.com",
            textAlign: TextAlign.left,
            linkTypes: <LinkType> [
              LinkType.url,
              LinkType.email
            ],
            onOpen: (link) => print("${link.text}")
          )
        )
      )
    );
  }

}
Cretezy commented 4 years ago

image

Sorry for being late, but this seems to work. Try to update to the latest (v3)