PopupWindow class
通用 Popup Window 提示,带三角号
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PopupWindow
Constructors
-
PopupWindow(BuildContext context, {Key? key, String? text, required GlobalKey<
State< popKey, double arrowHeight = 6.0, TextStyle? textStyle, Color? backgroundColor, bool isShowCloseIcon = false, double offset = 0, PopupDirection popDirection = PopupDirection.bottom, Widget? widget, EdgeInsets paddingInsets = const EdgeInsets.only(left: 18, top: 14, right: 18, bottom: 14), double borderRadius = 4, Color? borderColor, bool canWrap = false, double spaceMargin = 20, double? arrowOffset, double turnOverFromBottom = 50.0})StatefulWidget> >
Properties
- arrowHeight → double
-
箭头的高度,默认 6
final
- arrowOffset → double?
-
箭头图标水平方向的绝对偏移量,为 null 时则自动计算
final
- backgroundColor → Color?
-
popUpWindow 的背景颜色,使用 showPopWindow 方法时,默认值为 Color(0xFF1A1A1A)
final
- borderColor → Color?
-
边框颜色,showPopWindow 方法时,默认值为 Colors.transparent
final
- borderRadius → double
-
容器圆角,默认为 4
final
- canWrap → bool
-
是否能多行显,默认 false,单行显示
final
- context → BuildContext
-
依附的组件的 Context
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isShowCloseIcon → bool
-
是否有关闭图标,默认为 false,不显示
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- offset → double
-
距离 targetView 偏移量,默认为 0
final
- paddingInsets → EdgeInsets
-
容器内边距,默认为 EdgeInsets.only(left: 18, top: 14, right: 18, bottom: 14)
final
- popDirection → PopupDirection
-
popUpWindow 位于 targetView 的方向,默认为
BrnPopupDirection.bottom
final -
popKey
→ GlobalKey<
State< StatefulWidget> > -
依附的组件和 BrnPopUpWindow 组件共同持有的 GlobalKey
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spaceMargin → double
-
距离 targetView 边线的距离,默认 20
final
- text → String?
-
要显示的文本
final
- textStyle → TextStyle?
-
要显示文本的样式
final
- turnOverFromBottom → double
-
popWindow 距离底部的距离小于此值的时候,
自动将 popWindow 在 targetView 上面弹出
final
- widget → Widget?
-
自定义 widget
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _PopupWindowState -
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
Static Methods
-
showPopWindow(
dynamic context, String? text, GlobalKey< State< popKey, {PopupDirection popDirection = PopupDirection.bottom, double arrowHeight = 6.0, TextStyle? textStyle = const TextStyle(fontSize: 16, color: Color(0xFFFFFFFF)), Color? backgroundColor = const Color(0xFF1A1A1A), bool hasCloseIcon = false, double offset = 0, Widget? widget, EdgeInsets paddingInsets = const EdgeInsets.only(left: 18, top: 14, right: 18, bottom: 14), double borderRadius = 8, Color? borderColor = Colors.transparent, double borderWidth = 1, bool canWrap = false, double spaceMargin = 20, double? arrowOffset, VoidCallback? dismissCallback, double turnOverFromBottom = 50.0}) → voidStatefulWidget> > -
显示 popUpWindow
text
显示的文本内容popKey
依附的组件和 BrnPopUpWindow 组件共同持有的 GlobalKeypopDirection
箭头的方向arrowHeight
箭头的高度,默认 6textStyle
文本样式backgroundColor
popUpWindow 的背景颜色,默认 Color(0xFF1A1A1A)hasCloseIcon
是否显示关闭图标,默认为 false,不显示offset
距离 targetView 垂直方向的偏移量widget
自定义 pop 视图paddingInsets
容器内边距,默认为 EdgeInsets.only(left: 18, top: 14, right: 18, bottom: 14)borderRadius
容器圆角,默认为 4borderColor
边框颜色,默认为 Colors.transparentborderWidth
边框宽度,默认为 1canWrap
是否能多行显,默认 false,单行显示spaceMargin
距离 targetView 边线的距离,默认 20arrowOffset
箭头图标水平方向的绝对偏移量,为 null 时则自动计算dismissCallback
popUpWindow 消失回调,此回调会在 pop 之后执行turnOverFromBottom
popWindow 小于此值的时候,自动将 popWindow 在 targetView 上面弹出,默认 50