show static method

void show({
  1. required BuildContext context,
  2. ThemeData? theme,
  3. int duration = 200,
  4. double opacity = 0.5,
  5. bool dismissible = true,
  6. double height = 500.0,
  7. double titleHeight = 50.0,
  8. double corner = 20.0,
  9. double paddingLeft = 15.0,
  10. Widget? titleWidget,
  11. String? selectText,
  12. Widget? closeWidget,
  13. double tabHeight = 40.0,
  14. bool showTabIndicator = true,
  15. Color? tabIndicatorColor,
  16. double tabIndicatorHeight = 3.0,
  17. double labelTextSize = 15.0,
  18. Color? selectedLabelColor,
  19. Color? unselectedLabelColor,
  20. double itemHeadHeight = 30.0,
  21. Color? itemHeadBackgroundColor,
  22. Color? itemHeadLineColor,
  23. double itemHeadLineHeight = 0.1,
  24. TextStyle? itemHeadTextStyle,
  25. double itemHeight = 40.0,
  26. double indexBarWidth = 28,
  27. double indexBarItemHeight = 20,
  28. Color indexBarBackgroundColor = Colors.black12,
  29. TextStyle? indexBarTextStyle,
  30. Widget? itemSelectedIconWidget,
  31. TextStyle? itemSelectedTextStyle,
  32. TextStyle? itemUnSelectedTextStyle,
  33. List<AddressNode>? initialAddress,
  34. required CityPickerListener cityPickerListener,
})

展示

Implementation

static void show({
  required BuildContext context,
  // 主题颜色
  ThemeData? theme,
  // 底部弹出框动画时间
  int duration = 200,
  // 背景透明度
  double opacity = 0.5,
  // 点击外部是否消失
  bool dismissible = true,
  // 高度
  double height = 500.0,
  // 标题高度
  double titleHeight = 50.0,
  // 顶部圆角
  double corner = 20.0,
  // 距离左边的间距
  double paddingLeft = 15.0,
  // 标题组件
  Widget? titleWidget,
  // 选择文字
  String? selectText,
  // 关闭图标组件
  Widget? closeWidget,
  // tab 高度
  double tabHeight = 40.0,
  // 是否显示指示器
  bool showTabIndicator = true,
  // 指示器颜色
  Color? tabIndicatorColor,
  // 指示器高度
  double tabIndicatorHeight = 3.0,
  // tab 字体大小
  double labelTextSize = 15.0,
  // tab 选中的字体颜色
  Color? selectedLabelColor,
  // tab 未选中的字体颜色
  Color? unselectedLabelColor,
  // item 头部高度
  double itemHeadHeight = 30.0,
  // item 头部背景颜色
  Color? itemHeadBackgroundColor,
  // item 头部分割线颜色
  Color? itemHeadLineColor,
  // item 头部分割线高度
  double itemHeadLineHeight = 0.1,
  // item 头部文字样式
  TextStyle? itemHeadTextStyle,
  // item 高度
  double itemHeight = 40.0,
  // 索引组件宽度
  double indexBarWidth = 28,
  // 索引组件 item 高度
  double indexBarItemHeight = 20,
  // 索引组件背景颜色
  Color indexBarBackgroundColor = Colors.black12,
  // 索引组件文字样式
  TextStyle? indexBarTextStyle,
  // 列表选中的图标组件
  Widget? itemSelectedIconWidget,
  // 列表选中的文字样式
  TextStyle? itemSelectedTextStyle,
  // 列表未选中的文字样式
  TextStyle? itemUnSelectedTextStyle,
  // 地址初始值
  List<AddressNode>? initialAddress,
  // 地址选择器监听事件
  required CityPickerListener cityPickerListener,
}) {
  Navigator.of(context, rootNavigator: true).push(
    CustomPopupRoute(
        theme: theme ?? Theme.of(context),
        duration: duration,
        opacity: opacity,
        dismissible: dismissible,
        child: CityPickerWidget(
          height: height,
          titleHeight: titleHeight,
          corner: corner,
          paddingLeft: paddingLeft,
          titleWidget: titleWidget,
          selectText: selectText,
          closeWidget: closeWidget,
          tabHeight: tabHeight,
          showTabIndicator: showTabIndicator,
          tabIndicatorColor: tabIndicatorColor,
          tabIndicatorHeight: tabIndicatorHeight,
          labelTextSize: labelTextSize,
          selectedLabelColor: selectedLabelColor,
          unselectedLabelColor: unselectedLabelColor,
          itemHeadHeight: itemHeadHeight,
          itemHeadBackgroundColor: itemHeadBackgroundColor,
          itemHeadLineColor: itemHeadLineColor,
          itemHeadLineHeight: itemHeadLineHeight,
          itemHeadTextStyle: itemHeadTextStyle,
          itemHeight: itemHeight,
          indexBarWidth: indexBarWidth,
          indexBarItemHeight: indexBarItemHeight,
          indexBarBackgroundColor: indexBarBackgroundColor,
          indexBarTextStyle: indexBarTextStyle,
          itemSelectedIconWidget: itemSelectedIconWidget,
          itemSelectedTextStyle: itemSelectedTextStyle,
          itemUnSelectedTextStyle: itemUnSelectedTextStyle,
          initialAddress: initialAddress,
          cityPickerListener: cityPickerListener,
        )),
  );
}