ColorScheme colorScheme, // 拥有30种颜色(这个数可能过几个版本会变化吧),可用于配置大多数组件的颜色。 A set of 30 colors based on the[Material spec] that can be used to configure the color properties of most components.Color canvasColor, // MaterialType.canvas 的默认颜色 The default color of [MaterialType.canvas] [Material].Color cardColor, // Card的颜色 The color of [Material] when it is used as a [Card].Color dialogBackgroundColor, // Dialog 背景颜色 The background color of [Dialog] elements.Color disabledColor, // 禁用状态下部件的颜色,无论其当前状态如何。例如,一个禁用的复选框(可以选中或未选中)。Color? dividerColor, // Divider和PopupMenuDivider的颜色,也用于ListTile之间、DataTable的行之间等。The color of [Divider]s and [PopupMenuDivider]s, also used between [ListTile]s, between rows in [DataTable]s, and so forth.Color? focusColor, //The focus color used indicate that a component has the input focus.Color? highlightColor, // 选中在泼墨动画期间使用的突出显示颜色,或用于指示菜单中的项。 The highlight color used during ink splash animations or to indicate an item in a menu is selected.Color? hintColor, // 用于提示文本或占位符文本的颜色,例如在TextField中。 The color to use for hint text or placeholder text, e.g. in [TextField] fields.Color? hoverColor, // The hover color used to indicate when a pointer is hovering over a component.Color? indicatorColor, // 选项卡中选定的选项卡指示器的颜色。The color of the selected tab indicator in a tab bar.Color? primaryColor, / 应用程序主要部分的背景颜色(toolbars、tab bars 等) The background color for major parts of the app (toolbars, tab bars, etc)Color? primaryColorDark, // A darker version of the [primaryColor].Color? primaryColorLight, // A lighter version of the [primaryColor].Color? scaffoldBackgroundColor, // Scaffold的默认颜色。典型Material应用程序或应用程序内页面的背景颜色。 Color? secondaryHeaderColor, // 选定行时PaginatedDataTable标题的颜色。 The color of the header of a [PaginatedDataTable] when there are selected rows.Color? shadowColor, // The color that the [Material] widget uses to draw elevation shadows.Color? splashColor, // The color of ink splashes.Color? unselectedWidgetColor, , // 用于处于非活动(但已启用)状态的小部件的颜色。例如,未选中的复选框。通常与accentColor形成对比。也看到disabledColor。 The color used for widgets in their inactive (but enabled) state. For example, an unchecked checkbox. See also [disabledColor].
ColorScheme colorScheme, // 拥有30种颜色,可用于配置大多数组件的颜色。
Ctrl+左键 点击 查看系统 snack_bar的使用
组件增加appbar
appBar: AppBar(title: Text("实例"),),
设置 colorSchemecolorScheme: ColorScheme.dark()
colorScheme: ColorScheme.dark()
结果
设置 colorSchemecolorScheme:ColorScheme.light()