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
5 changes: 5 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.suggestionScrollController,
this.onMarkupChanged,
this.onMentionAdd,
this.onSearchChanged,
Expand Down Expand Up @@ -84,6 +85,9 @@ class FlutterMentions extends StatefulWidget {
/// Defaults to `300.0`
final double suggestionListHeight;

/// {@macro flutter.widgets.ListView.scrollController}
final ScrollController? suggestionScrollController;

/// A Functioned which is triggered when ever the input changes
/// but with the markup of the selected mentions
///
Expand Down Expand Up @@ -427,6 +431,7 @@ class FlutterMentionsState extends State<FlutterMentions> {
suggestionListHeight: widget.suggestionListHeight,
suggestionBuilder: list.suggestionBuilder,
suggestionListDecoration: widget.suggestionListDecoration,
suggestionScrollController: widget.suggestionScrollController,
data: list.data.where((element) {
final ele = element['display'].toLowerCase();
final str = _selectedMention!.str
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 @@ -7,6 +7,7 @@ class OptionList extends StatelessWidget {
required this.suggestionListHeight,
this.suggestionBuilder,
this.suggestionListDecoration,
this.suggestionScrollController,
});

final Widget Function(Map<String, dynamic>)? suggestionBuilder;
Expand All @@ -19,6 +20,8 @@ class OptionList extends StatelessWidget {

final BoxDecoration? suggestionListDecoration;

final ScrollController? suggestionScrollController;

@override
Widget build(BuildContext context) {
return data.isNotEmpty
Expand All @@ -30,6 +33,7 @@ class OptionList extends StatelessWidget {
minHeight: 0,
),
child: ListView.builder(
controller: suggestionScrollController,
itemCount: data.length,
shrinkWrap: true,
itemBuilder: (context, index) {
Expand Down