Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _MyHomePageState extends State<MyHomePage> {
body: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
RaisedButton(
TextButton(
child: Text('Get Text'),
onPressed: () {
print(key.currentState!.controller!.markupText);
Expand Down
4 changes: 4 additions & 0 deletions lib/src/mention_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class FlutterMentions extends StatefulWidget {
this.defaultText,
this.suggestionPosition = SuggestionPosition.Bottom,
this.suggestionListHeight = 300.0,
this.suggestionListWidth,
this.onMarkupChanged,
this.onMentionAdd,
this.onSearchChanged,
Expand Down Expand Up @@ -84,6 +85,8 @@ class FlutterMentions extends StatefulWidget {
/// Defaults to `300.0`
final double suggestionListHeight;

final double? suggestionListWidth;

/// A Functioned which is triggered when ever the input changes
/// but with the markup of the selected mentions
///
Expand Down Expand Up @@ -425,6 +428,7 @@ class FlutterMentionsState extends State<FlutterMentions> {
return show && !widget.hideSuggestionList
? OptionList(
suggestionListHeight: widget.suggestionListHeight,
suggestionListWidth: widget.suggestionListWidth,
suggestionBuilder: list.suggestionBuilder,
suggestionListDecoration: widget.suggestionListDecoration,
data: list.data.where((element) {
Expand Down
4 changes: 4 additions & 0 deletions lib/src/option_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class OptionList extends StatelessWidget {
required this.data,
required this.onTap,
required this.suggestionListHeight,
this.suggestionListWidth,
this.suggestionBuilder,
this.suggestionListDecoration,
});
Expand All @@ -17,12 +18,15 @@ class OptionList extends StatelessWidget {

final double suggestionListHeight;

final double? suggestionListWidth;

final BoxDecoration? suggestionListDecoration;

@override
Widget build(BuildContext context) {
return data.isNotEmpty
? Container(
width: suggestionListWidth,
decoration:
suggestionListDecoration ?? BoxDecoration(color: Colors.white),
constraints: BoxConstraints(
Expand Down