{"id":13491372,"url":"https://github.com/fayeed/flutter_parsed_text","last_synced_at":"2026-02-20T20:38:01.670Z","repository":{"id":34954553,"uuid":"193213652","full_name":"fayeed/flutter_parsed_text","owner":"fayeed","description":"A Flutter package to parse text and make them into linkified text widget ","archived":false,"fork":false,"pushed_at":"2023-10-11T16:32:40.000Z","size":113,"stargazers_count":222,"open_issues_count":21,"forks_count":69,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-23T08:21:38.988Z","etag":null,"topics":["flutter","hastags","linkify-text","mentionsedittext","parsedtext"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_parsed_text","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fayeed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-06-22T09:02:55.000Z","updated_at":"2025-08-20T14:40:47.000Z","dependencies_parsed_at":"2024-01-05T21:04:24.524Z","dependency_job_id":null,"html_url":"https://github.com/fayeed/flutter_parsed_text","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fayeed/flutter_parsed_text","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_parsed_text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_parsed_text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_parsed_text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_parsed_text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fayeed","download_url":"https://codeload.github.com/fayeed/flutter_parsed_text/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_parsed_text/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29663476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","hastags","linkify-text","mentionsedittext","parsedtext"],"created_at":"2024-07-31T19:00:56.282Z","updated_at":"2026-02-20T20:38:01.636Z","avatar_url":"https://github.com/fayeed.png","language":"Dart","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://media.giphy.com/media/XeGBgGGTVk514aGI0D/giphy.gif\" /\u003e\n  \u003ch1 align=\"center\" style=\"font-size: 48px;\"\u003e🔗 Flutter Parsed text\u003c/h1\u003e\n  \u003ch5 align=\"center\"\u003e\nA Flutter package to parse text and extract parts using predefined types like \u003ccode\u003eurl\u003c/code\u003e, \u003ccode\u003ephone\u003c/code\u003e and \u003ccode\u003eemail\u003c/code\u003e and also supports \u003ccode\u003eRegex\u003c/code\u003e.\u003c/h5\u003e\n\u003c/p\u003e\n\n\n## Usage 💻\n\nTo use this package, add `flutter_parsed_text` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).\n\n```dart\nimport 'package:flutter_parsed_text/flutter_parsed_text.dart';\n```\n\n## Working ⚙️\n\nParsedText can receive this paramters \u0026 all the RichText parameters:\n\n`text`: Text that will be parsed and rendered.\n\n`style`: It takes a `TextStyle` object as it's property to style all the non links text objects.\n\n`parse`: Array of `MatchText` object - used for defining structure for pattern matching .\n\n```dart\nMatchText(\n  type: ParsedType.EMAIL, // predefined type can be any of this ParsedTypes\n  style: TextStyle(\n    color: Colors.red,\n    fontSize: 24,\n  ), // custom style to be applied to this matched text\n  onTap: (url) {\n    // do something here with passed url\n  }, // callback funtion when the text is tapped on\n),\n```\n\n\u003eYou can also define a custom pattern like this:\n\n```dart\nMatchText(\n  pattern: r\"\\B#+([\\w]+)\\b\", // a custom pattern to match\n  style: TextStyle(\n    color: Colors.pink,\n    fontSize: 24,\n  ), // custom style to be applied to this matched text\n  onTap: (url) async {\n  // do something here with passed url\n  }, // callback funtion when the text is tapped on\n)\n```\n\n\u003eYou can also set RegexOption for the custom regex pattern like so:\n\n```dart\nMatchText(\n  pattern: r\"\\B#+([\\w]+)\\b\", // a custom pattern to match\n  regexOptions: RegexOptions(\n    multiLine : false,\n    caseSensitive : false,\n    unicode : false,\n    dotAll : false\n  ),\n  style: TextStyle(\n    color: Colors.pink,\n    fontSize: 24,\n  ), // custom style to be applied to this matched text\n  onTap: (url) async {\n  // do something here with passed url\n  }, // callback funtion when the text is tapped on\n)\n```\n\nA boolean that show a diffrent text and passes a diffrent text to the callback\n\neg: Your str is `\"Mention [@michel:5455345]\"` where `5455345` is ID of this user which will be passed as parameter to the callback funtion and `@michel` the value to display on interface. Your pattern for ID \u0026 username extraction : `/\\[(@[^:]+):([^\\]]+)\\]/i`\n\n\u003eDisplayed text will be : `Mention ^^@michel^^`\n\n```dart\nMatchText(\n  pattern: r\"\\[(@[^:]+):([^\\]]+)\\]\",\n  style: TextStyle(\n    color: Colors.green,\n    fontSize: 24,\n  ),\n  // you must return a map with two keys\n  // [display] - the text you want to show to the user\n  // [value] - the value underneath it\n  renderText: ({String str, String pattern}) {\n    Map\u003cString, String\u003e map = Map\u003cString, String\u003e();\n    RegExp customRegExp = RegExp(pattern);\n    Match match = customRegExp.firstMatch(str);\n    map['display'] = match.group(1);\n    map['value'] = match.group(2);\n    return map;\n  },\n  onTap: (url) {\n    // do something here with passed url\n  },\n),\n```\n\n## Example ✍🏻\n\nFind the complete example wiring in the [Flutter_Parsed_Text example application](https://github.com/fayeed/flutter_parsed_text/blob/master/example/lib/main.dart).\n\nA small example of the ParsedText widget.\n\n```dart\nParsedText(\n  text:\n    \"[@michael:51515151] Hello this is an example of the ParsedText, links like http://www.google.com or http://www.facebook.com are clickable and phone number 444-555-6666 can call too. But you can also do more with this package, for example Bob will change style and David too. foo@gmail.com And the magic number is 42! #react #react-native\",\n  parse: \u003cMatchText\u003e[\n    MatchText(\n      type: ParsedType.EMAIL,\n      style: TextStyle(\n        color: Colors.red,\n        fontSize: 24,\n      ),\n      onTap: (url) {\n        launch(\"mailto:\" + url);\n      },\n    ),\n  ],\n)\n```\n\n## Found this project useful? ❤️\nIf you found this project useful, then please consider giving it a ⭐️ on Github and sharing it with your friends via social media.\n\n## API details 👨🏻‍💻\n\nSee the [flutter_parsed_text.dart](https://github.com/fayeed/flutter_parsed_text/blob/master/lib/flutter_parsed_text.dart) for more API details\n\n## License ⚖️\n- [MIT](https://github.com/fayeed/dash_chat/blob/master/LICENSE)\n\n## Issues and feedback 💭\n\nIf you have any suggestion for including a feature or if something doesn't work, feel free to open a Github [issue](https://github.com/fayeed/flutter_parsed_text/issues) for us to have a discussion on it.\n","funding_links":[],"categories":["组件","Packages","Text \u0026 Rich Content [🔝](#readme)","Components","Dart"],"sub_categories":["文字和富文本","（富）文本输入","Text \u0026 Rich Content"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffayeed%2Fflutter_parsed_text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffayeed%2Fflutter_parsed_text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffayeed%2Fflutter_parsed_text/lists"}