config static method

dynamic config({
  1. MaterialColor? theme,
  2. Gradient? primaryGradient,
  3. double? radius,
  4. Widget? loadingWidget,
  5. Widget? emptyWidget,
  6. Widget? errorWidget,
  7. Widget noNetworkWidget(
    1. VoidCallback? onReconnect
    )?,
})

Implementation

static config({
  MaterialColor? theme,
  Gradient? primaryGradient,
  double? radius,
  Widget? loadingWidget,
  Widget? emptyWidget,
  Widget? errorWidget,
  Widget Function(VoidCallback? onReconnect)? noNetworkWidget,
}) {
  /// 配置主题
  if (theme != null) {
    CommonColors.theme = theme;
  }
  if (primaryGradient != null) {
    CommonColors.primaryGradient = primaryGradient;
  }
  if (radius != null) {
    CommonStyle.roundedMd = radius;
  }
  if (loadingWidget != null) {
    BaseWidget.loadingWidget = loadingWidget;
  }
  if (emptyWidget != null) {
    BaseWidget.emptyWidget = emptyWidget;
  }
  if (errorWidget != null) {
    BaseWidget.errorWidget = errorWidget;
  }
  if (noNetworkWidget != null) {
    BaseWidget.noNetworkWidget = noNetworkWidget;
  }
}