completeApiMock_whenNull method
初始化完成后继续完善信息,此方法只为了做测试,开发情况下使用 tryAddApi 来添加 apiModel
Implementation
// ignore: non_constant_identifier_names
Future completeApiMock_whenNull({
// ignore: non_constant_identifier_names
required List<ApiModel> apiModels_whenNull,
}) async {
if (_apiModels == null || _apiModels!.isEmpty) {
_apiModels = await ApiSharedPreferenceUtil().getApiList();
if (_apiModels!.isEmpty) {
_apiModels = apiModels_whenNull;
ApiSharedPreferenceUtil().setApiList(_apiModels!);
}
}
}