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(), diff --git a/login_bloc/lib/src/blocs/provider.dart b/login_bloc/lib/src/blocs/provider.dart deleted file mode 100644 index 56e95c7..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.inheritFromWidgetOfExactType(Provider) as Provider).bloc; - } -} 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, ); }, ); 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; } } 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; 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; } } 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