137 Commits

Author SHA1 Message Date
e4280f0f75 Element2 (#4211) 2025-08-01 18:34:19 +02:00
4c6b999547 Update generated files 2025-07-15 23:26:31 +02:00
94c7ef8dcf Bump freezed 2025-07-15 23:16:51 +02:00
9ee475b381 Generate 2025-07-15 12:55:46 +02:00
0abc9a991b Add classic Freezed regression test 2025-07-02 15:18:14 +02:00
01ed6911a4 Rework mutations (#4170)
## Related Issues

Mutations are reworked to be independent from notifiers and do not
require code-gen.

## Checklist

Before you create this PR confirm that it meets all requirements listed
below by checking the relevant checkboxes (`[x]`).

- [x] I have updated the `CHANGELOG.md` of the relevant packages.
      Changelog files must be edited under the form:

  ```md
  ## Unreleased fix/major/minor

  - Description of your change. (thanks to @yourGithubId)
  ```

- [x] If this contains new features or behavior changes,
      I have updated the documentation to match those changes.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new mutation system that no longer requires code
generation, enabling UI to react to side-effects with loading, success,
and error states.
- Added experimental mutation APIs to Riverpod, Flutter Riverpod, and
Hooks Riverpod packages for enhanced state management.
- Included new mixins and interfaces to simplify creating custom
provider listenables.
- Added widget test helpers and improved mutation state matchers for
testing.

- **Bug Fixes**
- Enhanced error handling and reporting during mutation lifecycle
events.
- Fixed issues with Notifier lifecycle and provider observer context
related to mutations.

- **Refactor**
- Removed legacy mutation annotation logic and related code from
analyzer, generator, and annotation packages.
- Simplified generated provider classes by removing explicit element
creation overrides.
- Updated internal APIs to replace `MutationContext` with direct
`Mutation` usage and adjusted related observer interfaces.

- **Documentation**
- Revised mutation feature documentation to reflect new API design
without code generation.
- Corrected migration guide links and updated changelogs to reflect
annotation and mutation system changes.

- **Tests**
- Added extensive mutation tests covering state transitions,
concurrency, reset behavior, and observer notifications.
- Improved test utilities with new matchers for mutation states and
context.

- **Chores**
- Removed obsolete mutation-related test files, templates, and internal
annotation handling to maintain codebase clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-20 01:23:40 +02:00
5bf55e19a4 Use AsyncValue as internal state for everything (#4141) 2025-06-03 12:23:38 +02:00
4eecf80511 Add Type Arg to ProviderBase/ProviderElement (#4140) 2025-06-02 20:32:45 +02:00
1566bd03fd Simplify Persist (#4131)
This changes the Persist syntax a bit to simplify its usage.

This removes the `with Persistable`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced a new `persistJson` method for JSON-based state
persistence, simplifying how persistence is integrated and allowing for
custom encoding/decoding.
- Added a `key` getter to provide default storage keys for persisted
providers.
- Exposed `NotifierPersistX` and related persistence utilities for
broader use in persistence scenarios.

- **Refactor**
- Unified and updated type signatures for notifiers and persistence
methods, improving type safety and consistency across providers.
- Simplified persistence API usage by removing the need for mixins and
named parameters, favoring direct method calls with positional
arguments.

- **Documentation**
- Updated documentation and code examples to reflect the new persistence
API and usage patterns.

- **Tests**
- Enhanced test coverage to validate the new persistence approach and
updated type signatures.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-05-31 20:47:38 +02:00
f5f2fd3aa8 Generated 2025-04-30 20:41:52 +02:00
38dc5b6c09 Unify codegen and non-codegen overrides 2025-04-24 22:39:56 +02:00
2eca60ca40 Farious refactors (#4081) 2025-04-24 21:34:15 +02:00
05144df889 Make mutations experimental (#4076) 2025-04-24 17:37:49 +02:00
e7cbef0d9f NotifierBase => AnyNotifier 2025-04-23 19:00:36 +02:00
54f3d9a561 Simplify override logic (#4070) 2025-04-21 11:04:07 +02:00
2c09a1a4f7 Sync dev with master (#4068) 2025-04-20 17:58:08 +02:00
61beeb296b Cleanup AutoDispose logic (#4064) 2025-04-15 22:22:29 +02:00
f2de358bba Match dev for notifier modifier (#4063) 2025-04-15 00:32:52 +02:00
3af2f4082e value/valueOrNull => value2 (#4041)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Updated website guides and testing examples to clearly demonstrate
improved asynchronous state handling and data retrieval.
  - Adjusted analyzer settings for a smoother documentation experience.
- **New Features**
- Introduced a refined approach for managing asynchronous states,
providing more consistent behavior during loading and error conditions.
- **Refactor**
- Phased out legacy asynchronous properties in favor of a more robust
implementation.
- **Tests**
- Expanded testing coverage to validate the enhanced lint rules and
asynchronous patterns.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-03-29 23:22:45 +01:00
5a6da3381f Remove path in pubspec (#4040) 2025-03-29 22:37:12 +01:00
c2121e9b07 Migrate to pub workspaces (#4021)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated all Dart SDK constraints to "^3.6.0", added a unified
workspace resolution key, and removed obsolete local dependency override
configurations.
- **CI/CD Improvements**
- Streamlined workflows and refined testing/coverage scripts by removing
outdated steps.
- **Tooling Enhancements**
- Introduced a new build generation script to automate build-runner
tasks.
- **Refactor**
- Applied minor code style refinements, including simplified constructor
syntax and streamlined control flow.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-03-23 22:27:51 +01:00
Eli
171086ddf9 bump (#3989)
fixes #3988
2025-02-28 16:29:20 +01:00
d50001b5e6 Bump dependencies (#3913) 2025-01-08 19:19:00 +01:00
fac2f34962 fix(riverpod_lint): correctly detects nested ref invocations
RefInvocations that take as a parameter another RefInvocation are now correctly detected by the analyzer
2024-10-31 08:11:35 +13:00
f440c21acd Use latest custom_lint 2024-10-27 20:07:17 +01:00
d37af86eb4 Fix ref insert 2024-10-27 04:05:18 +01:00
e7001088b6 Support stable 2024-10-22 13:40:13 +02:00
2e77b4365f More 2024-10-20 18:44:16 +02:00
aa1ae3a352 Refactor 2024-10-20 18:39:05 +02:00
832f23f101 Add fix 2024-10-20 17:24:38 +02:00
917edc8600 Update goldens 2024-10-20 15:15:31 +02:00
4c0b722c5d Update generated code 2024-10-18 19:05:25 +02:00
487a5b9c04 Test that functional_ref lint uses Ref. 2024-10-18 18:40:55 +02:00
aab54f72a9 Update generated code 2024-10-18 18:38:37 +02:00
01965045ac Use Ref only 2024-10-18 18:35:35 +02:00
36dabbe1ea Update codegen 2024-08-15 19:29:00 +02:00
4e2d7acba7 Upgrade custom_lint 2024-08-15 18:49:37 +02:00
1ff2870cfe Deprecate ProviderScope.parent (#3403) 2024-03-09 15:28:07 +01:00
6eb957c2a3 Remove vm_service overrides (#3376) 2024-03-01 12:04:41 +01:00
c87068ff43 Update generated code (#3321) 2024-02-04 19:28:07 +01:00
6b03429427 Bump-custom-lint (#3319) 2024-02-04 16:25:48 +01:00
9d8d5ad467 Force vm_service (#3318) 2024-02-03 06:33:51 +01:00
07d4b86740 Migrate widget field when convert Stateless-based and Stateful-based to each other. (#3275)
In the official Dart `analysis_server` , when converting between
Flutter's `StatefulWidget` and `StatelessWidget`, the `widget` field
used in `StatefulWidget` is automatically added or removed.
However, this was not supported in the Assists within riverpod_lint.

In this PR, I have improved it to include the migration of that field in
the conversion.
2024-02-03 06:19:02 +01:00
4621be59f0 Revert flag (#3316) 2024-02-03 06:01:47 +01:00
8544e84d67 Update goldens (#3315) 2024-02-03 06:00:35 +01:00
a0b8d214a4 Fix CI (#3306) 2024-01-26 11:44:28 +01:00
56fe8e60a7 Update lint goldens to use multiline JSON (#3294) 2024-01-22 13:11:28 +01:00
e6278c00e0 Fix async_value_nullable_pattern false positive when used with generics (#3266)
that have non-nullable type constrains.
2024-01-10 20:35:35 +01:00
a4eb5ea36b lint ci (#3233) 2023-12-22 13:36:44 +01:00
91edef51e9 Freezed update (#3220) 2023-12-15 12:30:40 +01:00