flutter/packages
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
..
flutter Add DropdownMenu.focusNode (#142516) 2024-01-31 06:12:20 +00:00
flutter_driver Upgrade leak_tracker. (#142162) 2024-01-24 15:33:17 -08:00
flutter_goldens Upgrade leak_tracker. (#142162) 2024-01-24 15:33:17 -08:00
flutter_localizations Fix incorrect zh-cn translation for Look Up Label in selection controls (#142158) 2024-01-25 10:24:42 -08:00
flutter_test Reset framesEnabled to default value at the end of each test (#141844) 2024-01-30 16:04:15 +00:00
flutter_tools Revert "Reland: "Fix how Gradle resolves Android plugin" (#137115)" (#142464) 2024-01-29 22:44:24 +00:00
flutter_web_plugins Upgrade leak_tracker. (#142162) 2024-01-24 15:33:17 -08:00
fuchsia_remote_debug_protocol Upgrade leak_tracker. (#142162) 2024-01-24 15:33:17 -08:00
integration_test Update Android minSdkVersion to 21 (#142267) 2024-01-29 09:49:09 -08:00
analysis_options.yaml Unify analysis options (#108462) 2022-07-28 09:07:49 -07:00