v_chat_mention_controller

Creator: coderz1093

Last updated:

0 purchases

v_chat_mention_controller Image
v_chat_mention_controller Images

Languages

Categories

Add to Cart

Description:

v chat mention controller

use this package to detect mentions in text filed
'@'
support all language
support custom widgets
only you need to create the controller in your state


final controller = VChatTextMentionController(
debounce: 500,

///set custom style
mentionStyle: const TextStyle(
color: Colors.deepPurple,
fontWeight: FontWeight.w800,
),
);
copied to clipboard

make sure to call dispose after exit from the screen!
Listen to on search detect

@override
void initState() {
super.initState();
controller.onSearch = (str) async {
users.clear();
if (str != null) {
// print("search by $str");
_isSearchCanView = true;
if (str.isEmpty) {
users.addAll(_fakeUsersDataServer);
}
//send request
for (var element in _fakeUsersDataServer) {
if (element.startsWith(str)) {
users.add(element);
}
}
} else {
//stop request
_isSearchCanView = false;
}
setState(() {});
};
}

copied to clipboard

once you want to add new mention just call

controller.addMention(
MentionData(
id: "User id",
display: "USER NAME",
),
);
copied to clipboard

once you want to get the data as makeup text call

controller.markupText
copied to clipboard

you need to use https://pub.dev/packages/flutter_parsed_text
to parse and view the mention text see the example in the package for how to use it !

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.