SpinnerBox constructor
SpinnerBox({
- Key? key,
- required PopupValueNotifier controller,
- required List<
SpinnerPopScope> children, - Widget? prefix,
- bool isExpandPrefix = false,
- Widget? suffix,
- bool isExpandSuffix = false,
- SpinnerHeaderTheme theme = defaultPinnerTheme,
- Color? barrierColor,
- SpinnerViewTransitionsBuilder? transitionsBuilder,
- SpinnerBoxIntercept? onIntercept,
普通构建方式,必须对数据源进行监听,否则下次弹窗不会保存历史选中数据
使用示例:
final controller = PopupValueNotifier.titles(const ['title1', 'tilte2']);
...
SpinnerBox(
controller: controller,
children: [
CustomWidget().heightPart,
...
],
),
控制器方法:
notifier.updateName('update-title1');
'or' notifier.close();
'or' notifier.reset();
Implementation
SpinnerBox({
super.key,
required PopupValueNotifier controller,
// required this.titles,
required List<SpinnerPopScope> children,
this.prefix,
this.isExpandPrefix = false,
this.suffix,
this.isExpandSuffix = false,
this.theme = defaultPinnerTheme,
this.barrierColor,
this.transitionsBuilder,
this.onIntercept,
}) {
isRebuilder = false;
spinnerController = controller;
widgets = children;
}