config static method
dynamic
config({
- MaterialColor? theme,
- Gradient? primaryGradient,
- double? radius,
- Widget? loadingWidget,
- Widget? emptyWidget,
- Widget? errorWidget,
- Widget noNetworkWidget(
- 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;
}
}