Commit 87fb075f authored by Dragoș Tiselice's avatar Dragoș Tiselice Committed by GitHub

Renamed DropDown to Dropdown. (#5897)

Fixes #3208.
parent 8ac14f86
...@@ -143,7 +143,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -143,7 +143,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
children: <Widget>[ children: <Widget>[
new ListItem( new ListItem(
title: new Text('Scrollable dropdown:'), title: new Text('Scrollable dropdown:'),
trailing: new DropDownButton<String>( trailing: new DropdownButton<String>(
value: dropdown1Value, value: dropdown1Value,
onChanged: (String newValue) { onChanged: (String newValue) {
setState(() { setState(() {
...@@ -156,7 +156,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -156,7 +156,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten' 'Bit', 'More', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'
] ]
.map((String value) { .map((String value) {
return new DropDownMenuItem<String>( return new DropdownMenuItem<String>(
value: value, value: value,
child: new Text(value)); child: new Text(value));
}) })
...@@ -168,7 +168,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -168,7 +168,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
), ),
new ListItem( new ListItem(
title: new Text('Simple dropdown:'), title: new Text('Simple dropdown:'),
trailing: new DropDownButton<String>( trailing: new DropdownButton<String>(
value: dropdown2Value, value: dropdown2Value,
onChanged: (String newValue) { onChanged: (String newValue) {
setState(() { setState(() {
...@@ -178,7 +178,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -178,7 +178,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
}, },
items: <String>['One', 'Two', 'Free', 'Four'] items: <String>['One', 'Two', 'Free', 'Four']
.map((String value) { .map((String value) {
return new DropDownMenuItem<String>( return new DropdownMenuItem<String>(
value: value, value: value,
child: new Text(value)); child: new Text(value));
}) })
......
...@@ -73,16 +73,16 @@ class OrderItem extends StatelessWidget { ...@@ -73,16 +73,16 @@ class OrderItem extends StatelessWidget {
new SizedBox(height: 16.0), new SizedBox(height: 16.0),
new Padding( new Padding(
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0, right: 88.0), padding: const EdgeInsets.only(top: 8.0, bottom: 8.0, right: 88.0),
child: new DropDownButtonHideUnderline( child: new DropdownButtonHideUnderline(
child: new Container( child: new Container(
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border.all( border: new Border.all(
color: const Color(0xFFD9D9D9) color: const Color(0xFFD9D9D9)
) )
), ),
child: new DropDownButton<int>( child: new DropdownButton<int>(
items: <int>[0, 1, 2, 3, 4, 5].map((int value) { items: <int>[0, 1, 2, 3, 4, 5].map((int value) {
return new DropDownMenuItem<int>( return new DropdownMenuItem<int>(
value: value, value: value,
child: new Padding( child: new Padding(
padding: const EdgeInsets.only(left: 8.0), padding: const EdgeInsets.only(left: 8.0),
......
...@@ -56,7 +56,7 @@ new FlatButton( ...@@ -56,7 +56,7 @@ new FlatButton(
String dropdownValue; String dropdownValue;
// Drop down button with string values. // Drop down button with string values.
new DropDownButton<String>( new DropdownButton<String>(
value: dropdownValue, value: dropdownValue,
onChanged: (String newValue) { onChanged: (String newValue) {
// null indicates the user didn't select a // null indicates the user didn't select a
...@@ -68,7 +68,7 @@ new DropDownButton<String>( ...@@ -68,7 +68,7 @@ new DropDownButton<String>(
}, },
items: <String>['One', 'Two', 'Free', 'Four'] items: <String>['One', 'Two', 'Free', 'Four']
.map((String value) { .map((String value) {
return new DropDownMenuItem<String>( return new DropdownMenuItem<String>(
value: value, value: value,
child: new Text(value)); child: new Text(value));
}) })
......
...@@ -153,7 +153,7 @@ class DataCell { ...@@ -153,7 +153,7 @@ class DataCell {
/// Creates an object to hold the data for a cell in a [DataTable]. /// Creates an object to hold the data for a cell in a [DataTable].
/// ///
/// The first argument is the widget to show for the cell, typically /// The first argument is the widget to show for the cell, typically
/// a [Text] or [DropDownButton] widget; this becomes the [widget] /// a [Text] or [DropdownButton] widget; this becomes the [widget]
/// property and must not be null. /// property and must not be null.
/// ///
/// If the cell has no data, then a [Text] widget with placeholder /// If the cell has no data, then a [Text] widget with placeholder
...@@ -170,7 +170,7 @@ class DataCell { ...@@ -170,7 +170,7 @@ class DataCell {
/// The data for the row. /// The data for the row.
/// ///
/// Typically a [Text] widget or a [DropDownButton] widget. /// Typically a [Text] widget or a [DropdownButton] widget.
/// ///
/// If the cell has no data, then a [Text] widget with placeholder /// If the cell has no data, then a [Text] widget with placeholder
/// text should be provided instead, and [placeholder] should be set /// text should be provided instead, and [placeholder] should be set
...@@ -470,7 +470,7 @@ class DataTable extends StatelessWidget { ...@@ -470,7 +470,7 @@ class DataTable extends StatelessWidget {
data: new IconThemeData( data: new IconThemeData(
color: isLightTheme ? Colors.black54 : Colors.white70 color: isLightTheme ? Colors.black54 : Colors.white70
), ),
child: new DropDownButtonHideUnderline(child: label) child: new DropdownButtonHideUnderline(child: label)
) )
) )
); );
......
...@@ -32,7 +32,7 @@ import 'theme.dart'; ...@@ -32,7 +32,7 @@ import 'theme.dart';
/// See also: /// See also:
/// ///
/// * [RaisedButton] /// * [RaisedButton]
/// * [DropDownButton] /// * [DropdownButton]
/// * <https://www.google.com/design/spec/components/buttons.html> /// * <https://www.google.com/design/spec/components/buttons.html>
class FlatButton extends StatelessWidget { class FlatButton extends StatelessWidget {
/// Creates a flat button. /// Creates a flat button.
......
...@@ -307,8 +307,8 @@ class PaginatedDataTableState extends State<PaginatedDataTable> { ...@@ -307,8 +307,8 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
if (config.onRowsPerPageChanged != null) { if (config.onRowsPerPageChanged != null) {
List<Widget> availableRowsPerPage = config.availableRowsPerPage List<Widget> availableRowsPerPage = config.availableRowsPerPage
.where((int value) => value <= _rowCount) .where((int value) => value <= _rowCount)
.map/*<DropDownMenuItem<int>>*/((int value) { .map/*<DropdownMenuItem<int>>*/((int value) {
return new DropDownMenuItem<int>( return new DropdownMenuItem<int>(
value: value, value: value,
child: new Text('$value') child: new Text('$value')
); );
...@@ -316,8 +316,8 @@ class PaginatedDataTableState extends State<PaginatedDataTable> { ...@@ -316,8 +316,8 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
.toList(); .toList();
footerWidgets.addAll(<Widget>[ footerWidgets.addAll(<Widget>[
new Text('Rows per page:'), new Text('Rows per page:'),
new DropDownButtonHideUnderline( new DropdownButtonHideUnderline(
child: new DropDownButton<int>( child: new DropdownButton<int>(
items: availableRowsPerPage, items: availableRowsPerPage,
value: config.rowsPerPage, value: config.rowsPerPage,
onChanged: config.onRowsPerPageChanged, onChanged: config.onRowsPerPageChanged,
......
...@@ -29,7 +29,7 @@ import 'theme.dart'; ...@@ -29,7 +29,7 @@ import 'theme.dart';
/// See also: /// See also:
/// ///
/// * [FlatButton] /// * [FlatButton]
/// * [DropDownButton] /// * [DropdownButton]
/// * [FloatingActionButton] /// * [FloatingActionButton]
/// * <https://www.google.com/design/spec/components/buttons.html> /// * <https://www.google.com/design/spec/components/buttons.html>
class RaisedButton extends StatelessWidget { class RaisedButton extends StatelessWidget {
......
...@@ -8,15 +8,15 @@ import 'package:flutter/material.dart'; ...@@ -8,15 +8,15 @@ import 'package:flutter/material.dart';
void main() { void main() {
testWidgets('Drop down screen edges', (WidgetTester tester) async { testWidgets('Drop down screen edges', (WidgetTester tester) async {
int value = 4; int value = 4;
List<DropDownMenuItem<int>> items = <DropDownMenuItem<int>>[]; List<DropdownMenuItem<int>> items = <DropdownMenuItem<int>>[];
for (int i = 0; i < 20; ++i) for (int i = 0; i < 20; ++i)
items.add(new DropDownMenuItem<int>(value: i, child: new Text('$i'))); items.add(new DropdownMenuItem<int>(value: i, child: new Text('$i')));
void handleChanged(int newValue) { void handleChanged(int newValue) {
value = newValue; value = newValue;
} }
DropDownButton<int> button = new DropDownButton<int>( DropdownButton<int> button = new DropdownButton<int>(
value: value, value: value,
onChanged: handleChanged, onChanged: handleChanged,
items: items items: items
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment