diff --git a/README.md b/README.md index 1065804c..85b650f4 100644 --- a/README.md +++ b/README.md @@ -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: @@ -510,7 +510,7 @@ Provider( `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 | | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/example/lib/main.dart b/example/lib/main.dart index ee1f40d9..c0acd4da 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -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()), diff --git a/lib/src/change_notifier_provider.dart b/lib/src/change_notifier_provider.dart index c6db4ca9..18bac181 100644 --- a/lib/src/change_notifier_provider.dart +++ b/lib/src/change_notifier_provider.dart @@ -183,7 +183,7 @@ class ChangeNotifierProvider 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 @@ -191,7 +191,7 @@ class ChangeNotifierProvider extends ListenableProvide /// /// ```dart /// ChangeNotifierProxyProvider( -/// // may cause the state to be destroyed unvoluntarily +/// // may cause the state to be destroyed involuntarily /// update: (_, myModel, myNotifier) => MyChangeNotifier(myModel: myModel), /// child: ... /// ); diff --git a/lib/src/inherited_provider.dart b/lib/src/inherited_provider.dart index 72f3d5ed..ebebfbed 100644 --- a/lib/src/inherited_provider.dart +++ b/lib/src/inherited_provider.dart @@ -104,8 +104,8 @@ class InheritedProvider extends SingleChildStatelessWidget { } @override - _InheritedProvderElement createElement() { - return _InheritedProvderElement(this); + _InheritedProviderElement createElement() { + return _InheritedProviderElement(this); } @override @@ -117,8 +117,8 @@ class InheritedProvider extends SingleChildStatelessWidget { } } -class _InheritedProvderElement extends SingleChildStatelessElement { - _InheritedProvderElement(InheritedProvider widget) : super(widget); +class _InheritedProviderElement extends SingleChildStatelessElement { + _InheritedProviderElement(InheritedProvider widget) : super(widget); @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { diff --git a/lib/src/listenable_provider.dart b/lib/src/listenable_provider.dart index 5ff67b93..91577a2b 100644 --- a/lib/src/listenable_provider.dart +++ b/lib/src/listenable_provider.dart @@ -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 extends InheritedProvider { diff --git a/lib/src/provider.dart b/lib/src/provider.dart index fe372221..b0e4e487 100644 --- a/lib/src/provider.dart +++ b/lib/src/provider.dart @@ -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` instead of diff --git a/lib/src/selector.dart b/lib/src/selector.dart index f4678dc0..dfa78557 100644 --- a/lib/src/selector.dart +++ b/lib/src/selector.dart @@ -95,13 +95,13 @@ class _Selector0State extends SingleChildState> { /// /// [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 @@ -125,7 +125,7 @@ class _Selector0State extends SingleChildState> { /// 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 extends Selector0 { /// {@macro provider.selector} diff --git a/test/provider_test.dart b/test/provider_test.dart index 22d9b38f..85d58266 100644 --- a/test/provider_test.dart +++ b/test/provider_test.dart @@ -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.value( value: 25,