BrnSelectedListActionSheet<T> class

描述: 已选菜单列表

  1. 初始化完成之后,调用 show 展示弹窗,调用 dismiss 关闭弹窗。 <20210618更>:也可以使用 showWithTargetKey 方法展示弹窗,传入已选列表底部组件绑定的 globalKey,已选列表会 自动与 globalKey 绑定的组件左右对齐,并从其顶部弹出。clear
  2. 外界需要自己监听 Android 上的系统返回事件,并且调用组件的 dismiss 方法!否则,组件不能正常关闭。

Constructors

BrnSelectedListActionSheet({required BuildContext context, double maxHeight = 290, double bottomOffset = 82, String? title, Widget? titleWidget, bool isClearButtonHidden = false, bool isDeleteButtonHidden = false, Image? itemIconImage, required List<T> items, required BrnItemTitleBuilder<T> itemTitleBuilder, VoidCallback? onClear, VoidCallback? onClearConfirmed, VoidCallback? onClearCanceled, BrnItemDeleteCallback<T>? onItemDelete, VoidCallback? onListShowed, BrnListDismissCallback? onListDismissed, BrnSelectedListActionSheetController? controller})
create BrnSelectedListActionSheet

Properties

bottomOffset double
列表结束显示时底部的 y。0 会和屏幕的底部重合。默认值 82。不能为负值!
final
context BuildContext
用来获取 Overlay
final
controller BrnSelectedListActionSheetController?
控制视图隐藏/刷新列表等方法
final
hashCode int
The hash code for this object.
no setterinherited
isClearButtonHidden bool
清空按钮是否显示,默认为 false
final
isDeleteButtonHidden bool
每一行删除按钮是否展示。默认为 false。如果不显示,自定义每一行 widget 时内容可以填充整行
final
itemIconImage Image?
每一行前边的 icon,可不传。如果该 image 没有设置,并且 itemTitleBuilder 返回的是自定义 widget,则该 widget 自动填充整行区域
final
items List<T>
数据源列表
final
itemTitleBuilder BrnItemTitleBuilder<T>
获取对应 index 行内容的回调。类型必须为 String 或者自定义的 widget.自定义 widget 时,左边的 icon 会自动隐藏,自定义widget填充整行。
final
maxHeight double
视图的最大高度。默认值 290,列表的内容的高度=maxHeight-65
final
onClear VoidCallback?
点击清空按钮后的回调,如果没有实现该回调,则会显示默认弹窗。如果要关闭已选列表,请调用 dismiss()。
final
onClearCanceled VoidCallback?
清空按钮点击显示默认确认弹窗之后,取消 按钮的点击回调
final
onClearConfirmed VoidCallback?
清空按钮点击显示默认确认弹窗之后,确定 按钮的点击回调
final
onItemDelete BrnItemDeleteCallback<T>?
每一行删除按钮的点击回调。返回值:是否要删除该 entity,如果该 handler 没有实现或者返回 true,则删除
final
onListDismissed BrnListDismissCallback?
视图隐藏时的回调,会把是否是清空按钮触发的销毁视图回传
final
onListShowed VoidCallback?
视图显示时的回调
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
标题名称。默认不限制行数 默认TextStyle样式:
final
titleWidget Widget?
自定义标题视图。默认外层有 const EdgeInsets.fromLTRB(20, 20, 20, 15) 的 padding,且优先级比 title
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
show() → void
展示弹层
showWithTargetKey({required GlobalKey<State<StatefulWidget>> bottomWidgetKey}) → void
bottomWidgetKey: 已选列表下边操作区域绑定的 GlobalKey,已选列表会自动与操作区域左右对齐,且从操作区域的顶部滑出
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited