1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 22:09:06 +00:00

Flutter 3.29 beta (#2571)

This commit is contained in:
Eric Windmill
2025-02-12 18:08:01 -05:00
committed by GitHub
parent d62c784789
commit 719fd72c38
685 changed files with 76244 additions and 53721 deletions

View File

@@ -38,18 +38,19 @@ class _FormValidationDemoState extends State<FormValidationDemo> {
showDialog<void>(
context: context,
builder: (context) => AlertDialog(
title: const Text('Your story'),
content: Text('The $adjective developer saw a $noun'),
actions: [
TextButton(
child: const Text('Done'),
onPressed: () {
Navigator.of(context).pop();
},
builder:
(context) => AlertDialog(
title: const Text('Your story'),
content: Text('The $adjective developer saw a $noun'),
actions: [
TextButton(
child: const Text('Done'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
),
],
),
);
},
),
@@ -85,9 +86,7 @@ class _FormValidationDemoState extends State<FormValidationDemo> {
adjective = value;
},
),
const SizedBox(
height: 24,
),
const SizedBox(height: 24),
// A text field that validates that the text is a noun.
TextFormField(
validator: (value) {
@@ -108,9 +107,7 @@ class _FormValidationDemoState extends State<FormValidationDemo> {
noun = value;
},
),
const SizedBox(
height: 24,
),
const SizedBox(height: 24),
// A custom form field that requires the user to check a
// checkbox.
FormField<bool>(
@@ -148,11 +145,11 @@ class _FormValidationDemoState extends State<FormValidationDemo> {
if (!formFieldState.isValid)
Text(
formFieldState.errorText ?? "",
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(
color: Theme.of(context).colorScheme.error),
style: Theme.of(
context,
).textTheme.bodySmall!.copyWith(
color: Theme.of(context).colorScheme.error,
),
),
],
);