跳到主要内容

主题

引入 Tabs 模块:从'@theme/Tabs'导入;引入 TabItem 模块:从'@theme/TabItem'导入。

Theme类具有以下属性:

appbar_theme(应用栏主题)

值的类型为 AppBarTheme

badge_theme(徽章主题)

值的类型为 BadgeTheme

值的类型为 BannerTheme

bottom_appbar_theme(底部应用栏主题)

值的类型为 BottomAppBarTheme

bottom_sheet_theme(底部表单主题)

值的类型为 BottomSheetTheme

button_theme(按钮主题)

:::警告 自v0.27.0起此属性已弃用,并将在v0.30.0中删除。请使用elevated_button_theme(悬浮按钮主题)、outlined_button_theme(轮廓按钮主题)、text_button_theme(文本按钮主题)、filled_button_theme(填充按钮主题)或icon_button_theme(图标按钮主题)代替。 :::

值的类型为 ButtonTheme

canvas_color(画布颜色)

值的类型为 ColorValue

card_color(卡片颜色)

值的类型为 ColorValue

card_theme(卡片主题)

值的类型为 CardTheme

checkbox_theme(复选框主题)

值的类型为 CheckboxTheme

chip_theme(芯片主题)

值的类型为 ChipTheme

color_scheme_seed(颜色方案种子)

一种用于通过算法从其衍生出其余主题颜色的种子颜色。

值的类型为 ColorValue

color_scheme(颜色方案)

值的类型为 ColorScheme类,允许自定义从color_scheme_seed衍生的 Material 颜色方案。

elevated_button_theme(悬浮按钮主题)

值的类型为 ElevatedButtonTheme

date_picker_theme(日期选择器主题)

值的类型为 DatePickerTheme

dialog_bgcolor(对话框背景颜色)

值的类型为 ColorValue

dialog_theme(对话框主题)

值的类型为 DialogTheme

disabled_color(禁用颜色)

值的类型为 ColorValue

divider_color(分隔线颜色)

值的类型为 ColorValue

divider_theme(分隔线主题)

值的类型为 DividerTheme

expansion_tile_theme(可扩展磁贴主题)

值的类型为 ExpansionTileTheme

filled_button_theme(填充按钮主题)

值的类型为 FilledButtonTheme

focus_color(焦点颜色)

值的类型为 ColorValue

font_family(字体系列)

所有 UI 元素的基础字体。

highlight_color(高亮颜色)

值的类型为 ColorValue

hint_color(提示颜色)

值的类型为 ColorValue

hover_color(悬停颜色)

值的类型为 ColorValue

icon_button_theme(图标按钮主题)

值的类型为 IconButtonTheme

indicator_color(指示器颜色)

值的类型为 ColorValue

list_tile_theme(列表磁贴主题)

值的类型为 ListTileTheme

值的类型为 NavigationBarTheme

值的类型为 NavigationDrawerTheme

值的类型为 NavigationRailTheme

outlined_button_theme(轮廓按钮主题)

值的类型为 OutlinedButtonTheme

page_transitions(页面过渡)

值的类型为 PageTransitionsTheme

primary_text_theme(主要文本主题)

描述与主要颜色形成对比的文本主题。

值的类型为 TextTheme

值的类型为 PopupMenuTheme

primary_color(主要颜色)

值的类型为 ColorValue

primary_color_dark(主要深色)

值的类型为 ColorValue

primary_color_light(主要浅色)

值的类型为 ColorValue

primary_swatch(主要样本)

值的类型为 ColorValue

progress_indicator_theme(进度指示器主题)

值的类型为 ProgressIndicatorTheme

radio_theme(单选按钮主题)

值的类型为 RadioTheme

scaffold_bgcolor(脚手架背景颜色)

值的类型为 ColorValue

scrollbar_theme(滚动条主题)

值的类型为 ScrollbarTheme

search_bar_theme(搜索栏主题)

值的类型为 SearchBarTheme

search_view_theme(搜索视图主题)

值的类型为 SearchViewTheme

secondary_header_color(次要标题颜色)

值的类型为 ColorValue

segmented_button_theme(分段按钮主题)

值的类型为 SegmentedButtonTheme

shadow_color(阴影颜色)

值的类型为 ColorValue

slider_theme(滑块主题)

值的类型为 SliderTheme

snackbar_theme(快捷栏主题)

值的类型为 SnackBarTheme

splash_color(飞溅颜色)

值的类型为 ColorValue

system_overlay_style(系统覆盖样式)

值的类型为 SystemOverlayStyle

switch_theme(开关主题)

值的类型为 SwitchTheme

tabs_theme(标签页主题)

值的类型为 TabsTheme

text_button_theme(文本按钮主题)

值的类型为 TextButtonTheme

text_theme(文本主题)

定义与卡片和画布颜色形成对比的文本样式。

值的类型为 TextTheme

time_picker_theme(时间选择器主题)

值的类型为 TimePickerTheme

tooltip_theme(工具提示主题)

值的类型为 TooltipTheme

unselected_control_color(未选中的控制颜色)

值的类型为 ColorValue

use_material3(使用 Material 3)

是否使用 Material 3 设计而不是 Material 2。

值的类型为bool,默认为True

visual_density(视觉密度)

值的类型为 VisualDensity