Unverified Commit 741bb9d3 authored by Guilherme Henrique's avatar Guilherme Henrique Committed by GitHub

Update text_form_field.dart (#81043)

parent ec91c658
......@@ -228,7 +228,7 @@ class TextFormField extends FormField<String> {
'minLines and maxLines must be null when expands is true.',
),
assert(!obscureText || maxLines == 1, 'Obscured fields cannot be multiline.'),
assert(maxLength == null || maxLength > 0),
assert(maxLength == null || maxLength == TextField.noMaxLength || maxLength > 0),
assert(enableInteractiveSelection != null),
super(
key: key,
......
......@@ -114,6 +114,19 @@ void main() {
expect(find.byType(CupertinoButton), findsNothing);
}, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.macOS, TargetPlatform.windows, TargetPlatform.linux }), skip: kIsWeb);
testWidgets('TextFormField accepts TextField.noMaxLength as value to maxLength parameter', (WidgetTester tester) async {
bool asserted;
try {
TextFormField(
maxLength: TextField.noMaxLength,
);
asserted = false;
} catch (e){
asserted = true;
}
expect(asserted, false);
});
testWidgets('Passes textAlign to underlying TextField', (WidgetTester tester) async {
const TextAlign alignment = TextAlign.center;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment