Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for mailto: links. #8

Merged
merged 3 commits into from
Mar 18, 2019
Merged

Conversation

PieterAelse
Copy link
Contributor

EG: "mailto:piotapps@gmail.com" will be a linked "piotapps@gmail.com".

Later TODO: support for ?subject=...&body=...

Copy link
Owner

@Cretezy Cretezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Maybe we should add a new EmailElement to reflect this, as it's possible to have custom handling for emails (should also add on EmailTap to the widget portion)?

@PieterAelse
Copy link
Contributor Author

Resolved your comments, one discussion point left (see the TODO)

Copy link
Owner

@Cretezy Cretezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome stuff! I'll test it later tonight before approving. Great work!

@@ -17,8 +20,12 @@ class Linkify extends StatelessWidget {
final TextStyle linkStyle;

/// Callback for tapping a link
final LinkCallback onOpen;
final LinkCallback onLinkOpen;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change, will require a major bump.

@@ -13,6 +13,19 @@ class LinkElement extends LinkifyElement {
}
}

/// Represents an element containing an email address
class EmailElement extends LinkifyElement {
final String emailAddress;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a case where the email address != displayed address?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not now I think.. But it will be when support for ?subject=...&body=... is added.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's still gonna be the same though, since subject, body, etc is simply gonna be properties (not shown)

description: Turns text URLs into clickable inline links in text for Flutter.
version: 1.1.1
description: Turns text URLs and Mailto links into clickable inline links in text for Flutter.
version: 1.2.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: 1.2.0
version: 2.0.0

To match the breaking change above.

We could support both onOpen and onOpenLink (and deprecate onOpen). To to you to make the decision!

@Cretezy Cretezy added the enhancement New feature or request label Mar 11, 2019
@PieterAelse
Copy link
Contributor Author

@Cretezy Will have a look later. What about the TODO mentioned at flutter_linkify.dart#87

@Cretezy
Copy link
Owner

Cretezy commented Mar 13, 2019

I'll take a look at this later tonight. Looks great thogh!

@PieterAelse
Copy link
Contributor Author

@Cretezy any updates?

@Cretezy
Copy link
Owner

Cretezy commented Mar 17, 2019

Totally forgot about this, sorry! Will check when I'm home.

@Cretezy Cretezy merged commit 3d94841 into Cretezy:master Mar 18, 2019
@Cretezy
Copy link
Owner

Cretezy commented Mar 18, 2019

Merged. Will prepare 2.0.0 release, I want to change the API a little.

Thanks again! Great work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants