diff --git a/CHANGELOG.md b/CHANGELOG.md index f26c290..eea42a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.1.0 + +- Add `spellCheckConfiguration` to `DialogTextField` + ## 2.0.0 - Support Flutter 3.16 diff --git a/example/lib/pages/text_input_dialog_page.dart b/example/lib/pages/text_input_dialog_page.dart index 4c60a45..04fa026 100644 --- a/example/lib/pages/text_input_dialog_page.dart +++ b/example/lib/pages/text_input_dialog_page.dart @@ -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 { diff --git a/example/pubspec.lock b/example/pubspec.lock index e321351..9260eb7 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -15,7 +15,7 @@ packages: path: ".." relative: true source: path - version: "2.0.0" + version: "2.1.0" analyzer: dependency: transitive description: diff --git a/lib/src/text_input_dialog/ios_text_input_dialog.dart b/lib/src/text_input_dialog/ios_text_input_dialog.dart index f9790d6..ce59b80 100644 --- a/lib/src/text_input_dialog/ios_text_input_dialog.dart +++ b/lib/src/text_input_dialog/ios_text_input_dialog.dart @@ -148,6 +148,7 @@ class _IOSTextInputDialogState extends State { onSubmitted: isLast && widget.autoSubmit ? (_) => submitIfValid() : null, + spellCheckConfiguration: field.spellCheckConfiguration, ); }, ), diff --git a/lib/src/text_input_dialog/macos_text_input_dialog.dart b/lib/src/text_input_dialog/macos_text_input_dialog.dart index 1b0cb71..be1f245 100644 --- a/lib/src/text_input_dialog/macos_text_input_dialog.dart +++ b/lib/src/text_input_dialog/macos_text_input_dialog.dart @@ -155,6 +155,7 @@ class _MacOSTextInputDialogState extends State { onSubmitted: isLast && widget.autoSubmit ? (_) => submitIfValid() : null, + // No spellCheckConfiguration for macos_ui ), ), ); diff --git a/lib/src/text_input_dialog/material_text_input_dialog.dart b/lib/src/text_input_dialog/material_text_input_dialog.dart index 7a876b7..fadefba 100644 --- a/lib/src/text_input_dialog/material_text_input_dialog.dart +++ b/lib/src/text_input_dialog/material_text_input_dialog.dart @@ -138,6 +138,7 @@ class _MaterialTextInputDialogState extends State { onFieldSubmitted: isLast && widget.autoSubmit ? (_) => submitIfValid() : null, + spellCheckConfiguration: field.spellCheckConfiguration, ); }), ], diff --git a/lib/src/text_input_dialog/show_text_input_dialog.dart b/lib/src/text_input_dialog/show_text_input_dialog.dart index d7eb305..85b1d52 100644 --- a/lib/src/text_input_dialog/show_text_input_dialog.dart +++ b/lib/src/text_input_dialog/show_text_input_dialog.dart @@ -131,6 +131,7 @@ class DialogTextField { this.maxLines = 1, this.maxLength, this.autocorrect = true, + this.spellCheckConfiguration, }); final String? initialText; final String? hintText; @@ -144,4 +145,5 @@ class DialogTextField { final int maxLines; final int? maxLength; final bool autocorrect; + final SpellCheckConfiguration? spellCheckConfiguration; } diff --git a/pubspec.yaml b/pubspec.yaml index 1e143e9..099ec4b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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