Skip to content

Commit 0d19818

Browse files
authored
chore: Fix typos (#4065)
1 parent 61beeb2 commit 0d19818

File tree

55 files changed

+192
-193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+192
-193
lines changed

packages/flutter_riverpod/test/future_provider_test.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void main() {
7777
expect(whenStack, isNotNull);
7878
});
7979

80-
testWidgets("future completes after unmount does't crash", (tester) async {
80+
testWidgets("future completes after unmount doesn't crash", (tester) async {
8181
final completer = Completer<int>();
8282
final futureProvider = FutureProvider((s) => completer.future);
8383

@@ -101,7 +101,7 @@ void main() {
101101
await Future<void>.value();
102102
});
103103

104-
testWidgets("future fails after unmount does't crash", (tester) async {
104+
testWidgets("future fails after unmount doesn't crash", (tester) async {
105105
final completer = Completer<int>();
106106
final futureProvider = FutureProvider((s) => completer.future);
107107

packages/riverpod/lib/src/core/element.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ The provider ${_debugCurrentlyBuildingElement!.origin} modified $origin while bu
958958
void onDispose(void Function() listener) {
959959
_assertNotOutdated();
960960
if (!_mounted) {
961-
throw StateError('Cannot call onDispose after a provider was dispose');
961+
throw StateError('Cannot call onDispose after a provider was disposed');
962962
}
963963
_onDisposeListeners ??= [];
964964
_onDisposeListeners!.add(listener);

packages/riverpod/lib/src/core/ref.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ abstract class Ref<State extends Object?> {
5959
/// But if a provider is not listened to, the rebuild may be delayed until
6060
/// the provider is listened to again.
6161
///
62-
/// Calling [invalidate] multiple times will cause a single recomputation of the state.
62+
/// Calling [invalidate] multiple times will cause a single recomputation of
63+
/// the state.
6364
///
6465
/// If used on a provider which is not initialized or disposed,
6566
/// this method will have no effect.

packages/riverpod/test/old/framework/provider_container_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ void main() {
502502
});
503503

504504
test(
505-
'list only elements associated with the container (ignoring inherited and descendent elements)',
505+
'list only elements associated with the container (ignoring inherited and descendant elements)',
506506
() {
507507
final provider = Provider((ref) => 0);
508508
final provider2 = Provider((ref) => 0);

packages/riverpod/test/old/framework/provider_element_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ void main() {
11671167

11681168
// schedules `dep` and `dependent` to rebuild
11691169
// Will build `dependent` before `dep` because `dependent` doesn't depend on `dep` yet
1170-
// And since nothing is watchin `dep` at the moment, then `dependent` will
1170+
// And since nothing is watching `dep` at the moment, then `dependent` will
11711171
// rebuild before `dep` even though `dep` is its ancestor.
11721172
// This is fine since nothing is listening to `dep` yet, but it should
11731173
// not cause certain assertions to trigger

packages/riverpod/test/src/providers/async_notifier_test.dart

+7-9
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,11 @@ void main() {
458458

459459
final sub = container.listen(provider.notifier, (previous, next) {});
460460

461-
// ignore: prefer_const_constructors, not using `const` as we voluntarility break identity to test `identical`
461+
// ignore: prefer_const_constructors, not using `const` as we voluntarily break identity to test `identical`
462462
final newState = AsyncData(84);
463-
// ignore: prefer_const_constructors, not using `const` as we voluntarility break identity to test `identical`
463+
// ignore: prefer_const_constructors, not using `const` as we voluntarily break identity to test `identical`
464464
final newLoading = AsyncLoading<int>();
465-
// ignore: prefer_const_constructors, not using `const` as we voluntarility break identity to test `identical`
465+
// ignore: prefer_const_constructors, not using `const` as we voluntarily break identity to test `identical`
466466
final newError = AsyncError<int>(84, StackTrace.empty);
467467

468468
sub.read().state = newState;
@@ -704,7 +704,7 @@ void main() {
704704
await expectLater(sub.read().future, completion(1));
705705
});
706706

707-
test('retuns a Future identical to that of .future', () {
707+
test('returns a Future identical to that of .future', () {
708708
final listener = OnBuildMock();
709709
final dep = StateProvider((ref) => 0);
710710
final provider = factory.simpleTestProvider<int>(
@@ -806,7 +806,7 @@ void main() {
806806
);
807807
});
808808

809-
group('AsyncNotifer.update', () {
809+
group('AsyncNotifier.update', () {
810810
test('passes in the latest state', () async {
811811
final container = ProviderContainer.test();
812812
final provider = factory.simpleTestProvider<int>(
@@ -870,8 +870,7 @@ void main() {
870870
expect(container.read(provider), const AsyncData(21));
871871
});
872872

873-
test(
874-
'executes immediately with current state if a state is avalailable',
873+
test('executes immediately with current state if a state is available',
875874
() async {
876875
final container = ProviderContainer.test();
877876
final provider = factory.simpleTestProvider<int>((ref) => 1);
@@ -887,8 +886,7 @@ void main() {
887886
expect(container.read(provider), const AsyncData(2));
888887
});
889888

890-
test(
891-
'executes immediately with current state if an error is avalailable',
889+
test('executes immediately with current state if an error is available',
892890
() async {
893891
final container = ProviderContainer.test();
894892
final provider = factory.simpleTestProvider<int>(

packages/riverpod/test/src/providers/notifier_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void main() {
295295
});
296296

297297
test(
298-
'Reading the state inside the notifier rethrows initilization error, if any',
298+
'Reading the state inside the notifier rethrows initialization error, if any',
299299
() {
300300
final provider = factory
301301
.simpleTestProvider<int>((ref) => throw UnimplementedError());

packages/riverpod/test/src/providers/stream_notifier_test.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,11 @@ void main() {
359359
final sub = container.listen(provider.notifier, (previous, next) {});
360360
await container.read(provider.future);
361361

362-
// ignore: prefer_const_constructors, not using `const` as we voluntarility break identity to test `identical`
362+
// ignore: prefer_const_constructors, not using `const` as we voluntarily break identity to test `identical`
363363
final newState = AsyncData(84);
364-
// ignore: prefer_const_constructors, not using `const` as we voluntarility break identity to test `identical`
364+
// ignore: prefer_const_constructors, not using `const` as we voluntarily break identity to test `identical`
365365
final newLoading = AsyncLoading<int>();
366-
// ignore: prefer_const_constructors, not using `const` as we voluntarility break identity to test `identical`
366+
// ignore: prefer_const_constructors, not using `const` as we voluntarily break identity to test `identical`
367367
final newError = AsyncError<int>(84, StackTrace.empty);
368368

369369
sub.read().state = newState;
@@ -721,7 +721,7 @@ void main() {
721721
);
722722
});
723723

724-
group('AsyncNotifer.update', () {
724+
group('AsyncNotifier.update', () {
725725
test('passes in the latest state', () async {
726726
final container = ProviderContainer.test();
727727
final provider = factory.simpleTestProvider<int>(

packages/riverpod_analyzer_utils/lib/src/riverpod_ast/visitor.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ class RiverpodAstRegistry {
756756
}
757757
}
758758

759-
// Voluntarily not extenting RiverpodAstVisitor to trigger a compilation error
759+
// Voluntarily not extending RiverpodAstVisitor to trigger a compilation error
760760
// when new nodes are added.
761761
class _RiverpodAstRegistryVisitor extends RiverpodAstVisitor {
762762
_RiverpodAstRegistryVisitor(this._registry);

packages/riverpod_generator/lib/src/riverpod_generator.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class RiverpodInvalidGenerationSourceError
4848

4949
final AstNode? astNode;
5050

51-
// TODO overrride toString to render AST nodes.
51+
// TODO override toString to render AST nodes.
5252
}
5353

5454
@immutable

packages/riverpod_generator/test/integration/split.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Regresion test for https://github.com/rrousselGit/riverpod/issues/2175
1+
// Regression test for https://github.com/rrousselGit/riverpod/issues/2175
22
import 'package:riverpod/riverpod.dart';
33
import 'package:riverpod_annotation/riverpod_annotation.dart';
44

packages/riverpod_lint/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Bump custom_lint
9393

9494
## 2.3.0 - 2023-10-06
9595

96-
- Added `async_value_nullable_patttern` lint, to warn against using `AsyncValue(:final value?)` in pattern match when `value` is possibly nullable.
96+
- Added `async_value_nullable_pattern` lint, to warn against using `AsyncValue(:final value?)` in pattern match when `value` is possibly nullable.
9797
- Added `protected_notifier_state` lint, which warns against using the `Notifier.state`
9898
property of a notifier different than the current one.
9999
Aka a Notifier "A" should not directly access the `state` if a Notifier "B".

packages/riverpod_lint/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Riverpod_lint adds various warnings with quick fixes and refactoring options, su
5252
- [notifier\_extends (riverpod\_generator only)](#notifier_extends-riverpod_generator-only)
5353
- [avoid\_ref\_inside\_state\_dispose](#avoid_ref_inside_state_dispose)
5454
- [notifier\_build (riverpod\_generator only)](#notifier_build-riverpod_generator-only)
55-
- [async\_value\_nullable\_patttern](#async_value_nullable_patttern)
55+
- [async\_value\_nullable\_pattern](#async_value_nullable_pattern)
5656
- [protected\_notifier\_properties](#protected_notifier_properties)
5757
- [All assists](#all-assists)
5858
- [Wrap widgets with a `Consumer`](#wrap-widgets-with-a-consumer)
@@ -611,7 +611,7 @@ class Example extends _$Example {
611611
class Example extends _$Example {}
612612
```
613613

614-
### async_value_nullable_patttern
614+
### async_value_nullable_pattern
615615

616616
Warn if the pattern `AsyncValue(:final value?)` is used when the data
617617
is possibly nullable.

packages/riverpod_lint/lib/src/assists/convert_to_stateful_base_widget.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class $createdStateClassName extends $baseStateName<${widgetClass.name}> {
231231
}
232232
}
233233

234-
// Original implemenation in
234+
// Original implementation in
235235
// package:analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateful_widget.dart
236236
class _FieldFinder extends RecursiveAstVisitor<void> {
237237
Set<FieldElement> fieldsAssignedInConstructors = {};

packages/riverpod_lint/lib/src/assists/convert_to_stateless_base_widget.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class ConvertToStatelessBaseWidget extends RiverpodAssist {
275275
}
276276
}
277277

278-
// Original implemenation in
278+
// Original implementation in
279279
// package:analysis_server/lib/src/services/correction/dart/flutter_convert_to_stateless_widget.dart
280280
class _FieldFinder extends RecursiveAstVisitor<void> {
281281
final fieldsAssignedInConstructors = <FieldElement>{};

packages/riverpod_lint/lib/src/assists/convert_to_widget_utils.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ ClassDeclaration? findStateClass(ClassDeclaration widgetClass) {
151151
});
152152
}
153153

154-
// Original implemenation in package:analyzer/lib/src/dart/ast/extensions.dart
154+
// Original implementation in package:analyzer/lib/src/dart/ast/extensions.dart
155155
extension IdentifierExtension on Identifier {
156156
Element? get writeOrReadElement {
157157
return _writeElement(this) ?? staticElement;

website/docs/concepts/about_hooks.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ such as [TextEditingController](https://api.flutter.dev/flutter/widgets/TextEdit
4949
[AnimationController](https://api.flutter.dev/flutter/animation/AnimationController-class.html).
5050
They can also serve as a replacement to the "builder" pattern, replacing widgets
5151
such as [FutureBuilder](https://api.flutter.dev/flutter/widgets/FutureBuilder-class.html)/[TweenAnimatedBuilder](https://api.flutter.dev/flutter/widgets/TweenAnimationBuilder-class.html)
52-
by an alterative that does not invole "nesting" – drastically improving readability.
52+
by an alternative that does not involve "nesting" – drastically improving readability.
5353

5454
In general, hooks are helpful for:
5555

website/docs/essentials/auto_dispose.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Although in this case, this will always result in a new state being created.
121121

122122
:::tip
123123
When trying to invalidate a provider which receives parameters,
124-
it is posible to either invalidate one specific parameter combination,
124+
it is possible to either invalidate one specific parameter combination,
125125
or all parameter combinations at once:
126126

127127
<AutoSnippet {...invalidateFamilyExample} />

website/docs/essentials/first_request.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ Instead of writing a `StatelessWidget`/`StatefulWidget` returns a `Consumer`, we
309309
define a `ConsumerWidget`/`ConsumerStatefulWidget`.
310310
`ConsumerWidget` and `ConsumerStatefulWidget` are effectively the fusion
311311
of a `StatelessWidget`/`StatefulWidget` and a `Consumer`. They behave the same
312-
as their original couterpart, but with the added benefit of offering a "ref".
312+
as their original counterpart, but with the added benefit of offering a "ref".
313313

314314
We can rewrite the previous examples to use `ConsumerWidget` as followed:
315315

website/docs/essentials/side_effects.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ This method should not be called directly.
194194
/>
195195
</When>
196196

197-
<!-- Some separation for good mesure -->
197+
<!-- Some separation for good measure -->
198198

199199
<When codegen={true}>
200200
<Legend
@@ -386,7 +386,7 @@ This can be done by calling `ref.invalidateSelf()` after the _POST_ request:
386386
### Updating the local cache manually
387387

388388
Another option is to update the local cache manually.
389-
This would involve trying to mimick the backend's behavior.
389+
This would involve trying to mimic the backend's behavior.
390390
For instance, we would need to know whether the backend inserts new items
391391
at the start or at the end.
392392

website/docs/from_provider/motivation/motivation.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ In particular, this section should answer the following:
2222
- Can I migrate incrementally?
2323
- etc.
2424

25-
By the end of this section you should be convinced that Riverpod is to be prefered over Provider.
25+
By the end of this section you should be convinced that Riverpod is to be preferred over Provider.
2626

2727
**Riverpod is indeed a more modern, recommended and reliable approach when compared to Provider**.
2828

29-
Riverpod offers better State Management capabilities, better Caching strategies and a simplified Reactivty model.
29+
Riverpod offers better State Management capabilities, better Caching strategies and a simplified Reactivity model.
3030
Whereas, Provider is currently lacking in many areas with no way forward.
3131

3232
## Provider's Limitations
@@ -73,7 +73,7 @@ has changed (e.g. such as when there's a GlobalKey involved in the widget tree).
7373
Nonetheless, Provider has an ad-hoc solution named `ProxyProvider`, but it's considered tedious and error-prone.
7474

7575
Combining state is a core Riverpod mechanism, as we can combine and cache values reactively with zero overhead
76-
with simple yet powerful utilites such as [ref.watch] and [ref.listen]:
76+
with simple yet powerful utilities such as [ref.watch] and [ref.listen]:
7777

7878
<AutoSnippet language="dart" {...combine}></AutoSnippet>
7979

@@ -121,7 +121,7 @@ Thus, obtaining a `.family` equivalent for Provider is fundamentally impossible
121121
To be able to write a test, you *have to* re-define providers inside each test.
122122

123123
With Riverpod, providers are ready to use inside tests, by default. Furthermore, Riverpod exposes a
124-
handy collection of "overriding" utilites that are crucial when mocking Providers.
124+
handy collection of "overriding" utilities that are crucial when mocking Providers.
125125

126126
Testing the combined state snippet above would be as simple as the following:
127127

website/docs/from_provider/quickstart.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ A full guide about eager initialization of pkg:Riverpod's providers [is availabl
151151
As a side note, chances are that when metaprogramming will be a thing, codegen will be default for Riverpod.
152152

153153
Unluckily, `@riverpod` can't generate code for `ChangeNotifierProvider`.
154-
To overcome this, you can use the following utility extesion method:
154+
To overcome this, you can use the following utility extension method:
155155
```dart
156156
extension ChangeNotifierWithCodeGenExtension on Ref {
157157
T listenAndDisposeChangeNotifier<T extends ChangeNotifier>(T notifier) {

website/docs/migration/from_change_notifier.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ pkg:provider.
1818
If you've just started a migration to pkg:riverpod, make sure you read the dedicated guide
1919
(see <Link documentID="from_provider/quickstart" />).
2020
This article is meant for folks that already transitioned to riverpod, but want to move away from
21-
`ChangeNotifier` definetively.
21+
`ChangeNotifier`.
2222

23-
All in all, migrating from `ChangeNotifier` to `AsyncNotifer` requires a
23+
All in all, migrating from `ChangeNotifier` to `AsyncNotifier` requires a
2424
paradigm shift, but it brings great simplification with the resulting migrated
2525
code. See also <Link documentID="concepts/why_immutability" />.
2626

@@ -30,14 +30,14 @@ Take this (faulty) example:
3030
This implementation shows several weak design choices such as:
3131
- The usage of `isLoading` and `hasError` to handle different asynchronous cases
3232
- The need to carefully handle requests with tedious `try`/`catch`/`finally` expressions
33-
- The need to inkove `notifyListeners` at the right times to make this implementation work
33+
- The need to invoke `notifyListeners` at the right times to make this implementation work
3434
- The presence of inconsistent or possibly undesirable states, e.g. initialization with an empty list
3535

3636
Note how this example has been crafted to show how `ChangeNotifier` can lead to faulty design choices
3737
for newbie developers; also, another takeaway is that mutable state might be way harder than it
3838
initially promises.
3939

40-
`Notifier`/`AsyncNotifer`, in combination with immutable state, can lead to better design choices
40+
`Notifier`/`AsyncNotifier`, in combination with immutable state, can lead to better design choices
4141
and less errors.
4242

4343
Let's see how to migrate the above snippet, one step at a time, towards the newest APIs.
@@ -94,7 +94,7 @@ to smooth out the migration at first.
9494

9595

9696
### Initialization
97-
Initalizing a notifier is easy: just write initialization logic inside `build`.
97+
Initializing a notifier is easy: just write initialization logic inside `build`.
9898
We can now get rid of the old `_init` function.
9999

100100
<AutoSnippet language="dart" {...initialization}></AutoSnippet>

0 commit comments

Comments
 (0)