We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug vipTypeListInfoProvider.notifierwill show lint avoid_manual_providers_as_generated_provider_dependency
vipTypeListInfoProvider.notifier
avoid_manual_providers_as_generated_provider_dependency
To Reproduce This is my code
import 'package:qlzm_color_flutter/model/response/vip_type_list_response.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../network/api/pay_api.dart'; import '../util/app_util.dart'; import '../util/storage_util.dart'; part 'vip_riverpod.g.dart'; @riverpod Future<void> refreshVipTypeList(RefreshVipTypeListRef ref) async { VipTypeListResponse response = await PayApi.getVipTypeList(); List<VipTypeListData>? vipTypeList = response.data; await StorageUtil().write(StorageUtil.keyVipTypeList, vipTypeList); ref.read(vipTypeListInfoProvider.notifier).set(vipTypeList); } @Riverpod(keepAlive: true) class VipTypeListInfo extends _$VipTypeListInfo { @override List<VipTypeListData>? build() { List<VipTypeListData>? vipTypeList = StorageUtil() .read<List<VipTypeListData>>(StorageUtil.keyVipTypeList, fromJson: (jsonList) { if (jsonList is List) { return jsonList.map((json) { return VipTypeListData.fromJson(json); }).toList(); } return <VipTypeListData>[]; }); return vipTypeList; } set(List<VipTypeListData>? vipTypeList) { state = vipTypeList; AppUtil().saveVipTypeList(vipTypeList); } }
Expected behavior I'm not sure if it's a code issue or a Lint error
The text was updated successfully, but these errors were encountered:
Generally, it's just the IDE that's out of date. You're most likely facing dart-lang/sdk#54113.
Does the warning disappear if you restart the IDE or open the generated file?
Sorry, something went wrong.
Generally, it's just the IDE that's out of date. You're most likely facing dart-lang/sdk#54113. Does the warning disappear if you restart the IDE or open the generated file?
Restart the IDE or reopen the generated file, lint will not disappear.
When I added a parameter and run build_runner build, Lint disappeared.
run build_runner build
@riverpod Future<void> refreshVipTypeList( RefreshVipTypeListRef ref, { bool showLoading = false, })
My Flutter version is 3.19.3 flutter_riverpod: 2.5.1 riverpod_annotation: 2.3.5 riverpod_generator: 2.4.0 riverpod_lint: 2.3.10
I haven't tried the method of upgrading IDE and Flutter yet, but I will try it out in the future.
rrousselGit
No branches or pull requests
Describe the bug
vipTypeListInfoProvider.notifier
will show lintavoid_manual_providers_as_generated_provider_dependency
To Reproduce
This is my code
Expected behavior
I'm not sure if it's a code issue or a Lint error
The text was updated successfully, but these errors were encountered: