SpinnerBox constructor

SpinnerBox({
  1. Key? key,
  2. required PopupValueNotifier controller,
  3. required List<SpinnerPopScope> children,
  4. Widget? prefix,
  5. bool isExpandPrefix = false,
  6. Widget? suffix,
  7. bool isExpandSuffix = false,
  8. SpinnerHeaderTheme theme = defaultPinnerTheme,
  9. Color? barrierColor,
  10. SpinnerViewTransitionsBuilder? transitionsBuilder,
  11. 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;
}