Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Update exposed dropdown menu example #110

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/components/dartpad/menus/exposed_dropdown/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ class ExposedDropdownMenuDemo extends StatefulWidget {
}

class _ExposedDropdownMenuDemoState extends State<ExposedDropdownMenuDemo> {
String dropdownValue = 'Option 1';
String dropdownValue = 'Option 2';

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Exposed Menu Demo'),
title: const Text('Exposed Menu Demo'),
),
body: Center(
child: DropdownButton(
child: DropdownButton<String>(
value: dropdownValue,
items: <DropdownMenuItem>[
items: const <DropdownMenuItem<String>>[
DropdownMenuItem(
value: 'Option 1',
child: Text('Option 1'),
Expand Down Expand Up @@ -59,11 +59,13 @@ class _ExposedDropdownMenuDemoState extends State<ExposedDropdownMenuDemo> {
],
onChanged: (value) {
setState(() {
dropdownValue = value;
dropdownValue = value as String;
});
},
),
),
);
}
}