Skip to content

Commit

Permalink
Add spellCheckConfiguration to DialogTextField
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 committed Feb 21, 2024
1 parent 89ba997 commit a767a95
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.0

- Add `spellCheckConfiguration` to `DialogTextField`

## 2.0.0

- Support Flutter 3.16
Expand Down
16 changes: 16 additions & 0 deletions example/lib/pages/text_input_dialog_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ class TextInputDialogPage extends ConsumerWidget {
logger.info(text);
},
),
ListTile(
title: const Text(
'No Title/Message(spellCheckConfiguration disabled)'),
onTap: () async {
final text = await showTextInputDialog(
context: context,
textFields: const [
DialogTextField(
spellCheckConfiguration: SpellCheckConfiguration.disabled(),
autocorrect: false,
),
],
);
logger.info(text);
},
),
ListTile(
title: const Text('No Message'),
onTap: () async {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.0.0"
version: "2.1.0"
analyzer:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions lib/src/text_input_dialog/ios_text_input_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class _IOSTextInputDialogState extends State<IOSTextInputDialog> {
onSubmitted: isLast && widget.autoSubmit
? (_) => submitIfValid()
: null,
spellCheckConfiguration: field.spellCheckConfiguration,
);
},
),
Expand Down
1 change: 1 addition & 0 deletions lib/src/text_input_dialog/macos_text_input_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class _MacOSTextInputDialogState extends State<MacOSTextInputDialog> {
onSubmitted: isLast && widget.autoSubmit
? (_) => submitIfValid()
: null,
// No spellCheckConfiguration for macos_ui
),
),
);
Expand Down
1 change: 1 addition & 0 deletions lib/src/text_input_dialog/material_text_input_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class _MaterialTextInputDialogState extends State<MaterialTextInputDialog> {
onFieldSubmitted: isLast && widget.autoSubmit
? (_) => submitIfValid()
: null,
spellCheckConfiguration: field.spellCheckConfiguration,
);
}),
],
Expand Down
2 changes: 2 additions & 0 deletions lib/src/text_input_dialog/show_text_input_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class DialogTextField {
this.maxLines = 1,
this.maxLength,
this.autocorrect = true,
this.spellCheckConfiguration,
});
final String? initialText;
final String? hintText;
Expand All @@ -144,4 +145,5 @@ class DialogTextField {
final int maxLines;
final int? maxLength;
final bool autocorrect;
final SpellCheckConfiguration? spellCheckConfiguration;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: adaptive_dialog
description: Show alert dialog or modal action sheet adaptively according to platform.
version: 2.0.0
version: 2.1.0
repository: https://github.com/mono0926/adaptive_dialog
funding:
- https://github.com/sponsors/mono0926
Expand Down

0 comments on commit a767a95

Please sign in to comment.