style property Null safety

TextStyle? style
final

The text style to use for text in the dropdown button and the dropdown menu that appears when you tap the button.

To use a separate text style for selected item when it's displayed within the dropdown button, consider using selectedItemBuilder.

This sample shows a DropdownButton with a dropdown button text style that is different than its menu items.
To create a local project with this code sample, run:
flutter create --sample=material.DropdownButton.style.1 mysample

Defaults to the TextTheme.subtitle1 value of the current ThemeData.textTheme of the current Theme.

Implementation

final TextStyle? style;