Skip to content

Commit 4dd8219

Browse files
committed
Fix typo
1 parent 199ed11 commit 4dd8219

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

example/lib/pages/text_input_dialog_page.dart

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class TextInputDialogPage extends ConsumerWidget {
5757
textFields: const [
5858
DialogTextField(
5959
hintText: 'hintText',
60-
maxLenght: 24,
60+
maxLength: 24,
6161
),
6262
],
6363
title: 'Hello',
@@ -74,11 +74,14 @@ class TextInputDialogPage extends ConsumerWidget {
7474
textFields: [
7575
DialogTextField(
7676
hintText: 'hintText',
77-
validator: (value) => value!.isEmpty ? 'Input more than one character' : null,
77+
validator: (value) =>
78+
value!.isEmpty ? 'Input more than one character' : null,
7879
),
7980
DialogTextField(
8081
hintText: 'hintText',
81-
validator: (value) => value!.length < 2 ? 'Input more than two characters' : null,
82+
validator: (value) => value!.length < 2
83+
? 'Input more than two characters'
84+
: null,
8285
),
8386
],
8487
title: 'Hello',
@@ -95,11 +98,14 @@ class TextInputDialogPage extends ConsumerWidget {
9598
textFields: [
9699
DialogTextField(
97100
hintText: 'hintText',
98-
validator: (value) => value!.isEmpty ? 'Input more than one character' : null,
101+
validator: (value) =>
102+
value!.isEmpty ? 'Input more than one character' : null,
99103
),
100104
DialogTextField(
101105
hintText: 'hintText',
102-
validator: (value) => value!.length < 2 ? 'Input more than two characters' : null,
106+
validator: (value) => value!.length < 2
107+
? 'Input more than two characters'
108+
: null,
103109
),
104110
],
105111
title: 'Hello',
@@ -161,8 +167,12 @@ class TextInputDialogPage extends ConsumerWidget {
161167
hintText: 'Start with "F"',
162168
retryTitle: 'Incorrect',
163169
retryMessage: 'Retry?',
164-
retryOkLabel:
165-
ref.watch(adaptiveStyleProvider).effectiveStyle(theme).isMaterial(theme) ? 'RETRY' : 'Retry',
170+
retryOkLabel: ref
171+
.watch(adaptiveStyleProvider)
172+
.effectiveStyle(theme)
173+
.isMaterial(theme)
174+
? 'RETRY'
175+
: 'Retry',
166176
);
167177
logger.info('ok: $ok');
168178
if (!ok) {

lib/src/text_input_dialog/ios_text_input_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class _IOSTextInputDialogState extends State<IOSTextInputDialog> {
132132
obscureText: field.obscureText,
133133
keyboardType: field.keyboardType,
134134
textCapitalization: field.textCapitalization,
135-
maxLength: field.maxLenght,
135+
maxLength: field.maxLength,
136136
minLines: field.minLines,
137137
maxLines: field.maxLines,
138138
autocorrect: field.autocorrect,

lib/src/text_input_dialog/macos_text_input_dialog.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class _MacOSTextInputDialogState extends State<MacOSTextInputDialog> {
142142
textCapitalization: field.textCapitalization,
143143
minLines: field.minLines,
144144
maxLines: field.maxLines,
145-
maxLength: field.maxLenght,
145+
maxLength: field.maxLength,
146146
autocorrect: field.autocorrect,
147147
prefix:
148148
prefixText == null ? null : Text(prefixText),

lib/src/text_input_dialog/material_text_input_dialog.dart

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class MaterialTextInputDialog extends StatefulWidget {
2020
this.autoSubmit = false,
2121
});
2222
@override
23-
_MaterialTextInputDialogState createState() => _MaterialTextInputDialogState();
23+
_MaterialTextInputDialogState createState() =>
24+
_MaterialTextInputDialogState();
2425

2526
final List<DialogTextField> textFields;
2627
final String? title;
@@ -37,8 +38,9 @@ class MaterialTextInputDialog extends StatefulWidget {
3738
}
3839

3940
class _MaterialTextInputDialogState extends State<MaterialTextInputDialog> {
40-
late final List<TextEditingController> _textControllers =
41-
widget.textFields.map((tf) => TextEditingController(text: tf.initialText)).toList();
41+
late final List<TextEditingController> _textControllers = widget.textFields
42+
.map((tf) => TextEditingController(text: tf.initialText))
43+
.toList();
4244
final _formKey = GlobalKey<FormState>();
4345
var _autovalidateMode = AutovalidateMode.disabled;
4446

@@ -83,7 +85,8 @@ class _MaterialTextInputDialogState extends State<MaterialTextInputDialog> {
8385
final cancelLabel = widget.cancelLabel;
8486
final okLabel = widget.okLabel;
8587
final okText = Text(
86-
(widget.fullyCapitalized ? okLabel?.toUpperCase() : okLabel) ?? MaterialLocalizations.of(context).okButtonLabel,
88+
(widget.fullyCapitalized ? okLabel?.toUpperCase() : okLabel) ??
89+
MaterialLocalizations.of(context).okButtonLabel,
8790
style: TextStyle(
8891
color: widget.isDestructiveAction ? colorScheme.error : null,
8992
),
@@ -120,7 +123,7 @@ class _MaterialTextInputDialogState extends State<MaterialTextInputDialog> {
120123
textCapitalization: field.textCapitalization,
121124
minLines: field.minLines,
122125
maxLines: field.maxLines,
123-
maxLength: field.maxLenght,
126+
maxLength: field.maxLength,
124127
autocorrect: field.autocorrect,
125128
decoration: InputDecoration(
126129
hintText: field.hintText,
@@ -130,7 +133,9 @@ class _MaterialTextInputDialogState extends State<MaterialTextInputDialog> {
130133
validator: field.validator,
131134
autovalidateMode: _autovalidateMode,
132135
textInputAction: isLast ? null : TextInputAction.next,
133-
onFieldSubmitted: isLast && widget.autoSubmit ? (_) => submitIfValid() : null,
136+
onFieldSubmitted: isLast && widget.autoSubmit
137+
? (_) => submitIfValid()
138+
: null,
134139
);
135140
})
136141
],
@@ -139,7 +144,9 @@ class _MaterialTextInputDialogState extends State<MaterialTextInputDialog> {
139144
TextButton(
140145
onPressed: cancel,
141146
child: Text(
142-
(widget.fullyCapitalized ? cancelLabel?.toUpperCase() : cancelLabel) ??
147+
(widget.fullyCapitalized
148+
? cancelLabel?.toUpperCase()
149+
: cancelLabel) ??
143150
MaterialLocalizations.of(context).cancelButtonLabel,
144151
),
145152
),

lib/src/text_input_dialog/show_text_input_dialog.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class DialogTextField {
123123
this.suffixText,
124124
this.minLines,
125125
this.maxLines = 1,
126-
this.maxLenght,
126+
this.maxLength,
127127
this.autocorrect = true,
128128
});
129129
final String? initialText;
@@ -136,6 +136,6 @@ class DialogTextField {
136136
final String? suffixText;
137137
final int? minLines;
138138
final int maxLines;
139-
final int? maxLenght;
139+
final int? maxLength;
140140
final bool autocorrect;
141141
}

0 commit comments

Comments
 (0)