init method

void init({
  1. required BuildContext context,
  2. bool hideCustomTab = true,
  3. List<CustomTabItem>? customTabs,
  4. bool hideBottom = false,
  5. Widget? customBottomWidge,
  6. VoidCallback? btnTap1,
  7. VoidCallback? btnTap2,
  8. VoidCallback? btnTap3,
  9. String? btnTitle1,
  10. String? btnTitle2,
  11. String? btnTitle3,
  12. int printRecord = JhConstants.PRINT_RECORD,
  13. int debugRecord = JhConstants.DEBUG_RECORD,
  14. int tabsInitIndex = JhConstants.TABS_INIT_INDEX,
  15. bool debugModeFull = JhConstants.DEBUG_MODEFULL,
  16. bool scrollFlag = JhConstants.SCROLL_FLAG,
  17. bool recordEnabled = JhConstants.RECORD_ENABLED,
})

初始化组件参数

btnTap1, btnTap2, btnTap3 定义底部按钮点击事件

btnTitle1, btnTitle2, btnTitle3 定义底部按钮的标题

tabsInitIndex 弹出窗口时,指定显示tabs页面, 默认每次弹出显示第0个tabs

hideCustomTab 是否隐藏自定义tabs栏,默认true隐藏

customTabs 自定义tabs显示的组件

hideBottom 是否隐藏底部区域块,当为ture隐藏时,bottomWidge自定义底部区域将无效

customBottomWidge 底部区域组件,如果定义此参数默认定义的底部组件不显示

printRecord print日志最多记录多少条,默认50条

debugRecord 调试日志最多记录多少条,默认30条

debugModeFull 调试日志中-是否显示详细日志, 默认flase精简日志, true详细日志

scrollFlag 是否开启内容区域左右滑动tab功能,默认开启

recordEnabled 是否开启记录log模式,生产环境可以关闭提高APP性能

Implementation

void init({
  required BuildContext context,
  bool hideCustomTab = true,
  List<CustomTabItem>? customTabs,
  bool hideBottom = false,
  Widget? customBottomWidge,
  VoidCallback? btnTap1,
  VoidCallback? btnTap2,
  VoidCallback? btnTap3,
  String? btnTitle1,
  String? btnTitle2,
  String? btnTitle3,
  int printRecord = JhConstants.PRINT_RECORD,
  int debugRecord = JhConstants.DEBUG_RECORD,
  int tabsInitIndex = JhConstants.TABS_INIT_INDEX,
  bool debugModeFull = JhConstants.DEBUG_MODEFULL,
  bool scrollFlag = JhConstants.SCROLL_FLAG,
  bool recordEnabled = JhConstants.RECORD_ENABLED,
}) async {
  // 初始化弹层日志组件
  _layerWidget = TabsWrap(
    hideCustomTab: hideCustomTab,
    customTabs: customTabs,
    tabsInitIndex: tabsInitIndex,
    hideBottom: hideBottom,
    customBottomWidge: customBottomWidge,
    btnTap1: btnTap1,
    btnTap2: btnTap2,
    btnTap3: btnTap3,
    btnTitle1: btnTitle1,
    btnTitle2: btnTitle2,
    btnTitle3: btnTitle3,
  );

  jhConfig.printRecord = printRecord;
  jhConfig.debugRecord = debugRecord;
  jhConfig.debugModeFull = debugModeFull;

  jhConfig.scrollFlag = scrollFlag;
  jhConfig.recordEnabled = recordEnabled;

  _initFlag = true;
  _context = context;
}