Holds the color and typography values for a material design theme.
Use this class to configure a Theme widget.
To obtain the current theme, use of.
Static Methods
Constructors
- ThemeData({Brightness brightness, Map<int, Color> primarySwatch, Color primaryColor, Brightness primaryColorBrightness, Color accentColor, Brightness accentColorBrightness, Color canvasColor, Color scaffoldBackgroundColor, Color cardColor, Color dividerColor, Color highlightColor, Color splashColor, Color selectedRowColor, Color unselectedWidgetColor, Color disabledColor, Color buttonColor, Color secondaryHeaderColor, Color textSelectionColor, Color textSelectionHandleColor, Color backgroundColor, Color indicatorColor, Color hintColor, Color errorColor, TextTheme textTheme, TextTheme primaryTextTheme, TextTheme accentTextTheme, IconThemeData iconTheme, IconThemeData primaryIconTheme, IconThemeData accentIconTheme, TargetPlatform platform })
-
Create a ThemeData given a set of preferred values.
factory - ThemeData.dark()
-
A default dark theme with a teal accent color.
factory - ThemeData.fallback()
-
The default theme. Same as new ThemeData.light.
factory - ThemeData.light()
-
A default light blue theme.
factory - ThemeData.raw({Brightness brightness, Color primaryColor, Brightness primaryColorBrightness, Color accentColor, Brightness accentColorBrightness, Color canvasColor, Color scaffoldBackgroundColor, Color cardColor, Color dividerColor, Color highlightColor, Color splashColor, Color selectedRowColor, Color unselectedWidgetColor, Color disabledColor, Color buttonColor, Color secondaryHeaderColor, Color textSelectionColor, Color textSelectionHandleColor, Color backgroundColor, Color indicatorColor, Color hintColor, Color errorColor, TextTheme textTheme, TextTheme primaryTextTheme, TextTheme accentTextTheme, IconThemeData iconTheme, IconThemeData primaryIconTheme, IconThemeData accentIconTheme, TargetPlatform platform })
-
Create a ThemeData given a set of exact values. All the values must be specified.
Properties
- accentColor → Color
-
The foreground color for widgets (knobs, text, etc)
read-only - accentColorBrightness → Brightness
-
The brightness of the accentColor. Used to determine the color of text and icons placed on top of the accent color (e.g. the icons on a floating action button).
read-only - accentIconTheme → IconThemeData
-
An icon theme that contrasts with the accent color.
read-only - accentTextTheme → TextTheme
-
A text theme that contrasts with the accent color.
read-only - backgroundColor → Color
-
A color that contrasts with the primaryColor, e.g. used as the remaining part of a progress bar.
read-only - brightness → Brightness
-
The brightness of the overall theme of the application. Used by widgets like buttons to determine what color to pick when not using the primary or accent color.
read-only -
The default color of the Material used in RaisedButtons.
read-only - canvasColor → Color
-
The default color of
MaterialType.canvas
Material.read-only - cardColor → Color
-
The color of Material when it is used as a Card.
read-only - disabledColor → Color
-
The color used for widgets that are inoperative, regardless of their state. For example, a disabled checkbox (which may be checked or unchecked).
read-only - dividerColor → Color
-
The color of Dividers and PopupMenuDividers, also used between ListItems, between rows in DataTables, and so forth.
read-only - errorColor → Color
-
The color to use for input validation errors, e.g. in Input fields.
read-only - hashCode → int
-
read-only
- highlightColor → Color
-
The highlight color used during ink splash animations or to indicate an item in a menu is selected.
read-only - hintColor → Color
-
The color to use for hint text or placeholder text, e.g. in Input fields.
read-only - iconTheme → IconThemeData
-
An icon theme that contrasts with the card and canvas colors.
read-only - indicatorColor → Color
-
The color of the selected tab indicator in a tab bar.
read-only - platform → TargetPlatform
-
The platform the material widgets should adapt to target.
read-only - primaryColor → Color
-
The background color for major parts of the app (toolbars, tab bars, etc)
read-only - primaryColorBrightness → Brightness
-
The brightness of the primaryColor. Used to determine the color of text and icons placed on top of the primary color (e.g. toolbar text).
read-only - primaryIconTheme → IconThemeData
-
An icon theme that contrasts with the primary color.
read-only - primaryTextTheme → TextTheme
-
A text theme that contrasts with the primary color.
read-only - scaffoldBackgroundColor → Color
-
The default color of the Material that underlies the Scaffold. The background color for a typical material app or a page within the app.
read-only - secondaryHeaderColor → Color
-
The color of the header of a PaginatedDataTable when there are selected rows.
read-only - selectedRowColor → Color
-
The color used to highlight selected rows.
read-only - splashColor → Color
-
The color of ink splashes. See InkWell.
read-only - textSelectionColor → Color
-
The color of text selections in text fields, such as Input.
read-only - textSelectionHandleColor → Color
-
The color of the handles used to adjust what part of the text is currently selected.
read-only - textTheme → TextTheme
-
Text with a color that contrasts with the card and canvas colors.
read-only - unselectedWidgetColor → Color
-
The color used for widgets in their inactive (but enabled) state. For example, an unchecked checkbox. Usually contrasted with the accentColor. See also disabledColor.
read-only - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
Methods
-
copyWith(
{Brightness brightness, Color primaryColor, Brightness primaryColorBrightness, Color accentColor, Brightness accentColorBrightness, Color canvasColor, Color scaffoldBackgroundColor, Color cardColor, Color dividerColor, Color highlightColor, Color splashColor, Color selectedRowColor, Color unselectedWidgetColor, Color disabledColor, Color buttonColor, Color secondaryHeaderColor, Color textSelectionColor, Color textSelectionHandleColor, Color backgroundColor, Color indicatorColor, Color hintColor, Color errorColor, TextTheme textTheme, TextTheme primaryTextTheme, TextTheme accentTextTheme, IconThemeData iconTheme, IconThemeData primaryIconTheme, IconThemeData accentIconTheme, TargetPlatform platform }) → ThemeData -
Creates a copy of this theme but with the given fields replaced with the new values.
-
toString(
) → String -
Returns a string representation of this object.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited