updateLanguage method

void updateLanguage({
  1. MaterialHeader? materialHeader,
  2. ClassicFooter? classicFooter,
  3. String? system,
})

切换语言调用,如果里面有string资源需要重新加载

Implementation

void updateLanguage({
  MaterialHeader? materialHeader,
  ClassicFooter? classicFooter,
  String? system,
}) {
  if (materialHeader != null) {
    EasyRefresh.defaultHeaderBuilder = () => materialHeader;
  }
  if (classicFooter != null) {
    EasyRefresh.defaultFooterBuilder = () => classicFooter;
  }
  if (system != null) {
    StringRes.followSystem = system;
    KLanguageUtils.get.updateStrSystem();
  }
}