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

Added parameters for making the field multiline #42

Merged
merged 1 commit into from
May 29, 2023
Merged
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
19 changes: 17 additions & 2 deletions lib/presentation/language_tool_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,26 @@ class LanguageToolTextField extends StatefulWidget {
/// Mistake popup window
final MistakePopup mistakePopup;

/// The maximum number of lines to show at one time, wrapping if necessary.
final int? maxLines;

/// The minimum number of lines to occupy when the content spans fewer lines.
final int? minLines;

/// Whether this widget's height will be sized to fill its parent.
final bool expands;

/// Creates a widget that checks grammar errors.
const LanguageToolTextField({
Key? key,
required this.style,
required this.decoration,
required this.coloredController,
required this.mistakePopup,
}) : super(key: key);
this.maxLines = 1,
this.minLines,
this.expands = false,
super.key,
});

@override
State<LanguageToolTextField> createState() => _LanguageToolTextFieldState();
Expand All @@ -46,6 +58,9 @@ class _LanguageToolTextFieldState extends State<LanguageToolTextField> {
controller: widget.coloredController,
style: widget.style,
decoration: widget.decoration,
minLines: widget.minLines,
maxLines: widget.maxLines,
expands: widget.expands,
),
),
);
Expand Down