Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nullable maxLines #57

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
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
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"program": "example/lib/main.dart",
"request": "launch",
"type": "dart"
}
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ To use this package you must first wrap your top most widget with `Portal` as th
- `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.
Expand Down
11 changes: 10 additions & 1 deletion lib/src/mention_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class FlutterMentions extends StatefulWidget {
final bool enableSuggestions;

/// {@macro flutter.widgets.editableText.maxLines}
final int maxLines;
final int? maxLines;

/// {@macro flutter.widgets.editableText.minLines}
final int? minLines;
Expand Down Expand Up @@ -385,6 +385,15 @@ class FlutterMentionsState extends State<FlutterMentions> {

controller!.addListener(inputListeners);

// when focus has been removed form textField, hide suggestions
if (widget.focusNode != null) {
if (widget.focusNode!.hasFocus == false) {
setState(() {
showSuggestions.value = false;
});
}
}

super.initState();
}

Expand Down
6 changes: 3 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -99,7 +99,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -134,7 +134,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.2.19"
typed_data:
dependency: transitive
description:
Expand Down