Skip to content

Commit

Permalink
Move riverpod3 branch to dev branch (#2487)
Browse files Browse the repository at this point in the history
  • Loading branch information
rrousselGit authored Oct 28, 2023
1 parent 6f898c0 commit 5e96379
Show file tree
Hide file tree
Showing 160 changed files with 3,622 additions and 1,545 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
strategy:
matrix:
channel:
- stable
- master
package_path:
- examples/counter
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=3.0.0-0.0-dev <4.0.0"

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/marvel/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.
publish_to: "none"

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0-0.0-dev <4.0.0"
flutter: ">=1.17.0"

dependencies:
Expand Down
10 changes: 4 additions & 6 deletions examples/pub/lib/detail.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions examples/pub/lib/search.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/random_number/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.
publish_to: 'none'

environment:
sdk: ">=2.14.0 <3.0.0"
sdk: ">=3.0.0-0.0-dev <4.0.0"

dependencies:
flutter:
Expand Down
2 changes: 1 addition & 1 deletion examples/stackoverflow/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A new Flutter project.
publish_to: "none"

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0-0.0-dev <4.0.0"
flutter: ">=1.17.0"

dependencies:
Expand Down
8 changes: 8 additions & 0 deletions packages/flutter_riverpod/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Unreleased 3.0.0-dev.0

- **Breaking**: `AsyncValue` is now "sealed" and `AsyncData/AsyncLoading/AsyncError`
are "final". This means that it is no-longer possible to subclass
`AsyncValue` or the associated classes.
- **Breaking**: Removed everything marked as "deprecated"
- Bumped minimum Dart SDK to >= 3.0.0-dev

## 2.4.4 - 2023-10-15

- `riverpod` upgraded to `2.4.4`
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_riverpod/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A new Flutter project.
publish_to: "none"

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0-0.0-dev <4.0.0"

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class AutoDisposeChangeNotifierProvider<NotifierT extends ChangeNotifier?>
this._createFn, {
super.name,
super.dependencies,
@Deprecated('Will be removed in 3.0.0') super.from,
@Deprecated('Will be removed in 3.0.0') super.argument,
@Deprecated('Will be removed in 3.0.0') super.debugGetCreateSourceHash,
}) : super(
allTransitiveDependencies:
computeAllTransitiveDependencies(dependencies),
from: null,
argument: null,
debugGetCreateSourceHash: null,
);

/// An implementation detail of Riverpod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ class ChangeNotifierProvider<NotifierT extends ChangeNotifier?>
this._createFn, {
super.name,
super.dependencies,
@Deprecated('Will be removed in 3.0.0') super.from,
@Deprecated('Will be removed in 3.0.0') super.argument,
@Deprecated('Will be removed in 3.0.0') super.debugGetCreateSourceHash,
}) : super(
allTransitiveDependencies:
computeAllTransitiveDependencies(dependencies),
from: null,
argument: null,
debugGetCreateSourceHash: null,
);

/// An implementation detail of Riverpod
Expand Down Expand Up @@ -146,7 +146,7 @@ class ChangeNotifierProvider<NotifierT extends ChangeNotifier?>
/// ProviderScope(
/// overrides: [
/// // Replace the implementation of the provider with a different one
/// myService.overrideWithProvider((ref) {
/// myService.overrideWith((ref) {
/// ref.watch('other');
/// return MyFakeService(),
/// })),
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter_riverpod/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ funding:
- https://github.com/sponsors/rrousselGit/

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0+0.0-dev <4.0.0"
flutter: ">=3.0.0"

dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,14 @@ void main() {
// expect(root.getAllProviderElements(), isEmpty);
// });

test('when using provider.overrideWithProvider', () {
test('when using provider.overrideWith', () {
final provider =
ChangeNotifierProvider.autoDispose((ref) => ValueNotifier(0));
final root = createContainer();
final container = createContainer(
parent: root,
overrides: [
// ignore: deprecated_member_use
provider.overrideWithProvider(
ChangeNotifierProvider.autoDispose((ref) => ValueNotifier(42)),
),
provider.overrideWith((ref) => ValueNotifier(42)),
],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,13 @@ void main() {
// expect(root.getAllProviderElements(), isEmpty);
// });

test('when using provider.overrideWithProvider', () {
test('when using provider.overrideWith', () {
final provider = ChangeNotifierProvider((ref) => ValueNotifier(0));
final root = createContainer();
final container = createContainer(
parent: root,
overrides: [
// ignore: deprecated_member_use
provider.overrideWithProvider(
ChangeNotifierProvider((ref) => ValueNotifier(42)),
),
provider.overrideWith((ref) => ValueNotifier(42)),
],
);

Expand Down Expand Up @@ -408,16 +405,15 @@ void main() {
expect(root.getAllProviderElements(), isEmpty);
});

test('overrideWithProvider preserves the state across update', () async {
test('overrideWith preserves the state across update', () async {
final provider = ChangeNotifierProvider((_) {
return TestNotifier();
});
final notifier = TestNotifier();
final notifier2 = TestNotifier();
final container = createContainer(
overrides: [
// ignore: deprecated_member_use
provider.overrideWithProvider(ChangeNotifierProvider((_) => notifier)),
provider.overrideWith((_) => notifier),
],
);
addTearDown(container.dispose);
Expand All @@ -436,8 +432,7 @@ void main() {
expect(callCount, 1);

container.updateOverrides([
// ignore: deprecated_member_use
provider.overrideWithProvider(ChangeNotifierProvider((_) => notifier2)),
provider.overrideWith((_) => notifier2),
]);

await container.pump();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,14 @@ void main() {
expect(root.getAllProviderElements(), isEmpty);
});

test('when using provider.overrideWithProvider', () async {
test('when using provider.overrideWith', () async {
final provider = ChangeNotifierProvider.autoDispose
.family<ValueNotifier<int>, int>((ref, _) => ValueNotifier(0));
final root = createContainer();
final container = createContainer(
parent: root,
overrides: [
provider.overrideWithProvider(
(value) => ChangeNotifierProvider.autoDispose(
(ref) => ValueNotifier(42),
),
),
provider.overrideWith((ref, value) => ValueNotifier(42)),
],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,15 @@ void main() {
expect(root.getAllProviderElements(), isEmpty);
});

test('when using provider.overrideWithProvider', () async {
test('when using provider.overrideWith', () async {
final provider = ChangeNotifierProvider.family<ValueNotifier<int>, int>(
(ref, _) => ValueNotifier(0),
);
final root = createContainer();
final container = createContainer(
parent: root,
overrides: [
provider.overrideWithProvider(
(value) => ChangeNotifierProvider((ref) => ValueNotifier(42)),
),
provider.overrideWith((ref, value) => ValueNotifier(42)),
],
);

Expand All @@ -101,10 +99,7 @@ void main() {
});
final container = createContainer(
overrides: [
provider.overrideWithProvider(
(value) =>
ChangeNotifierProvider((ref) => ValueNotifier(value * 2)),
),
provider.overrideWith((ref, value) => ValueNotifier(value * 2)),
],
);

Expand Down
8 changes: 8 additions & 0 deletions packages/hooks_riverpod/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Unreleased 3.0.0-dev.0

- **Breaking**: `AsyncValue` is now "sealed" and `AsyncData/AsyncLoading/AsyncError`
are "final". This means that it is no-longer possible to subclass
`AsyncValue` or the associated classes.
- **Breaking**: Removed everything marked as "deprecated"
- Bumped minimum Dart SDK to >= 3.0.0-dev

## 2.4.4 - 2023-10-15

- `flutter_riverpod` upgraded to `2.4.4`
Expand Down
4 changes: 2 additions & 2 deletions packages/hooks_riverpod/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Counter extends StateNotifier<int> {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -43,7 +43,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends HookConsumerWidget {
const MyHomePage({Key? key}) : super(key: key);
const MyHomePage({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks_riverpod/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A new Flutter project.
publish_to: "none"

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=3.0.0-0.0-dev <4.0.0"
flutter: ">=1.17.0"

dependencies:
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks_riverpod/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ funding:
- https://github.com/sponsors/rrousselGit/

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0+0.0-dev <4.0.0"
flutter: ">=3.0.0"

dependencies:
Expand Down
14 changes: 9 additions & 5 deletions packages/riverpod/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## Unreleased fix
## Unreleased 3.0.0-dev.0

- Support assigning `AsyncValue<T>` to `AsyncNotifier<void>.state`
- **Breaking**: `AsyncValue` is now "sealed" and `AsyncData/AsyncLoading/AsyncError`
are "final". This means that it is no-longer possible to subclass
`AsyncValue` or the associated classes.
- **Breaking**: Removed everything marked as "deprecated"
- Bumped minimum Dart SDK to >= 3.0.0-dev

## 2.4.4 - 2023-10-15

Expand Down Expand Up @@ -387,7 +391,7 @@ Riverpod is now stable!
- **Breaking** The return value when reading a `StateProvider` changed.
Before, doing `ref.read(someStateProvider)` would return the `StateController` instance.
Now, this will only return the state of the `StateController`.
This new behaviour matches `StateNotifierProvider`.
This new behavior matches `StateNotifierProvider`.

For a simple migration, the old behavior is available by writing
`ref.read(someStateProvider.state)`.
Expand Down Expand Up @@ -665,7 +669,7 @@ Fix an issue where `*Provider.autoDispose` were not able to specify the
### Bug-fixes

- fixed a bug where providers were rebuilding even when not being listened to
- fixed `ref.listen` now working when downcasting the value of a provider.
- fixed `ref.listen` now working when downcasing the value of a provider.
- fixed a bug where disposing a scoped `ProviderContainer` could cause other
`ProviderContainer`s to stop working.
- fixed an issue where conditionally depending on an "autoDispose" provider
Expand Down Expand Up @@ -804,7 +808,7 @@ Removed an assert that could cause issues when an application is partially migra

## 0.14.0+1

- Re-added `StateProvider.overrideWithValue`/`StateProvider.overrideWithProvider` that were unvoluntarily removed.
- Re-added `StateProvider.overrideWithValue`/`StateProvider.overrideWithProvider` that were involuntarily removed.

## 0.14.0

Expand Down
2 changes: 1 addition & 1 deletion packages/riverpod/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: riverpod_example
publish_to: "none"

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=3.0.0-0.0-dev <4.0.0"

dependencies:
crypto: ^3.0.0
Expand Down
Loading

0 comments on commit 5e96379

Please sign in to comment.