控件和主题增强
· 阅读需 6 分钟
在发布 Flet 0.21.0 一个多月后,我们很高兴地宣布发布 Flet 0.22.0。
此版本带来了许多增强、错误修复和弃用功能:
增强功能
这是本次发布的主要关注点之一。我们进行了两种类型的增强:
控件增强
我们遍历了现有控件的长列表,并在可能的情况下公开了更多属性 - PR #2882。这将为您提供更多对 Flet 控件的控制,以便在您的优秀应用程序中使用。
以下是完整列表:
AppBar
: elevation_on_scroll, exclude_header_semantics, force_material_transparency, is_secondary, shadow_color, surface_tint_color, clip_behavior, title_spacing, toolbar_opacity, title_text_style, toolbar_text_style, shapeAlertDialog
: action_button_padding, clip_behavior, icon_padding, shadow_color, surface_tint_colorBanner
: content_text_style, margin, elevation, divider_color, shadow_color, surface_tint_color, on_visibleCupertinoListTile
: leading_size, leading_to_titleCupertinoSegmentedButton
: click_colorCupertinoSwitch
:on_label_color, off_label_colorCupertinoTimerPicker
: item_extentChip
: surface_tint_color, color, click_elevation, clip_behavior, visual_density, border_sideDivider
: leading_indent, trailing_indentExpansionTile
: dense, enable_feedback, visual_densityCard
: clip_behavior, is_semantic_container, show_border_on_foreground, variantCheckbox
: border_side, semantics_label, shape, splash_radius, is_error, visual_density, mouse_cursorCircleAvatar
: on_image_errorDataTable
: clip_behaviorDatePicker
: on_entry_mode_changeDraggable
: on_drag_complete, on_drag_startDragTarget
: on_moveDropdown
: fill_color, hint_content, icon_content, elevation, item_height, max_menu_height, icon_size, enable_feedback, padding, icon_enabled_color, icon_disabled_color, on_clickElevatedButton
: clip_behaviorFloatingActionButton
: clip_behavior, enable_feedback, focus_color, foreground_color, disabled_elevation, elevation, focus_elevation, highlight_elevation, hover_elevation, mouse_cursorGridView
: cache_extent, clip_behavior, semantic_child_countIconButton
: alignment, disabled_color, focus_color, enable_feedback, hover_color, padding, splash_color, splash_radius, focus_color, mouse_cursor, visual_densityImage
: exclude_from_semantics, filter_qualityListTile
: enable_feedback, horizontal_spacing, min_leading_width, min_vertical_padding, selected_color, selected_tile_color, style, title_alignment, icon_color, text_color, shape, visual_density, mouse_cursor, title_text_style, subtitle_text_style, leading_and_trailing_text_styleListView
: cache_extent, clip_behavior, semantic_child_countNavigationBar
: animation_duration, overlay_colorNavigationDrawerDestination
: bgcolorNavigationDestination
: bgcolorNavigationRail
: selected_label_text_style, unselected_label_text_styleNavigationRailDestination
: indicator_color, indicator_shapeOption
: alignment, on_clickOutlinedButton
: clip_behaviorPage
: locale_configurationPopupMenuItem
: height, padding, mouse_cursorPopupMenuButton
: bgcolor, clip_behavior, elevation, enable_feedback, icon_color, shadow_color, surface_tint_color, icon_size, padding, splash_radius, shape, on_open, on_cancelProgressBar
: border_radius, semantics_label, semantics_valueProgressRing
: semantics_label, semantics_value, stroke_cap, stroke_alignRadio
: focus_color, hover_color, overlay_color, splash_radius, toggleable, visual_density, mouse_cursorSearchBar
: keyboard_type, view_surface_tint_color, autofocusSelectionArea
: on_changeSlider
: interaction, overlay_color, mouse_cursor, secondary_track_value, secondary_active_colorStack
: alignment, fitSnackBar
: clip_behavior, shape, on_visible, action_overflow_thresholdSwitch
: hover_color, splash_radius, overlay_color, track_outline_color, mouse_cursorTabs
: divider_height, enable_feedback, indicator_thickness, is_secondary, mouse_cursor, clip_behaviorTextField
: fill_color, hover_colorTimePicker
: orientation, on_entry_mode_changeTooltip
: enable_tap_to_dismiss, exclude_from_semanticsVerticalDivider
: leading_indent, trailing_indent
如果您觉得有些功能缺失且需要添加,请随时告诉我们。
查看我写的关于 Page.locale_configuration
的文章这里。
主题增强
用于应用程序主题设置的 Theme 类在浅色和深色模式下得到了进一步增强。 引入了许多新主题 - PR #2955。
查看主题指南 这里。