सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Flutter Mentions एक हल्का Flutter पैकेज है जो टेक्स्ट इनपुट फील्ड में @मेंशन कार्यक्षमता जोड़ता है, जिससे उपयोगकर्ता टेक्स्ट के भीतर दूसरों को टैग कर सकते हैं। यह रियल-टाइम सुझाव का समर्थन करता है और फॉर्म या चैट इंटरफेस में बिना किसी दिक्कत के एकीकृत होता है। विजेट कस्टमाइज़ेबल है और सभी प्रमुख प्लेटफॉर्म जैसे Android, iOS, Web, macOS, Windows और Linux पर काम करता है। सोशल मीडिया ऐप्स, मैसेजिंग प्लेटफॉर्म या उपयोगकर्ता टैगिंग की आवश्यकता वाले सहयोगी उपकरणों के लिए आदर्श है।
उपयोग
सोशल मीडिया ऐप्स
संदेश इंटरफ़ेस
सहयोगात्मक सामग्री संपादन
टिप्पणियों में उपयोगकर्ता टैगिंग
रियल-टाइम चैट फीचर्स
मुख्य विशेषताएँ
@mention सुझाव ड्रॉपडाउन
प्लेटफॉर्म के अनुकूलता
कस्टमाइज़ेबल स्टाइलिंग
TextFormField के साथ आसान एकीकरण
उल्लेखों का रियल-टाइम फ़िल्टरिंग
इनके लिए उपयुक्त
चैट ऐप्स बनाने वाले डेवलपर्स
सोशल प्लेटफॉर्म बनाने वाली टीमें
उपयोगकर्ता टैगिंग की आवश्यकता वाले ऐप्स
टेक्स्ट इनपुट के लिए UI संघटक
प्लेटफॉर्म के आवश्यकताओं वाले प्रोजेक्ट
विचार योग्य बातें
उल्लेख डेटा के हैंडलिंग के लिए मैनुअल हैंडलिंग की आवश्यकता होती है
मूलभूत उल्लेख तर्क पर सीमित
निर्मित बैकएंड समर्थन नहीं है
अतिरिक्त प्रमाणीकरण की आवश्यकता हो सकती है
स्टाइल कस्टमाइजेशन में कोड समायोजन की आवश्यकता होती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
📛 Flutter Mentions
A simple flutter input widget to add @ mentions functionality to your app
You will need to add flutter_mentions to your pubspec.yaml:
dependencies:flutter:sdk:flutterflutter_mentions:
Then, run flutter packages get in your terminal.
Usage 💻
To use this package you must first wrap your top most widget with Portal as this package uses flutter_portal to show the suggestions list.
[Portal], is the equivalent of [Overlay].
This widget will need to be inserted above the widget that needs to render
under your overlays.
If you want to display your overlays on the top of everything, a good place
to insert that [Portal] is above MaterialApp:
Portal(
child: MaterialApp(
...
)
);
(works for CupertinoApp too)
This way [Portal] will render above everything. But you could place it
somewhere else to change the clip behavior.
Widgets:
FlutterMention
mentions: List<Mention> - List of Mention that the user is allowed to triggered.
suggestionPosition: SuggestionPosition - Suggestion modal position, can be alligned to [Top] or [Bottom].
onMentionAdd: Function(Map<String, dynamic>) - Triggers when the suggestion was added by tapping on suggestion.
suggestionListHeight: double - Max height for the suggestion list. Defaults for 300.0.
onMarkupChanged: Function(String) - A Functioned which is triggered when ever the input changes but with the markup of the selected mentions.
suggestionListDecoration: BoxDecoration - Decoration for the Suggestion list.
defaultText: String - Populate your input field with pre-filled text.
onSearchChange: Function(String trigger, String value) - Fired only when the input changes & user is searching a mention item.
leading: List<Widget> - List of widgets that should be placed before the input.
trailing: List<Widget> - List of widgets that should be placed after the input.
onSuggestionVisibleChanged: Function(bool) - Triggers when the suggestion list visibility changed.
Supports all the other properties that TextField supports.
Mention
trigger: String - A single character that will be used to trigger the suggestions.
data: List<Map<String, dynamic>> - List of Map to represent the suggestions shown to the user. You need to provide two Required properties id & display both are [String] You can also have any custom properties as you like to build custom suggestion widget (NOTE: this can later be updated to show new or filtered mention list).
style: TextStyle - Style for the mention item in Input.
matchAll: bool - Should every non-suggestion with the trigger character be matched.
disableMarkup: bool - Should the markup generation be disabled for this Mention Item.
suggestionBuilder: Widget Function(Map<String, dynamic>) - Build Custom suggestion widget using this builder.
markupBuilder: String Function(String trigger, String mention, String value) - Used to define how the mentions markup should be saved.
1. How do I can access to the the editing controller?
A. To get the control of TextEditingController just use a Global key more info can be found here #13. This will also allow you to access the text & markupText.
2. How do I search users as I type?
A. Just use the onSearchChange to get the currrent search text & make request to the server and later update the data.
3. What is the need of Portal?
A. You should check this comment where I mentioned in more detail the reason behind using portal.