Code Monkey home page Code Monkey logo

mention_input's Introduction

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

Property Description Data Type Default Value Required?
mentions List mention which each mention has its annotation and mention data List<Mention> *
controller Methods for controlling mention_input MentionInputController *

Suggestion Container Properties

Property Description Data Type Default Value Required?
suggestionContainerColor Color of Suggestion Container Color Colors.amber
suggestionContainerPadding Padding of Suggestion Container EdgeInsetsGeometry EdgeInsets.all(16)
suggestionContainerMargin Margin of Suggestion Container EdgeInsetsGeometry EdgeInsets.symmetric(vertical: 16)
suggestionContainerDecoration Decoration of Suggestion Container Decoration
suggestionAlignment Alignment of Suggestion Container relative to Input SuggestionAlignment SuggestionAlignment.top
suggestionContainerBorderRadius Border radius of Suggestion Container BorderRadius BorderRadius.circular(12)

Suggestion Item Properties

Property Description Data Type Default Value Required?
itemHeight Height of Suggestion Item double 40.0
dividerBetweenItem Should have divider between items bool true
itemBuilder Custom item builder Widget Function(int index, MentionData data)

Text Field Properties

Property Description Data Type Default Value Required?
placeHolder Place holder of Text Field String
autoFocus Auto focus of Text Field bool true
clearTextAfterSent Should clear text after sent bool true
leftInputMargin Left margin of Text Field double 8.0
rightInputMargin Right margin of Text Field double 8.0
leftWidgets Left widgets relative to Text Field List<Widget>
rightWidgets Right widgets relative to Text Field List<Widget>
shouldHideLeftWidgets Should hide left widgets bool false
shouldHideRightWidgets Should hide right widgets bool false
onChanged onChange handler of text field Function(String value)
cursorColor Cursor Color Color
keyboardType Keyboard Type TextInputType
minLines Min number of lines int
maxLines Max number of lines int
maxLength Max number of characters int
style Style of Text Field TextStyle
textAlign Text Align TextAlign
textAlignVertical Text align vertical TextAlignVertical
textCapitalization Text capitalization TextCapitalization
textDirection Text direction TextDirection

Text Field Container Properties

Property Description Data Type Default Value Required?
textFieldContainerPadding Padding of Input Container EdgeInsetsGeometry EdgeInsets.all(16)
textFieldContainerColor Color of Input Container Color Colors.white
textFieldContainerBorderRadius Border radius of Input Container BorderRadius BorderRadius.circular(16)
textFieldContainerDecoration Decoration of Input Container Decoration

Send Button Properties

Property Description Data Type Default Value Required?
onSend onSend method Function
hasSendButton Should have send button bool true
sendIcon Custom send icon widget Widget Icon(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

mention_input's People

Contributors

quangkhaidam93 avatar

Watchers

 avatar

mention_input's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.