TopSheet class
Material Design 顶部工作表。
模式顶部工作表是菜单或对话框的替代方法,可防止用户与应用的其余部分进行交互。 可以使用 showModalTopSheet 函数创建和显示模态顶部工作表。
TopSheet 小部件本身很少直接使用。相反,最好使用 showModalTopSheet 创建模态顶部工作表。
另请参阅:
- showModalTopSheet, 可用于显示模态顶部工作表。
- BottomSheetThemeData, 可用于自定义默认的顶部工作表属性值。
- Material 2 规范位于 m2.material.io/components/sheets-bottom.
- Material 3 规范位于 m3.material.io/components/bottom-sheets/overview.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TopSheet
Constructors
- TopSheet.new({required VoidCallback onClosing, required WidgetBuilder builder, Key? key, AnimationController? animationController, bool enableDrag = true, bool? showDragHandle, Color? dragHandleColor, Size? dragHandleSize, BottomSheetDragStartHandler? onDragStart, BottomSheetDragEndHandler? onDragEnd, Color? backgroundColor, Color? shadowColor, double? elevation, ShapeBorder? shape, Clip? clipBehavior, BoxConstraints? constraints, EdgeInsetsGeometry? padding})
-
创建顶部工作表。
const
Properties
- animationController → AnimationController?
-
控制顶部工作表的入口和出口动画的动画控制器。
final
- backgroundColor → Color?
-
顶部工作表的背景颜色。
final
- builder → WidgetBuilder
-
工作表内容的构建器。
final
- clipBehavior → Clip?
-
The content will be clipped (or not) according to this option.
final
- constraints → BoxConstraints?
-
定义 TopSheet 的最小和最大尺寸。
final
- dragHandleColor → Color?
-
顶部工作表拖动手柄的颜色。
final
- dragHandleSize → Size?
-
默认为 BottomSheetThemeData.dragHandleSize。
如果该值也为 null,则默认为 Size(32, 4)。
final
- elevation → double?
-
放置此材料相对于其父材质的 z 坐标。
final
- enableDrag → bool
-
如果为 true,则可以上下拖动顶部工作表,并通过向下滑动来关闭。
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onClosing → VoidCallback
-
当顶部工作表开始关闭时调用。
final
- onDragEnd → BottomSheetDragEndHandler?
-
如果 enableDrag 为 true,则在用户停止拖动顶部工作表时调用。
final
- onDragStart → BottomSheetDragStartHandler?
-
当用户开始垂直拖动顶部工作表时调用,如果 enableDrag 为 true。
final
- padding → EdgeInsetsGeometry?
-
内边距
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowColor → Color?
-
工作表下方阴影的颜色。
final
- shape → ShapeBorder?
-
顶部工作表的形状。
final
- showDragHandle → bool?
-
指定是否显示拖动手柄。
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< TopSheet> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited