From b0e27f984e91cc1534745401591b84195666b0cb Mon Sep 17 00:00:00 2001 From: Anatolii Date: Fri, 23 Oct 2020 10:31:04 +0200 Subject: [PATCH 1/8] Update legacy code (deprecated function call) 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1.. --- login_bloc/lib/src/blocs/provider.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login_bloc/lib/src/blocs/provider.dart b/login_bloc/lib/src/blocs/provider.dart index 56e95c7..08c8aa4 100644 --- a/login_bloc/lib/src/blocs/provider.dart +++ b/login_bloc/lib/src/blocs/provider.dart @@ -9,6 +9,6 @@ class Provider extends InheritedWidget { bool updateShouldNotify(_) => true; static Bloc of(BuildContext context) { - return (context.inheritFromWidgetOfExactType(Provider) as Provider).bloc; + return (context.dependOnInheritedWidgetOfExactType()).bloc; } } From 3d268ac277194151fd3ff534a8f02cc520fbaa0e Mon Sep 17 00:00:00 2001 From: Anatolii Date: Fri, 23 Oct 2020 22:06:43 +0200 Subject: [PATCH 2/8] Disable raise button by default Small improvement. Disable raise button by default while widget initialization. --- login_bloc/lib/src/screens/login_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/login_bloc/lib/src/screens/login_screen.dart b/login_bloc/lib/src/screens/login_screen.dart index 4f27d4c..16f4178 100644 --- a/login_bloc/lib/src/screens/login_screen.dart +++ b/login_bloc/lib/src/screens/login_screen.dart @@ -59,7 +59,7 @@ class LoginScreen extends StatelessWidget { return RaisedButton( child: Text('Login'), color: Colors.blue, - onPressed: snapshot.hasData ? bloc.submit : null, + onPressed: snapshot.hasData || snapshot.data == null ? bloc.submit : null, ); }, ); From fb89e7a0cb5412fa9948e1ae91ffb366280261af Mon Sep 17 00:00:00 2001 From: Anatolii Date: Fri, 23 Oct 2020 22:30:56 +0200 Subject: [PATCH 3/8] My mistake --- login_bloc/lib/src/blocs/provider.dart | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 login_bloc/lib/src/blocs/provider.dart diff --git a/login_bloc/lib/src/blocs/provider.dart b/login_bloc/lib/src/blocs/provider.dart deleted file mode 100644 index 08c8aa4..0000000 --- a/login_bloc/lib/src/blocs/provider.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:flutter/material.dart'; -import 'bloc.dart'; - -class Provider extends InheritedWidget { - final bloc = Bloc(); - - Provider({Key key, Widget child}) : super(key: key, child: child); - - bool updateShouldNotify(_) => true; - - static Bloc of(BuildContext context) { - return (context.dependOnInheritedWidgetOfExactType()).bloc; - } -} From 51592bdd6806b3020dd1c4ecf60e15c129eb73e9 Mon Sep 17 00:00:00 2001 From: Anatolii Date: Sat, 24 Oct 2020 21:10:27 +0200 Subject: [PATCH 4/8] Stack. Replace overflow by clipBehavior Stack widget. 'overflow' is deprecated and shouldn't be used. Use clipBehavior instead. See the migration guide in flutter.dev/go/clip-behavior. This feature was deprecated after v1.22.0-12.0.pre.. - overflow: Overflow.visible, + clipBehavior: Clip.none, --- animation/lib/src/screens/home.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animation/lib/src/screens/home.dart b/animation/lib/src/screens/home.dart index 10338ac..2f8d8b9 100644 --- a/animation/lib/src/screens/home.dart +++ b/animation/lib/src/screens/home.dart @@ -67,7 +67,7 @@ class HomeState extends State with TickerProviderStateMixin { body: GestureDetector( child: Center( child: Stack( - overflow: Overflow.visible, + clipBehavior: Clip.none, children: [ buildCatAnimation(), buildBox(), From 19a8d72c755c4b7a9b87ad7d19ed5b8f36b483ce Mon Sep 17 00:00:00 2001 From: Anatolii Date: Mon, 26 Oct 2020 10:54:36 +0100 Subject: [PATCH 5/8] Update legacy code (deprecated function call) 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1.. --- news/lib/src/blocs/stories_provider.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/news/lib/src/blocs/stories_provider.dart b/news/lib/src/blocs/stories_provider.dart index ce7443c..8a45a32 100644 --- a/news/lib/src/blocs/stories_provider.dart +++ b/news/lib/src/blocs/stories_provider.dart @@ -12,8 +12,6 @@ class StoriesProvider extends InheritedWidget { bool updateShouldNotify(_) => true; static StoriesBloc of(BuildContext context) { - return (context.inheritFromWidgetOfExactType(StoriesProvider) - as StoriesProvider) - .bloc; + return (context.dependOnInheritedWidgetOfExactType()).bloc; } } From 2ceca943854024c6b3df8df1e813ad74d8f43f8f Mon Sep 17 00:00:00 2001 From: Anatolii Date: Mon, 26 Oct 2020 17:53:35 +0100 Subject: [PATCH 6/8] rxdart updates Remove the Observable class. https://pub.dev/packages/rxdart/changelog#0230 --- news/lib/src/blocs/stories_bloc.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/news/lib/src/blocs/stories_bloc.dart b/news/lib/src/blocs/stories_bloc.dart index 7281ad2..e0c64a3 100644 --- a/news/lib/src/blocs/stories_bloc.dart +++ b/news/lib/src/blocs/stories_bloc.dart @@ -10,8 +10,8 @@ class StoriesBloc { final _itemsFetcher = PublishSubject(); // Getters to Streams - Observable> get topIds => _topIds.stream; - Observable>> get items => _itemsOutput.stream; + Stream> get topIds => _topIds.stream; + Stream>> get items => _itemsOutput.stream; // Getters to Sinks Function(int) get fetchItem => _itemsFetcher.sink.add; From 5aa5ea45725db510294b4a1ebe28a3bb7b26c241 Mon Sep 17 00:00:00 2001 From: Anatolii Date: Tue, 27 Oct 2020 04:15:14 +0100 Subject: [PATCH 7/8] Update legacy code (deprecated function call) 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1.. --- news/lib/src/blocs/comments_provider.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/news/lib/src/blocs/comments_provider.dart b/news/lib/src/blocs/comments_provider.dart index ebc3e86..62efb5a 100644 --- a/news/lib/src/blocs/comments_provider.dart +++ b/news/lib/src/blocs/comments_provider.dart @@ -12,8 +12,7 @@ class CommentsProvider extends InheritedWidget { bool updateShouldNotify(_) => true; static CommentsBloc of(BuildContext context) { - return (context.inheritFromWidgetOfExactType(CommentsProvider) - as CommentsProvider) + return (context.dependOnInheritedWidgetOfExactType()) .bloc; } } From 9044adcb36c989e631be5a9c1b63c10a6f203696 Mon Sep 17 00:00:00 2001 From: Anatolii Date: Tue, 27 Oct 2020 18:15:19 +0100 Subject: [PATCH 8/8] pubspec.yaml update --- news/pubspec.yaml | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/news/pubspec.yaml b/news/pubspec.yaml index 33f9e3b..31bdab0 100644 --- a/news/pubspec.yaml +++ b/news/pubspec.yaml @@ -1,25 +1,45 @@ name: news description: A new Flutter project. +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.7.0 <3.0.0" + dependencies: flutter: sdk: flutter + sqflite: ^1.3.1+2 + path_provider: ^1.6.22 + http: ^0.12.2 + rxdart: ^0.24.1 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 - - sqflite: ^0.10.0 - path_provider: ^0.4.1 - rxdart: ^0.18.0 + cupertino_icons: ^1.0.0 dev_dependencies: flutter_test: sdk: flutter + test: ^1.15.4 # For information on the generic Dart part of this file, see the -# following page: https://www.dartlang.org/tools/pub/pubspec +# following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: @@ -31,14 +51,14 @@ flutter: # To add assets to your application, add an assets section, like this: # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.io/assets-and-images/#resolution-aware. + # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see - # https://flutter.io/assets-and-images/#from-packages + # https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here, # in this "flutter" section. Each entry in this list should have a @@ -58,4 +78,4 @@ flutter: # weight: 700 # # For details regarding fonts from package dependencies, - # see https://flutter.io/custom-fonts/#from-packages + # see https://flutter.dev/custom-fonts/#from-packages