mention_input 0.0.13

SDKflutter
Platformandroidioswindowslinuxmacosweb

Flutter mention input widget that has several custom properties. Inspired by flutter_mentions of fayeed.

Mention Input


Summary: Flutter mention input widget that has several custom properties. Inspired by flutter_mentions of fayeed.

Note: This package also expose flutter_portal so you do not need install this package in your project -> Need wrap Portal widget in which you use mention_input.

For example:

  MaterialApp(
      title: 'Flutter Demo',
      home: Portal(
        ...
          child: MentionInput(...)
      )
    );

How to install


1. pubspec.yaml

  dependencies: 
    mention_input: ^0.0.1

2. Flutter CLI

  flutter pub add mention_input

Properties


Common Properties

PropertyDescriptionData TypeDefault ValueRequired?
mentionsList mention which each mention has its annotation and mention dataList<Mention>*
controllerMethods for controlling mention_inputMentionInputController*

Suggestion Container Properties

PropertyDescriptionData TypeDefault ValueRequired?
suggestionContainerColorColor of Suggestion ContainerColorColors.amber
suggestionContainerPaddingPadding of Suggestion ContainerEdgeInsetsGeometryEdgeInsets.all(16)
suggestionContainerMarginMargin of Suggestion ContainerEdgeInsetsGeometryEdgeInsets.symmetric(vertical: 16)
suggestionContainerDecorationDecoration of Suggestion ContainerDecoration
suggestionAlignmentAlignment of Suggestion Container relative to InputSuggestionAlignmentSuggestionAlignment.top
suggestionContainerBorderRadiusBorder radius of Suggestion ContainerBorderRadiusBorderRadius.circular(12)

Suggestion Item Properties

PropertyDescriptionData TypeDefault ValueRequired?
itemHeightHeight of Suggestion Itemdouble40.0
dividerBetweenItemShould have divider between itemsbooltrue
itemBuilderCustom item builderWidget Function(int index, MentionData data)

Text Field Properties

PropertyDescriptionData TypeDefault ValueRequired?
placeHolderPlace holder of Text FieldString
autoFocusAuto focus of Text Fieldbooltrue
clearTextAfterSentShould clear text after sentbooltrue
leftInputMarginLeft margin of Text Fielddouble8.0
rightInputMarginRight margin of Text Fielddouble8.0
leftWidgetsLeft widgets relative to Text FieldList<Widget>
rightWidgetsRight widgets relative to Text FieldList<Widget>
shouldHideLeftWidgetsShould hide left widgetsboolfalse
shouldHideRightWidgetsShould hide right widgetsboolfalse
onChangedonChange handler of text fieldFunction(String value)
cursorColorCursor ColorColor
keyboardTypeKeyboard TypeTextInputType
minLinesMin number of linesint
maxLinesMax number of linesint
maxLengthMax number of charactersint
styleStyle of Text FieldTextStyle
textAlignText AlignTextAlign
textAlignVerticalText align verticalTextAlignVertical
textCapitalizationText capitalizationTextCapitalization
textDirectionText directionTextDirection

Text Field Container Properties

PropertyDescriptionData TypeDefault ValueRequired?
textFieldContainerPaddingPadding of Input ContainerEdgeInsetsGeometryEdgeInsets.all(16)
textFieldContainerColorColor of Input ContainerColorColors.white
textFieldContainerBorderRadiusBorder radius of Input ContainerBorderRadiusBorderRadius.circular(16)
textFieldContainerDecorationDecoration of Input ContainerDecoration

Send Button Properties

PropertyDescriptionData TypeDefault ValueRequired?
onSendonSend methodFunction
hasSendButtonShould have send buttonbooltrue
sendIconCustom send icon widgetWidgetIcon(Icons.send)

Models


Mention

  String triggerAnnotation;
  List<MentionData> data;
  TextStyle? highlightStyle;

Mention Data

  String id;
  String display;
  String? imageUrl;
  Map<String, dynamic>? customData;

References


flutter_mentions: fayeed