Skip to content

Commit

Permalink
fix: typos
Browse files Browse the repository at this point in the history
  • Loading branch information
j-m-hoffmann committed Mar 5, 2020
1 parent 7373dd5 commit 309ae2c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ Foo(
```

In this example, only `Bar` will rebuild when `A` updates. `Foo` and `Baz` won't
unnecesseraly rebuild.
unnecessarily rebuild.

To go one step further, it is possible to use `Selector` to ignore changes if
they don't have an impact on the widget-tree:
Expand Down Expand Up @@ -510,7 +510,7 @@ Provider<Country>(

`provider` exposes a few different kinds of "provider" for different types of objects.

The complete list of all the objects availables is [here](https://pub.dev/documentation/provider/latest/provider/provider-library.html)
The complete list of all the objects available is [here](https://pub.dev/documentation/provider/latest/provider/provider-library.html)

| name | description |
| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class MyHomePage extends StatelessWidget {
/// Splitting our app in small widgets like [Title] or [CounterLabel] is
/// useful for rebuild optimization.
///
/// Since they are instanciated using `const`, they won't unnecessarily
/// Since they are instantiated using `const`, they won't unnecessarily
/// rebuild when their parent changes.
/// But they can still have dynamic content, as they can obtain providers!
///
/// This means only the widgets that depends on a provider to rebuild when they change.
/// Alternatively, we could use [Consumer] or [Selector] to acheive the
/// Alternatively, we could use [Consumer] or [Selector] to achieve the
/// same result.
appBar: AppBar(title: const Title()),
body: const Center(child: CounterLabel()),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/change_notifier_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ class ChangeNotifierProvider<T extends ChangeNotifier> extends ListenableProvide
/// - **DON'T** create the [ChangeNotifier] inside `update` directly.
///
/// This will cause your state to be lost when one of the values used updates.
/// It will also cause uncesserary overhead because it will dispose the
/// It will also cause unnecessary overhead because it will dispose the
/// previous notifier, then subscribes to the new one.
///
/// Instead reuse the previous instance, and update some properties or call
/// some methods.
///
/// ```dart
/// ChangeNotifierProxyProvider<MyModel, MyChangeNotifier>(
/// // may cause the state to be destroyed unvoluntarily
/// // may cause the state to be destroyed involuntarily
/// update: (_, myModel, myNotifier) => MyChangeNotifier(myModel: myModel),
/// child: ...
/// );
Expand Down
8 changes: 4 additions & 4 deletions lib/src/inherited_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class InheritedProvider<T> extends SingleChildStatelessWidget {
}

@override
_InheritedProvderElement<T> createElement() {
return _InheritedProvderElement<T>(this);
_InheritedProviderElement<T> createElement() {
return _InheritedProviderElement<T>(this);
}

@override
Expand All @@ -117,8 +117,8 @@ class InheritedProvider<T> extends SingleChildStatelessWidget {
}
}

class _InheritedProvderElement<T> extends SingleChildStatelessElement {
_InheritedProvderElement(InheritedProvider<T> widget) : super(widget);
class _InheritedProviderElement<T> extends SingleChildStatelessElement {
_InheritedProviderElement(InheritedProvider<T> widget) : super(widget);

@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/listenable_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import 'proxy_provider.dart';
/// Listens to a [Listenable], expose it to its descendants and rebuilds
/// dependents whenever the listener emits an event.
///
/// For usage informations, see [ChangeNotifierProvider], a subclass of
/// For usage information, see [ChangeNotifierProvider], a subclass of
/// [ListenableProvider] made for [ChangeNotifier].
///
/// You will generaly want to use [ChangeNotifierProvider] instead.
/// You will generally want to use [ChangeNotifierProvider] instead.
/// But [ListenableProvider] is available in case you want to implement
/// [Listenable] yourself, or use [Animation].
class ListenableProvider<T extends Listenable> extends InheritedProvider<T> {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class MultiProvider extends Nested {
/// ```
///
/// Note this example purposefully specified the object type, instead of having
/// it infered.
/// it inferred.
/// Since we used a mocked class (typically using `mockito`), then we have to
/// downcast the mock to the type of the mocked class.
/// Otherwise, the type inference will resolve to `Provider<MockFoo>` instead of
Expand Down
6 changes: 3 additions & 3 deletions lib/src/selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ class _Selector0State<T> extends SingleChildState<Selector0<T>> {
///
/// [Selector] will obtain a value using [Provider.of], then pass that value
/// to `selector`. That `selector` callback is then tasked to return an object
/// that contains only the informations needed for `builder` to complete.
/// that contains only the information needed for `builder` to complete.
///
/// By default, [Selector] determines if `builder` needs to be called again
/// by comparing the previous and new result of `selector` using
/// [DeepCollectionEquality] from the package `collection`.
///
/// This behavior can be overriden by passing a custom `shouldRebuild` callback.
/// This behavior can be overridden by passing a custom `shouldRebuild` callback.
///
/// **NOTE**:
/// The selected value must be immutable, or otherwise [Selector] may think
Expand All @@ -125,7 +125,7 @@ class _Selector0State<T> extends SingleChildState<Selector0<T>> {
/// In that example, `builder` will be called again only if `foo.bar` or
/// `foo.baz` changes.
///
/// For generic usage informations, see [Consumer].
/// For generic usage information, see [Consumer].
/// {@endtemplate}
class Selector<A, S> extends Selector0<S> {
/// {@macro provider.selector}
Expand Down
2 changes: 1 addition & 1 deletion test/provider_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ https://github.com/rrousselGit/provider/issues
expect(buildCount, equals(2));
expect(buildValue, equals(25));

// value didnt' change
// value didn't change
await tester.pumpWidget(
Provider<int>.value(
value: 25,
Expand Down

0 comments on commit 309ae2c

Please sign in to comment.