Detectable text field - Flutter Text widgets with detection features

Overview

detectable_text_field

pub package License: MIT

Text widgets with detection features. You can detect hashtags, at sign, url, or anything you want. Helps you develop Twitter like app.

Refinement of hashtagable.

final

Usage

As TextField

    DetectableTextField(
      detectionRegExp: detectionRegExp(),
      detectedStyle: TextStyle(
        fontSize: 20,
        color: Colors.blue,
      ),
      basicStyle: TextStyle(
        fontSize: 20,
      ),
    )
  • detectionRegExp decides the text to detect. detectedStyle is the textStyle for detected text. basicStyle is the textStyle for not detected text.

  • Other arguments are basically same as material TextField.

As ReadOnlyText

If you want to use detection feature in the text only to display, DetectableText will help you.

    DetectableText(
      text: "#HashTag and @AtSign and https://pub.dev/packages/detectable_text_field",
      detectionRegExp: detectionRegExp(),
      detectedStyle: TextStyle(
        fontSize: 20,
        color: Colors.blue,
      ),
      basicStyle: TextStyle(
        fontSize: 20,
      ),
      onTap: (tappedText){
        print(tappedText);
      },
    )

Usage of the arguments like detectionRegExp are same as the ones in DetectableTextField.

The argument onTap(String) is called when user tapped a detected text.

You can add some actions in this callback with the tapped text.

detectionRegExp()

The widgets and methods in this package is expected to be used with RegExp.

The function detectionRegExp() returns sample regExp depending om the boolean arguments: hashtag, atSign, and url.They are all true by default.

If you do NOT want to detect atSign, you need to set the argument like this: detectionRegExp(atSign:false). It is same for other arguments.

If you see the API reference, you will see the function just returns the sample regular expressions below. You can use them directly if you want.

sample regExp hashtag atSign url
hashTagRegExp × ×
atSignRegExp × ×
urlRegExp × ×
hashTagAtSignRegExp ×
hashTagUrlRegExp ×
AtSignUrlRegExp ×
hashTagAtSignUrlRegExp
  • The detection rules are almost same as twitter.
    1. It needs space before # or @.
    2. It stops # and @ detection if there's emoji or symbol.

  • The examples currently support six languages: English, Japanese, Korean, Spanish, Arabic, and Thai.

Customize with useful functions

  • Check if there are detections
   print(isDetected("Hello #World", hashTagRegExp));
   // true

   print(isDetected("Hello World", hashTagRegExp));
   // false
  • Extract detections from text
   final List<String> detections = extractDetections("#Hello World #Flutter Dart #Thank you", hashTagRegExp);
   // ["#Hello", "#Flutter", "#Thank"]

If you have any requests or questions, please feel free to ask on github.

You might also like...

Real-time object detection in Flutter using camera and tflite plugin

Real-time object detection in Flutter using camera and tflite plugin

For details: https://medium.com/@shaqian629/real-time-object-detection-in-flutter-b31c7ff9ef96 flutter_realtime_detection Real-time object detection i

Oct 12, 2022

Face detection app built with Flutter and Firebase ML Kit

Face detection app built with Flutter and Firebase ML Kit

Flutter Face Detection Flutter Face Detection with Firebase ML Kit and CustomPainter. Read the article on Medium Made with 😍 by Akora-IngDKB. Follow

Sep 29, 2022

Flutter realtime object detection with Tensorflow Lite

Flutter realtime object detection with Tensorflow Lite

Flutter realtime object detection with Tensorflow Lite Flutter realtime object d

Dec 25, 2021

Blur image detection with Flutter and TFLite

Blur image detection with Flutter and TFLite This application allows you to detect blurry/poor quality pictures on your phone, the image selected from

Dec 7, 2022

Face Mask Detection mobile application built with Flutter and TensorFlow lite in order to detect face masks using images and live camera.

Face Mask Detection mobile application built with Flutter and TensorFlow lite in order to detect face masks using images and live camera.

Face Mask Detector App Face Mask Detection mobile application built with Flutter and TensorFlow lite in order to detect face masks using images and li

Aug 15, 2022

IoTF app is a smart farming app for IoT and AI-powered tomato plant disease detection. It is built with Flutter and uses Firebase as its backend.

Internet of Tomato Farming IoTF app is a smart farming app for IoT and AI-powered tomato plant disease detection. It is built with Flutter and uses Fi

Dec 9, 2022

soTired is an application for cognitive fatigue assessment. It includes a stand-alone Android app for fatigue detection and an additional part for data management and further analysis.

soTired is an application for cognitive fatigue assessment. It includes a stand-alone Android app for fatigue detection and an additional part for data management and further analysis.

Motivation soTired is an application for cognitive fatigue assessment. It includes a stand-alone Android app for fatigue detection and an additional p

Oct 22, 2021

Pneumonia detection android app based on deep learning API

pneumonia A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Nov 7, 2021

Color detection in images to capture presense of known objects.

Color detection in images to capture presense of known objects.

swatch Color detection in images to capture presence of known objects. Why? There is great object and face detection software out there, but sometimes

Dec 7, 2022
Owner
null
A Flutter package that provides a dropdown form field using a dropdown button inside a form field.

Dropdown form field A dropdown form field using a dropdown button inside a form field. Demo Features Can be used as regular form field. Simple to impl

Carlos Eugenio Torres 72 Jan 1, 2023
Face Mask Detection with Tensorflow(Flutter)Face Mask Detection with Tensorflow(Flutter)

Face Mask Detection with Tensorflow(Flutter) Face Mask Detection With TFlite Info An app made with flutter and tensor flow lite for face mask detectio

Mohsen Mirdar 1 May 23, 2022
Flutterbodydetection - A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmentation APIs for both static images and live camera stream.

body_detection A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmen

null 18 Dec 5, 2022
A text field that displays text on different languages based on your selection.

translatable_text_field A text field that displays text on different languages based on your selection. Its basic idea is that you place this fields i

null 0 Mar 13, 2022
🔥🚀 Flutter package to create Pin code input text field with every pixel customization possibility 🎨 with beautiful animations

Flutter PinPut From Tornike ?? ?? Flutter package to create Pin code input (OTP) text field with every pixel customization possibility ?? and beautifu

Tornike 451 Jan 2, 2023
A Flutter select form field widget. It shows a list of options in a dropdown menu.

select_form_field A Flutter select field widget. It shows a list of options in a dropdown menu. This widget extend TextField and has a similar behavio

m3uzz Soluções em TI 8 Sep 14, 2022
Flutter package for Android and iOS allow you to show a wide range of hyperlinks either in the input field or in an article view

Tagtly package help you to detect a lot of hyperlink text such as.. email, url, social media tags, hashtag and more either when user type in text field or when appear a text read only.

Mohamed Nasr 4 Jul 25, 2022
This is my way to build a Tagged Search Field that display a list with suggestions while the user type.

tagged_search_field This is my way to build a Tagged Search Field that display a list with suggestions while the user type. A regular search field at

Sherly Cabrera Sánchez 0 Nov 5, 2021
An address search field which helps to autocomplete an address by a reference

Address Search Field Widget builders to create 'address search widgets' which helps to autocomplete an address using a reference. They can be used to

Jose Luna 13 Aug 14, 2022
Text analyzer that extracts tokens from text for use in full-text search queries and indexes.

Tokenize text, compute document readbility and compare terms in Natural Language Processing. THIS PACKAGE IS PRE-RELEASE, and SUBJECT TO DAILY BREAKIN

GM Consult Pty Ltd 5 Dec 12, 2022