Ian Hickson
16e014e884
Add DropdownMenu.focusNode (#142516)
fixes [`DropdownMenu` doesn't have a focusNode](https://github.com/flutter/flutter/issues/142384)
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
enum TShirtSize {
s('S'),
m('M'),
l('L'),
xl('XL'),
xxl('XXL'),
;
const TShirtSize(this.label);
final String label;
}
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final FocusNode _focusNode = FocusNode();
@override
void dispose() {
_focusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: const Text('DropdownMenu Sample'),
),
body: Center(
child: DropdownMenu<TShirtSize>(
focusNode: _focusNode,
initialSelection: TShirtSize.m,
label: const Text('T-Shirt Size'),
dropdownMenuEntries: TShirtSize.values.map((e) {
return DropdownMenuEntry<TShirtSize>(
value: e,
label: e.label,
);
}).toList(),
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
_focusNode.requestFocus();
},
label: const Text('Request Focus on DropdownMenu'),
),
),
);
}
}
```
</details>
2024-01-31 06:12:20 +00:00
..
2023-12-20 22:05:29 +00:00
2024-01-20 00:27:18 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-29 22:00:51 +00:00
2024-01-24 16:49:18 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-23 19:24:54 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2024-01-19 18:29:07 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2024-01-09 09:05:06 +00:00
2024-01-30 16:28:31 -08:00
2024-01-29 21:21:34 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-16 21:40:08 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-26 19:12:24 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-16 10:08:27 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-26 19:12:24 +00:00
2024-01-31 06:12:20 +00:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2024-01-26 19:12:24 +00:00
2023-12-15 14:13:31 -08:00
2024-01-22 10:01:05 +00:00
2024-01-22 10:01:05 +00:00
2024-01-22 11:13:31 +00:00
2024-01-22 11:13:31 +00:00
2023-12-15 14:13:31 -08:00
2024-01-26 19:12:24 +00:00
2023-12-15 14:13:31 -08:00
2024-01-30 16:28:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-20 22:05:29 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-30 16:28:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-29 21:21:34 -08:00
2024-01-30 22:41:15 +00:00
2023-12-15 14:13:31 -08:00
2024-01-23 17:47:06 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-30 22:41:15 +00:00
2023-12-20 22:05:29 +00:00
2023-12-15 14:13:31 -08:00
2023-12-20 22:05:29 +00:00
2023-12-15 14:13:31 -08:00
2024-01-24 19:45:47 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-29 19:11:59 +00:00
2023-12-15 14:13:31 -08:00
2024-01-26 19:12:24 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-20 00:27:18 +00:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2024-01-09 18:19:07 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-22 18:21:31 +00:00
2023-12-15 14:13:31 -08:00
2024-01-05 21:28:07 +00:00
2023-12-15 14:13:31 -08:00
2024-01-29 21:21:34 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-19 13:01:07 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2024-01-17 22:49:04 +00:00
2024-01-26 00:20:21 +00:00
2023-12-15 14:13:31 -08:00
2024-01-09 09:49:13 +00:00
2024-01-24 16:13:26 +00:00
2024-01-20 00:27:18 +00:00
2023-12-16 19:23:11 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-12 16:35:08 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-12 22:10:25 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 23:44:11 +00:00
2024-01-26 19:12:24 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-30 18:12:18 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2023-12-20 22:05:29 +00:00
2024-01-20 00:27:18 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-22 10:01:05 +00:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2024-01-24 16:13:26 +00:00
2023-12-15 14:13:31 -08:00
2023-12-15 14:13:31 -08:00
2024-01-24 16:13:26 +00:00
2024-01-20 00:27:18 +00:00
2023-12-15 14:13:31 -08:00