hashtagable icon indicating copy to clipboard operation
hashtagable copied to clipboard

Trim whitespace of hashtags in HashTagTextField onDetectionTyped

Open buraktabn opened this issue 3 years ago • 0 comments

This issue similar to #35.

hashtagable: 2.0.1
HashTagTextField(
  controller: state.controller,
  focusNode: state.focusNode,
  keyboardType: TextInputType.multiline,
  maxLines: null,
  decoration: InputDecoration(
    hintText: 'Add a comment',
    isCollapsed: true,
    contentPadding: EdgeInsets.symmetric(horizontal: 8, vertical: 9),
  ),
  decoratedStyle: Theme.of(context).textTheme.bodyText1.apply(color: Theme.of(context).primaryColor),
  basicStyle: Theme.of(context).textTheme.bodyText1.apply(color: Colors.black),
  decorateAtSign: true,
  onDetectionTyped: (str) {
    print(str);
  },
),

it prints:

I/flutter (19414): @ja
I/flutter (19414): @jan
I/flutter (19414): @jane
I/flutter (19414):  @j
I/flutter (19414):  @jo
I/flutter (19414):  @joh
I/flutter (19414):  @john
I/flutter (19414):  #h
I/flutter (19414):  #hi
I/flutter (19414):  #hik
I/flutter (19414):  #hiki
I/flutter (19414):  #hikin
I/flutter (19414):  #hiking

buraktabn avatar May 05 '21 19:05 buraktabn