From 00d0cdf02cdf194163cd5a34ae583a9e612d8b63 Mon Sep 17 00:00:00 2001 From: Filip Hracek Date: Thu, 13 Aug 2020 14:27:50 -0700 Subject: [PATCH] Provider counter update (#520) * Upgrade provider * Update maintenance table --- MAINTENANCE.md | 2 +- .../ios/Runner.xcodeproj/project.pbxproj | 14 +-- provider_counter/lib/main.dart | 31 +++--- provider_counter/pubspec.lock | 97 +++++++++++++------ provider_counter/pubspec.yaml | 2 +- 5 files changed, 89 insertions(+), 57 deletions(-) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index a410860ad..3abe725bf 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -16,7 +16,7 @@ match any new language/SDK features, etc.). | platform_channels | | | | platform_design | johnpryan | 10/7/19 | | platform_view_swift | redbrogdon | 10/7/19 | -| provider_counter | redbrogdon | 11/21/19 | +| provider_counter | filiph | 8/13/20 | | provider_shopper | redbrogdon | 11/21/19 | | testing_app | | | | veggieseasons | filiph | 8/13/20 | diff --git a/provider_counter/ios/Runner.xcodeproj/project.pbxproj b/provider_counter/ios/Runner.xcodeproj/project.pbxproj index 3d76f2bcc..29116b53d 100644 --- a/provider_counter/ios/Runner.xcodeproj/project.pbxproj +++ b/provider_counter/ios/Runner.xcodeproj/project.pbxproj @@ -9,11 +9,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -26,8 +22,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -38,13 +32,11 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -57,8 +49,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -68,9 +58,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -201,7 +189,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; diff --git a/provider_counter/lib/main.dart b/provider_counter/lib/main.dart index 5d84587ee..ea029ec69 100644 --- a/provider_counter/lib/main.dart +++ b/provider_counter/lib/main.dart @@ -75,17 +75,26 @@ class MyHomePage extends StatelessWidget { ), ), floatingActionButton: FloatingActionButton( - // Provider.of is another way to access the model object held - // by an ancestor Provider. By default, even this listens to - // changes in the model, and rebuilds the whole encompassing widget - // when notified. - // - // By using `listen: false` below, we are disabling that - // behavior. We are only calling a function here, and so we don't care - // about the current value. Without `listen: false`, we'd be rebuilding - // the whole MyHomePage whenever Counter notifies listeners. - onPressed: () => - Provider.of(context, listen: false).increment(), + onPressed: () { + // You can access your providers anywhere you have access + // to the context. One way is to use Provider.of(context). + // + // The provider package also defines extension methods on context + // itself. You can call context.watch() in a build method + // of any widget to access the current state of Counter, and to ask + // Flutter to rebuild your widget anytime Counter changes. + // + // You can't use context.watch() outside build methods, because that + // often leads to subtle bugs. Instead, you should use + // context.read(), which gets the current state + // but doesn't ask Flutter for future rebuilds. + // + // Since we're in a callback that will be called whenever the user + // taps the FloatingActionButton, we are not in the build method here. + // We should use context.read(). + var counter = context.read(); + counter.increment(); + }, tooltip: 'Increment', child: Icon(Icons.add), ), diff --git a/provider_counter/pubspec.lock b/provider_counter/pubspec.lock index 76707d0ff..fa7f42a9e 100644 --- a/provider_counter/pubspec.lock +++ b/provider_counter/pubspec.lock @@ -1,13 +1,27 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.4.1" boolean_selector: dependency: transitive description: @@ -15,13 +29,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" charcode: dependency: transitive description: @@ -29,20 +36,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.3" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.13" + version: "1.14.12" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" cupertino_icons: dependency: "direct main" description: @@ -50,13 +64,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -67,13 +74,20 @@ packages: description: flutter source: sdk version: "0.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.12" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.8" + version: "0.12.6" meta: dependency: transitive description: @@ -94,7 +108,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.6.4" pedantic: dependency: "direct dev" description: @@ -102,13 +116,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.9.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.3.2" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" sky_engine: dependency: transitive description: flutter @@ -127,7 +155,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + version: "1.9.3" stream_channel: dependency: transitive description: @@ -155,14 +183,14 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.17" + version: "0.2.15" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.1.6" vector_math: dependency: transitive description: @@ -170,6 +198,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.8" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.1" sdks: - dart: ">=2.9.0-14.0.dev <3.0.0" - flutter: ">=1.17.0" + dart: ">=2.7.0 <3.0.0" + flutter: ">=1.16.0" diff --git a/provider_counter/pubspec.yaml b/provider_counter/pubspec.yaml index 9a11ba358..606e65524 100644 --- a/provider_counter/pubspec.yaml +++ b/provider_counter/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter - provider: ^4.1.0 + provider: ^4.3.2 cupertino_icons: ^0.1.3 dev_dependencies: