WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.
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;
});
},
),
),
);
}
}