hashtagable 0.0.8

  • Readme
  • Changelog
  • Example
  • Installing
  • 82

hashtagable #

Widget and function to implement hashtag-decorated EditableText and RichText. It decorates the words start with #


Usage #

  • As EditableText

If you want to decorate input text, HashTagEditableText will help you.

      controller: _textEditingController,
      cursorColor: Theme.of(context).cursorColor,
      basicStyle: TextStyle(fontSize: 14,color:Colors.black),
      focusNode: FocusNode(),
      onChanged: (_) {},
      onSubmitted: (_) {},
      decoratedStyle: TextStyle(fontSize: 14,color:Colors.red),

decoratedStyle is the textStyle of tagged text. basicStyle is the one of untagged text

  • As RichText

If you want to decorate the text only to display, getHashTagTextSpan() will help you. All you need to do is just putting this function in RichText.

      text: getHashTagTextSpan(
          decoratedStyle: TextStyle(fontSize: 14,color:Colors.red),
          basicStyle: TextStyle(fontSize: 14,color:Colors.black),
          source: "#Hello world. Hello #world",
          onTap: (text) {

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

Decoration rules #

The rules are almost same as twitter. It doesn't decorate the tags which contain emoji or symbol. It needs space before # to decorate.

0.0.8 #

  • Fix HashTagEditableTextWithHintText by adding missing parameters

0.0.7 #

  • Implement HashTadEditableTextWithHintText

0.0.6 #

  • Fix arguments of editabletext, add method checkHashtags

0.0.5 #

  • Fix the handling of emoji

0.0.4 #

  • Fix RegExp to differentiate hashtag from source

0.0.3 #

  • Fix RegExp to differentiate hashtag from source

0.0.2 #

  • Update README.md

0.0.1 #

  • Initial release.


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

void main() {

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: <Widget>[
            text: getHashTagTextSpan(
              TextStyle(fontSize: 14, color: Colors.red),
              TextStyle(fontSize: 14, color: Colors.black),
              "#Hello world. Hello #world",
              (text) {
            decoratedStyle: TextStyle(fontSize: 14, color: Colors.black),
            basicStyle: TextStyle(fontSize: 14, color: Colors.blue),
            cursorColor: Theme.of(context).cursorColor,
            controller: TextEditingController(),
            hintText: "THIS IS HINT TEXT",
                TextStyle(fontSize: 14, color: Theme.of(context).hintColor),
            basicStyle: TextStyle(fontSize: 14, color: Colors.black),
            decoratedStyle: TextStyle(fontSize: 14, color: Colors.blue),
            cursorColor: Theme.of(context).cursorColor,

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  hashtagable: ^0.0.8

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:hashtagable/hashtagable.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [hashtagable] that is in a package requiring null.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
provider ^4.1.3 4.1.3+1
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
nested 0.0.4
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies