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-Kq_u6t_k?a8kEHqai-N-4#`SRerO!h}!cS%SMC<)tGix zOzVP^_t!HN&HIPL-ZpcgWitHM&yFRC7!k4zSI+-<_uQ}|tX)n{Ib;X>Xx>i_d*KkH zCzogKQ)eQ>F pP1408_2!ofU|iBq2R8hW6G zuqJs9Tyw{u%-uWczPLkM!MfKfflt+NK9Vk8E!C>AsJwNDRoe2~cL+UvqNP|5J8t)( z0$iMa!jhudJ+fqFn+um&@ Oj6qXJd_3-l`S^I1#0fnt!z3?D*hAHr*u(*wR@`4O z#avrtg%s`Fh{?$FtBFM^$@@hW!8ZfF4;=n0<8In&X}-Rp=cd0TqT_ne46$j^r}FzE z26vX^!PzScuQfFfl1HEZ{zL?G88mcc76zHGizWiykBf4m83Z${So-+dZ~YGhm*RO7 zB1gdIdqnFi?qw+lPRFW5?}CQ3Me3G^muvll&4iN+*5#_mmIu;loULMwb4lu9U*dFM z-Sr**(0Ei~u=$3<6>C-G6z4_LNCx||6YtjS)<;hf)YJTPKXW+w%hhCTUAInIse9>r zl2YU6nRb$u-FJlWN*{{%sm_gi_UP5{=?5}5^D2v PzM=oPfNw~azZQ#P zl5z8RtSSiTIpEohC15i-Q1Bk{3&ElsD0uGAOxvbk29VUDmmA0w;^v`W#0`};O3DVE z&+-ca*`YcN%z*#VXWK9Qa-OEME#fykF%|7o=1Y+eF;Rtv0W4~kKRDx9YBHOWhC%^I z$Jec0cC7o37}Xt}cu)NH5R}NT+=2Nap*`^%O)vz?+{PV<2~qX %TzdJOGeKj5_QjqR&a3*K@= P-1+_A+?hGkL;m(J7kc&K diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 0513117..a060db6 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -3,7 +3,7 @@ CFBundleDevelopmentRegion -en +$(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/example/ios/Runner/Runner-Bridging-Header.h b/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/example/ios/Runner/main.m b/example/ios/Runner/main.m deleted file mode 100644 index dff6597..0000000 --- a/example/ios/Runner/main.m +++ /dev/null @@ -1,9 +0,0 @@ -#import-#import -#import "AppDelegate.h" - -int main(int argc, char* argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/example/lib/AccordionTransformer.dart b/example/lib/AccordionTransformer.dart index 46ed19b..874c0d5 100644 --- a/example/lib/AccordionTransformer.dart +++ b/example/lib/AccordionTransformer.dart @@ -31,9 +31,9 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _MyHomePageState createState() => new _MyHomePageState(); diff --git a/example/lib/CachePageView.dart b/example/lib/CachePageView.dart index a6fbf2e..ce8e285 100644 --- a/example/lib/CachePageView.dart +++ b/example/lib/CachePageView.dart @@ -1,16 +1,15 @@ import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; -import 'package:meta/meta.dart'; import 'dart:math'; class MyViewPort extends RenderSliverFillViewport { int itemCount; - MyViewPort( - {@required RenderSliverBoxChildManager childManager, - double viewportFraction = 1.0, - this.itemCount}) - : super(childManager: childManager, viewportFraction: viewportFraction); + MyViewPort({ + required RenderSliverBoxChildManager childManager, + double viewportFraction = 1.0, + required this.itemCount, + }) : super(childManager: childManager, viewportFraction: viewportFraction); @override int getMaxChildIndexForScrollOffset(double scrollOffset, double itemExtent) { @@ -35,13 +34,12 @@ class MyViewPort extends RenderSliverFillViewport { class MySliverFillViewport extends SliverMultiBoxAdaptorWidget { /// Creates a sliver whose box children that each fill the viewport. // - const MySliverFillViewport( - {Key key, - @required SliverChildDelegate delegate, - this.viewportFraction = 1.0, - this.itemCount}) - : assert(viewportFraction != null), - assert(viewportFraction > 0.0), + const MySliverFillViewport({ + Key? key, + required SliverChildDelegate delegate, + this.viewportFraction = 1.0, + required this.itemCount, + }) : assert(viewportFraction > 0.0), super(key: key, delegate: delegate); /// The fraction of the viewport that each child should fill in the main axis. @@ -55,7 +53,9 @@ class MySliverFillViewport extends SliverMultiBoxAdaptorWidget { @override RenderSliverFillViewport createRenderObject(BuildContext context) { - final SliverMultiBoxAdaptorElement element = context; + final SliverMultiBoxAdaptorElement element = SliverMultiBoxAdaptorElement( + context.widget as SliverMultiBoxAdaptorWidget); + return new MyViewPort( childManager: element, itemCount: itemCount, @@ -78,11 +78,13 @@ const PageScrollPhysics _kPagePhysics = PageScrollPhysics(); class Ext extends PageView {} +// ignore: must_be_immutable class MyPageView extends StatelessWidget { final SliverChildListDelegate childrenDelegate; - MyPageView({List children}) - : childrenDelegate = new SliverChildListDelegate(children); + MyPageView({ + required List children, + }) : childrenDelegate = new SliverChildListDelegate(children); PageController controller = new PageController(); diff --git a/example/lib/DeepthPageTransformer.dart b/example/lib/DeepthPageTransformer.dart index 96c2fc0..4c1751e 100644 --- a/example/lib/DeepthPageTransformer.dart +++ b/example/lib/DeepthPageTransformer.dart @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/lib/FixlistTest.dart b/example/lib/FixlistTest.dart index 67b6e75..90c8b39 100644 --- a/example/lib/FixlistTest.dart +++ b/example/lib/FixlistTest.dart @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; @@ -40,7 +40,7 @@ class MyHomePage extends StatefulWidget { } class _MyHomePageState extends State { - IndexController _controller; + late IndexController _controller; List _types = [ "AccordionTransformer", "ThreeDTransformer", @@ -50,8 +50,8 @@ class _MyHomePageState extends State { "DeepthPageTransformer" ]; - String _type; - FixedExtentScrollController controller; + late String _type; + late FixedExtentScrollController controller; double _viewportFraction = 1.0; @@ -92,27 +92,36 @@ class _MyHomePageState extends State { children: [ new Row( children: [ - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { _controller.previous(); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Preious"), ), new SizedBox( width: 8.0, ), - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { _controller.next(); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Next"), ), new SizedBox( width: 8.0, ), - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { showModalBottomSheet( context: context, @@ -135,7 +144,7 @@ class _MyHomePageState extends State { children: _types.map((t) => new Text(t)).toList()); }); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Change Animation"), ), ], diff --git a/example/lib/ScaleAndFadeTransformer.dart b/example/lib/ScaleAndFadeTransformer.dart index 80d9a4a..15e8455 100644 --- a/example/lib/ScaleAndFadeTransformer.dart +++ b/example/lib/ScaleAndFadeTransformer.dart @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/lib/ThreeDTransformer.dart b/example/lib/ThreeDTransformer.dart index fb592d8..f5e6a52 100644 --- a/example/lib/ThreeDTransformer.dart +++ b/example/lib/ThreeDTransformer.dart @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/lib/ZoomInPageTransformer.dart b/example/lib/ZoomInPageTransformer.dart index 80321eb..d8cb3b4 100644 --- a/example/lib/ZoomInPageTransformer.dart +++ b/example/lib/ZoomInPageTransformer.dart @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/lib/ZoomOutPageTransformer.dart b/example/lib/ZoomOutPageTransformer.dart index 3c67b10..325a5b5 100644 --- a/example/lib/ZoomOutPageTransformer.dart +++ b/example/lib/ZoomOutPageTransformer.dart @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/lib/images.dart b/example/lib/images.dart index 78e7151..b1804a3 100644 --- a/example/lib/images.dart +++ b/example/lib/images.dart @@ -24,7 +24,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/lib/main.dart b/example/lib/main.dart index 7188b55..fc9e19a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -35,7 +35,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; @@ -44,7 +44,7 @@ class MyHomePage extends StatefulWidget { } class _MyHomePageState extends State { - IndexController _controller; + late IndexController _controller; List _types = [ "AccordionTransformer", "ThreeDTransformer", @@ -54,8 +54,8 @@ class _MyHomePageState extends State { "DeepthPageTransformer" ]; - String _type; - FixedExtentScrollController controller; + late String _type; + late FixedExtentScrollController controller; int _index = 0; double _viewportFraction = 1.0; @@ -106,14 +106,20 @@ class _MyHomePageState extends State { children: [ new Wrap( children: [ - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { _controller.move(new Math.Random().nextInt(5)); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Random"), ), - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { Navigator.of(context) .push(new MaterialPageRoute(builder: (b) { @@ -125,10 +131,13 @@ class _MyHomePageState extends State { ); })); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Image"), ), - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { Navigator.of(context) .push(new MaterialPageRoute(builder: (b) { @@ -139,44 +148,56 @@ class _MyHomePageState extends State { body: new Welcome(0)); })); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Welcome"), ), - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { Navigator.of(context) .push(new MaterialPageRoute(builder: (b) { return new Zero(); })); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Zero"), ), ], ), new Row( children: [ - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { _controller.previous(); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Preious"), ), new SizedBox( width: 8.0, ), - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { _controller.next(); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Next"), ), new SizedBox( width: 8.0, ), - new RaisedButton( + new ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), onPressed: () { showModalBottomSheet( context: context, @@ -199,7 +220,7 @@ class _MyHomePageState extends State { children: _types.map((t) => new Text(t)).toList()); }); }, - color: Colors.blue, + //color: Colors.blue, child: new Text("Animation"), ), ], diff --git a/example/lib/screens/ProductDetailView.dart b/example/lib/screens/ProductDetailView.dart index 120718c..79cdf62 100644 --- a/example/lib/screens/ProductDetailView.dart +++ b/example/lib/screens/ProductDetailView.dart @@ -1,12 +1,8 @@ -import 'package:example/buildin_transformers.dart'; import 'package:flutter/material.dart'; -import 'package:transformer_page_view/transformer_page_view.dart'; - class ProductDetailView extends StatelessWidget { @override Widget build(BuildContext context) { - // TODO: implement build return new Scaffold( appBar: new AppBar(), body: new Center( diff --git a/example/lib/welcome.dart b/example/lib/welcome.dart index 1021b5b..3f524d5 100644 --- a/example/lib/welcome.dart +++ b/example/lib/welcome.dart @@ -24,7 +24,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/lib/welcome_back.dart b/example/lib/welcome_back.dart index 1021b5b..3f524d5 100644 --- a/example/lib/welcome_back.dart +++ b/example/lib/welcome_back.dart @@ -24,7 +24,7 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); + MyHomePage({Key? key, required this.title}) : super(key: key); final String title; diff --git a/example/pubspec.lock b/example/pubspec.lock index c6f118f..3ff4361 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -1,41 +1,62 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.15.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "1.0.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -50,37 +71,23 @@ packages: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.10" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.4.0" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.1" + version: "1.8.0" sky_engine: dependency: transitive description: flutter @@ -90,64 +97,65 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.5.4" + version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.8" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.19" transformer_page_view: dependency: "direct dev" description: path: ".." relative: true source: path - version: "0.1.6" + version: "0.2.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.1.0" sdks: - dart: ">=2.1.0 <3.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 9e4d5af..ee2a06a 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,24 +1,33 @@ name: example -description: A new Flutter application. +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. -# Read more about versioning at semver.org. -version: 1.0.0+1 +# 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: 2.0.0+1 environment: - sdk: ">=2.0.0-dev.50.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: sdk: flutter + # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.2 dev_dependencies: flutter_test: @@ -27,9 +36,8 @@ dev_dependencies: transformer_page_view: path: ../ - # 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: @@ -54,10 +62,10 @@ flutter: - assets/edit.png # 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 @@ -77,4 +85,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 diff --git a/example/web/favicon.png b/example/web/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8aaa46ac1ae21512746f852a42ba87e4165dfdd1 GIT binary patch literal 917 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@P(fs7NJL45ua8x7ey(0(N`6wRUPW#JP&EUCO@$SZnVVXYs8ErclUHn2 zVXFjIVFhG^g!Ppaz)DK8ZIvQ?0~DO|i&7O#^-S~(l 1AfjnEK zjFOT9D}DX)@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7USFmqf|i<65o z3raHc^AtelCMM;Vme?vOfh>Xph&xL%(-1c06+^uR^q@XSM&D4+Kp$>4P^%3{)XKjo zGZknv$b36P8?Z_gF{nK@`XI}Z90TzwSQO}0J1!f2c(B=V`5aP@1P1a|PZ!4!3&Gl8 zTYqUsf!gYFyJnXpu0!n&N* SYAX-%d(5 gVjrHJWqXQshj@! Zm{!01WsQrH~9=kTxW#6SvuapgMqt>$=j#%eyGrQzr zP{L-3gsMA^$I1&gsBAEL+vxi1*Igl=8#8`5?A-T5=z-sk46WA1IUT)AIZHx1rdUrf zVJrJn<74DDw`j)Ki#gt}mIT-Q`XRa2-jQXQoI%w`nb|XblvzK${ZzlV)m-XcwC(od z71_OEC5Bt9GEXosOXaPTYOia#R4ID2TiU~`zVMl08TV_C%DnU4^+HE>9(CE4D6?Fz oujB08i7adh9xk7*FX66dWH6F5TM;?E2b5PlUHx3vIVCg!0Dx9vYXATM literal 0 HcmV?d00001 diff --git a/example/web/icons/Icon-192.png b/example/web/icons/Icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..b749bfef07473333cf1dd31e9eed89862a5d52aa GIT binary patch literal 5292 zcmZ`-2T+sGz6~)*FVZ`aW+(v>MIm&M-g^@e2u-B-DoB?qO+b1Tq<5uCCv>ESfRum& zp%X;f!~1{tzL__3=gjVJ=j=J>+nMj%ncXj1Q(b|Ckbw{Y0FWpt%4y%$uD=Z*c-x~o zE;IoE;xa#7Ll5nj-e4CuXB&G*IM~D21rCP$*xLXAK8rIMCSHu Su%bL&S3)8YI~vyp@KBu9Ph7R_pvKQ@xv>NQ`dZp(u{Z8K3yOB zn7-AR+d2JkW)KiGx0hosml;+eCXp6+w%@STjFY*CJ?udJ64&{BCbuebcuH;}(($@@ znNlgBA@ZXB)mcl9nbX#F!f_5Z=W>0kh|UVWnf!At4V*LQP%*gPdCXd6P@J4Td;!Ur z<2ZLmwr(NG`u#gDEMP19UcSzRTL@HsK+PnIXbVB T@oHm53DZr?~V(0{rsalAfwgo zEh=GviaqkF;}F_5-yA!1u3!gxaR&Mj)hLuj5Q-N-@Lra{%<4ONja8pycD90&>yMB` zchhd>0CsH`^|&TstH-8+R`CfoWqmTTF_0?zDOY`E`b)cVi!$4xA@oO;SyOjJyP^_j zx^@Gdf+w|FW@DMdOi8=4+LJl$#@R&&=UM`)G!y%6 ZzQLoSL%*KE8IO0~&5XYR9 z&N)?goEiWA(YoRfT{06&D6Yuu@Qt&XVbuW@COb;>SP9~aRc+z`m`80pB2o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1n!A&-8`;#RDcZyk*+RPkn_r8?Ak@agHiSp*qFNX)&i21HE?yuZ;-C<3C zwJGd1lx5UzViP7sZJ&|LqH*mryb}y|%AOw+v)yc`qM)03qyyrqhX?ub`Cjwx2PrR! z)_z>5*!*$x1=Qa-0uE7jy0z`>|Ni#X+uV|%_81F7)b+nf%iz=`fF4g5UfHS_?PHbr zB;0$bK@=di?f`dS(j{l3-tSCfp~zUuva+=EWxJcRfp(<$@vd(GigM&~vaYZ0c#BTs z3ijkxMl=vw5AS&DcXQ%eeKt!uKvh2l3W?&3=dBHU=Gz?O! 40S&&~ei2vg**c$o;i89~6DVns zG>9a*`k5)NI9|?W!@9>rzJ;9EJ=YlJTx1r1BA?H`LWijk(rTax9(OAu;q4_wTj-yj z1%W4GW&K4T=uEGb+E! >W0SD_C0RR91 literal 0 HcmV?d00001 diff --git a/example/web/icons/Icon-512.png b/example/web/icons/Icon-512.png new file mode 100644 index 0000000000000000000000000000000000000000..88cfd48dff1169879ba46840804b412fe02fefd6 GIT binary patch literal 8252 zcmd5=2T+s!lYZ%-(h(2@5fr2dC?F^$C=i-}R6$UX8af(!je;W5yC_|HmujSgN*6?W z3knF*TL1$|?oD*=zPbB Vex*RUIKsL<(&Rj9%^UD2IK3W?2j>D?eWQgvS-HLymHo9%~|N2Q{~j za?*X-{b9JRowv_*Mh|;*-kPFn>PI;r<#kFaxFqbn?aq|PduQg=2Q;~Qc}#z)_T%x9 zE|0!a70`58 wjREmAH38H1)#gof)U3g9FZ^ zF7&-0^Hy{4XHWLoC*hOG(dg~2g6&? -wqcpf { z&3=o8vw7lMi22jCG9RQbv8H}`+}9^zSk`nlR8?Z&G2dlDy$4#+WOlg;VHqzuE=fM@ z?OI6HEJH4&tA?FVG}9>jAnq_^tlw8NbjNhfqk2rQr?h(F&WiKy03Sn=-;ZJRh~JrD zbt)zLbnabttEZ>zUiu`N*u4sfQaLE8-WDn@tHp50uD(^r-}UsUUu)`!Rl1PozAc!a z?uj|2QDQ%oV-j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?_(gP2w3P#&91JX*md+bBEr%xUHMVqfB;(f?OPtMnAZ#rm5q5mh;a2f_si2_ z3oXWB?{NF(JtkAn6F(O{z@b76OIqMC$&oJ_&S|YbFJ*)3qVX_uNf5b8(!vGX19hsG z(OP>RmZp29KH9Ge2kKjKigUmOe^K_!UXP`von)PR8Qz$%=EmOB9xS(ZxE_tnyzo}7 z=6~$~9k0M~v}`w={AeqF?_)9q{m8K#6M{a&(;u;O41j)I$^T?lx5(zlebpY@NTN zR+1bB)-1-xj}R8uwqwf=iP1GbxBjneCC%UrSdSxK1vM^i9;bUkS#iRZw2H>rS<2<$ zNT3|sDH>{tXb=zq7XZi*K?#Zsa1h1{h5!Tq_YbKFm_*=A5-<~j63he;4`77!|LBlo zR^~tR3yxcU=gDFbshyF6>o0bdp$qmHS7D}m3;^QZq9kBBU|9$N-~oU?G5;jyFR7>z hN`IR97YZXIo@y!QgFWddJ3|0`sjFx!m))><{BI=FK%f8s literal 0 HcmV?d00001 diff --git a/example/web/index.html b/example/web/index.html new file mode 100644 index 0000000..1460b5e --- /dev/null +++ b/example/web/index.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + + + diff --git a/example/web/manifest.json b/example/web/manifest.json new file mode 100644 index 0000000..8c01291 --- /dev/null +++ b/example/web/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/lib/index_controller.dart b/lib/index_controller.dart index 461278f..6ea70c6 100644 --- a/lib/index_controller.dart +++ b/lib/index_controller.dart @@ -8,14 +8,14 @@ class IndexController extends ChangeNotifier { static const int PREVIOUS = -1; static const int MOVE = 0; - Completer _completer; + late Completer _completer; - int index; - bool animation; - int event; + late int index; + late bool animation; + late int event; Future move(int index, {bool animation: true}) { - this.animation = animation ?? true; + this.animation = animation; this.index = index; this.event = MOVE; _completer = new Completer(); @@ -25,7 +25,7 @@ class IndexController extends ChangeNotifier { Future next({bool animation: true}) { this.event = NEXT; - this.animation = animation ?? true; + this.animation = animation; _completer = new Completer(); notifyListeners(); return _completer.future; @@ -33,7 +33,7 @@ class IndexController extends ChangeNotifier { Future previous({bool animation: true}) { this.event = PREVIOUS; - this.animation = animation ?? true; + this.animation = animation; _completer = new Completer(); notifyListeners(); return _completer.future; diff --git a/lib/parallax.dart b/lib/parallax.dart index 6594945..ec31686 100644 --- a/lib/parallax.dart +++ b/lib/parallax.dart @@ -88,9 +88,9 @@ class ParallaxColor extends StatefulWidget { final TransformInfo info; ParallaxColor({ - @required this.colors, - @required this.info, - @required this.child, + required this.colors, + required this.info, + required this.child, }); @override @@ -106,12 +106,12 @@ class ParallaxContainer extends StatelessWidget { final double opacityFactor; ParallaxContainer( - {@required this.child, - @required this.position, + {required this.child, + required this.position, this.translationFactor: 100.0, - this.opacityFactor: 1.0}) - : assert(position != null), - assert(translationFactor != null); + this.opacityFactor: 1.0}); + // : assert(position != null), + // assert(translationFactor != null); @override Widget build(BuildContext context) { @@ -129,9 +129,11 @@ class ParallaxImage extends StatelessWidget { final Image image; final double imageFactor; - ParallaxImage.asset(String name, {double position, this.imageFactor: 0.3}) - : assert(imageFactor != null), - image = Image.asset(name, + ParallaxImage.asset( + String name, { + required double position, + this.imageFactor: 0.3, + }) : image = Image.asset(name, fit: BoxFit.cover, alignment: FractionalOffset( 0.5 + position * imageFactor, diff --git a/lib/transformer_page_view.dart b/lib/transformer_page_view.dart index f4bc33f..99825fa 100644 --- a/lib/transformer_page_view.dart +++ b/lib/transformer_page_view.dart @@ -58,17 +58,18 @@ class TransformInfo { /// Copy from [TransformerPageView.scrollDirection] final Axis scrollDirection; - TransformInfo( - {this.index, - this.position, - this.width, - this.height, - this.activeIndex, - this.fromIndex, - this.forward, - this.done, - this.viewportFraction, - this.scrollDirection}); + TransformInfo({ + required this.index, + required this.position, + required this.width, + required this.height, + required this.activeIndex, + required this.fromIndex, + required this.forward, + required this.done, + required this.viewportFraction, + required this.scrollDirection, + }); } abstract class PageTransformer { @@ -86,9 +87,8 @@ typedef Widget PageTransformerBuilderCallback(Widget child, TransformInfo info); class PageTransformerBuilder extends PageTransformer { final PageTransformerBuilderCallback builder; - PageTransformerBuilder({bool reverse: false, @required this.builder}) - : assert(builder != null), - super(reverse: reverse); + PageTransformerBuilder({bool reverse: false, required this.builder}) + : super(reverse: reverse); @override Widget transform(Widget child, TransformInfo info) { @@ -106,15 +106,15 @@ class TransformerPageController extends PageController { bool keepPage = true, double viewportFraction = 1.0, this.loop: false, - this.itemCount, + required this.itemCount, this.reverse: false, }) : super( initialPage: TransformerPageController._getRealIndexFromRenderIndex( - initialPage ?? 0, loop, itemCount, reverse), + initialPage, loop, itemCount, reverse), keepPage: keepPage, viewportFraction: viewportFraction); - int getRenderIndexFromRealIndex(num index) { + int getRenderIndexFromRealIndex(int index) { return _getRenderIndexFromRealIndex(index, loop, itemCount, reverse); } @@ -124,7 +124,7 @@ class TransformerPageController extends PageController { } static _getRenderIndexFromRealIndex( - num index, bool loop, int itemCount, bool reverse) { + int index, bool loop, int itemCount, bool reverse) { if (itemCount == 0) return 0; int renderIndex; if (loop) { @@ -145,11 +145,11 @@ class TransformerPageController extends PageController { double get realPage { double page; - if (position.maxScrollExtent == null || position.minScrollExtent == null) { - page = 0.0; - } else { - page = super.page; - } + // if (position.maxScrollExtent == null || position.minScrollExtent == null) { + // page = 0.0; + // } else { + page = super.page ?? 0.0; + //} return page; } @@ -179,12 +179,12 @@ class TransformerPageController extends PageController { : realPage; } - int getRealIndexFromRenderIndex(num index) { + int getRealIndexFromRenderIndex(int index) { return _getRealIndexFromRenderIndex(index, loop, itemCount, reverse); } static int _getRealIndexFromRenderIndex( - num index, bool loop, int itemCount, bool reverse) { + int index, bool loop, int itemCount, bool reverse) { int result = reverse ? (itemCount - index - 1) : index; if (loop) { result += kMiddleValue; @@ -197,7 +197,7 @@ class TransformerPageView extends StatefulWidget { /// Create a `transformed` widget base on the widget that has been passed to the [PageTransformer.transform]. /// See [TransformInfo] /// - final PageTransformer transformer; + final PageTransformer? transformer; /// Same as [PageView.scrollDirection] /// @@ -205,7 +205,7 @@ class TransformerPageView extends StatefulWidget { final Axis scrollDirection; /// Same as [PageView.physics] - final ScrollPhysics physics; + final ScrollPhysics? physics; /// Set to false to disable page snapping, useful for custom scroll behavior. /// Same as [PageView.pageSnapping] @@ -213,12 +213,12 @@ class TransformerPageView extends StatefulWidget { /// Called whenever the page in the center of the viewport changes. /// Same as [PageView.onPageChanged] - final ValueChangedonPageChanged; + final ValueChanged ? onPageChanged; - final IndexedWidgetBuilder itemBuilder; + final IndexedWidgetBuilder? itemBuilder; // See [IndexController.mode],[IndexController.next],[IndexController.previous] - final IndexController controller; + final IndexController? controller; /// Animation duration final Duration duration; @@ -226,7 +226,7 @@ class TransformerPageView extends StatefulWidget { /// Animation curve final Curve curve; - final TransformerPageController pageController; + final TransformerPageController? pageController; /// Set true to open infinity loop mode. final bool loop; @@ -253,9 +253,9 @@ class TransformerPageView extends StatefulWidget { /// [itemBuilder] will be called only with indices greater than or equal to /// zero and less than [itemCount]. TransformerPageView({ - Key key, - this.index, - Duration duration, + Key? key, + this.index = 0, + Duration? duration, this.curve: Curves.ease, this.viewportFraction: 1.0, this.loop: false, @@ -267,29 +267,26 @@ class TransformerPageView extends StatefulWidget { this.transformer, this.itemBuilder, this.pageController, - @required this.itemCount, - }) : assert(itemCount != null), - assert(itemCount == 0 || itemBuilder != null || transformer != null), - this.duration = + required this.itemCount, + }) : this.duration = duration ?? new Duration(milliseconds: kDefaultTransactionDuration), super(key: key); factory TransformerPageView.children( - {Key key, - int index, - Duration duration, + {required Key key, + required int index, + required Duration duration, Curve curve: Curves.ease, double viewportFraction: 1.0, bool loop: false, Axis scrollDirection = Axis.horizontal, - ScrollPhysics physics, + required ScrollPhysics physics, bool pageSnapping = true, - ValueChanged onPageChanged, - IndexController controller, - PageTransformer transformer, - @required List children, - TransformerPageController pageController}) { - assert(children != null); + required ValueChanged onPageChanged, + required IndexController controller, + PageTransformer? transformer, + required List children, + TransformerPageController? pageController}) { return new TransformerPageView( itemCount: children.length, itemBuilder: (BuildContext context, int index) { @@ -315,8 +312,12 @@ class TransformerPageView extends StatefulWidget { return new _TransformerPageViewState(); } - static int getRealIndexFromRenderIndex( - {bool reverse, int index, int itemCount, bool loop}) { + static int getRealIndexFromRenderIndex({ + required bool reverse, + required int index, + required int itemCount, + required bool loop, + }) { int initPage = reverse ? (itemCount - index - 1) : index; if (loop) { initPage += kMiddleValue; @@ -324,12 +325,13 @@ class TransformerPageView extends StatefulWidget { return initPage; } - static PageController createPageController( - {bool reverse, - int index, - int itemCount, - bool loop, - double viewportFraction}) { + static PageController createPageController({ + required bool reverse, + required int index, + required int itemCount, + required bool loop, + required double viewportFraction, + }) { return new PageController( initialPage: getRealIndexFromRenderIndex( reverse: reverse, index: index, itemCount: itemCount, loop: loop), @@ -338,45 +340,45 @@ class TransformerPageView extends StatefulWidget { } class _TransformerPageViewState extends State { - Size _size; - int _activeIndex; - double _currentPixels; + Size? _size; + late int _activeIndex; + late double _currentPixels; bool _done = false; ///This value will not change until user end drag. - int _fromIndex; + late int _fromIndex; - PageTransformer _transformer; + PageTransformer? _transformer; - TransformerPageController _pageController; + late TransformerPageController _pageController; Widget _buildItemNormal(BuildContext context, int index) { int renderIndex = _pageController.getRenderIndexFromRealIndex(index); - Widget child = widget.itemBuilder(context, renderIndex); + Widget child = widget.itemBuilder!(context, renderIndex); return child; } Widget _buildItem(BuildContext context, int index) { return new AnimatedBuilder( animation: _pageController, - builder: (BuildContext c, Widget w) { + builder: (BuildContext c, Widget? w) { int renderIndex = _pageController.getRenderIndexFromRealIndex(index); - Widget child; + Widget? child; if (widget.itemBuilder != null) { - child = widget.itemBuilder(context, renderIndex); + child = widget.itemBuilder!(context, renderIndex); } if (child == null) { child = new Container(); } if (_size == null) { - return child ?? new Container(); + return child; } double position; double page = _pageController.realPage; - if (_transformer.reverse) { + if (_transformer?.reverse ?? false) { position = page - index; } else { position = index - page; @@ -385,8 +387,8 @@ class _TransformerPageViewState extends State { TransformInfo info = new TransformInfo( index: renderIndex, - width: _size.width, - height: _size.height, + width: _size?.width ?? 0, + height: _size?.height ?? 0, position: position.clamp(-1.0, 1.0), activeIndex: _pageController.getRenderIndexFromRealIndex(_activeIndex), @@ -395,7 +397,7 @@ class _TransformerPageViewState extends State { done: _done, scrollDirection: widget.scrollDirection, viewportFraction: widget.viewportFraction); - return _transformer.transform(child, info); + return _transformer!.transform(child, info); }); } @@ -446,56 +448,59 @@ class _TransformerPageViewState extends State { void _onIndexChanged(int index) { _activeIndex = index; if (widget.onPageChanged != null) { - widget.onPageChanged(_pageController.getRenderIndexFromRealIndex(index)); + widget.onPageChanged!(_pageController.getRenderIndexFromRealIndex(index)); } } void _onGetSize(_) { - Size size; - if (context == null) { - onGetSize(size); - return; - } - RenderObject renderObject = context.findRenderObject(); + Size? size; + // if (context == null) { + // onGetSize(size); + // return; + // } + RenderObject? renderObject = context.findRenderObject(); if (renderObject != null) { Rect bounds = renderObject.paintBounds; - if (bounds != null) { - size = bounds.size; - } + //if (bounds != null) { + size = bounds.size; + //} + } else { + onGetSize(size); + return; } _calcCurrentPixels(); onGetSize(size); } - void onGetSize(Size size) { - if(mounted){ + void onGetSize(Size? size) { + if (mounted) { setState(() { _size = size; }); } - } @override void initState() { _transformer = widget.transformer; // int index = widget.index ?? 0; - _pageController = widget.pageController; - if (_pageController == null) { + + if (widget.pageController == null) { _pageController = new TransformerPageController( initialPage: widget.index, itemCount: widget.itemCount, loop: widget.loop, - reverse: - widget.transformer == null ? false : widget.transformer.reverse); - } + reverse: widget.transformer?.reverse ?? false); + } else + _pageController = widget.pageController!; + // int initPage = _getRealIndexFromRenderIndex(index); // _pageController = new PageController(initialPage: initPage,viewportFraction: widget.viewportFraction); _fromIndex = _activeIndex = _pageController.initialPage; _controller = getNotifier(); if (_controller != null) { - _controller.addListener(onChangeNotifier); + _controller?.addListener(onChangeNotifier); } super.initState(); } @@ -503,20 +508,18 @@ class _TransformerPageViewState extends State { @override void didUpdateWidget(TransformerPageView oldWidget) { _transformer = widget.transformer; - int index = widget.index ?? 0; + int index = widget.index; bool created = false; if (_pageController != widget.pageController) { if (widget.pageController != null) { - _pageController = widget.pageController; + _pageController = widget.pageController!; } else { created = true; _pageController = new TransformerPageController( initialPage: widget.index, itemCount: widget.itemCount, loop: widget.loop, - reverse: widget.transformer == null - ? false - : widget.transformer.reverse); + reverse: widget.transformer?.reverse ?? false); } } @@ -529,15 +532,15 @@ class _TransformerPageViewState extends State { } } if (_transformer != null) - WidgetsBinding.instance.addPostFrameCallback(_onGetSize); + WidgetsBinding.instance?.addPostFrameCallback(_onGetSize); if (_controller != getNotifier()) { if (_controller != null) { - _controller.removeListener(onChangeNotifier); + _controller?.removeListener(onChangeNotifier); } _controller = getNotifier(); if (_controller != null) { - _controller.addListener(onChangeNotifier); + _controller?.addListener(onChangeNotifier); } } super.didUpdateWidget(oldWidget); @@ -546,11 +549,11 @@ class _TransformerPageViewState extends State { @override void didChangeDependencies() { if (_transformer != null) - WidgetsBinding.instance.addPostFrameCallback(_onGetSize); + WidgetsBinding.instance?.addPostFrameCallback(_onGetSize); super.didChangeDependencies(); } - ChangeNotifier getNotifier() { + ChangeNotifier? getNotifier() { return widget.controller; } @@ -582,13 +585,13 @@ class _TransformerPageViewState extends State { } void onChangeNotifier() { - int event = widget.controller.event; + int event = widget.controller!.event; int index; switch (event) { case IndexController.MOVE: { index = _pageController - .getRealIndexFromRenderIndex(widget.controller.index); + .getRealIndexFromRenderIndex(widget.controller!.index); } break; case IndexController.PREVIOUS: @@ -601,23 +604,22 @@ class _TransformerPageViewState extends State { //ignore this event return; } - if (widget.controller.animation) { + if (widget.controller!.animation) { _pageController - .animateToPage(index, - duration: widget.duration, curve: widget.curve ?? Curves.ease) - .whenComplete(widget.controller.complete); + .animateToPage(index, duration: widget.duration, curve: widget.curve) + .whenComplete(widget.controller!.complete); } else { _pageController.jumpToPage(index); - widget.controller.complete(); + widget.controller?.complete(); } } - ChangeNotifier _controller; + ChangeNotifier? _controller; void dispose() { super.dispose(); if (_controller != null) { - _controller.removeListener(onChangeNotifier); + _controller?.removeListener(onChangeNotifier); } } } diff --git a/pubspec.lock b/pubspec.lock index 331b288..c258d09 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,55 +1,90 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# 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.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.5.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.15.0" convert: dependency: transitive description: name: convert - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.1.5" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" file: dependency: transitive description: name: file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "5.0.7" + version: "6.0.0" flutter: dependency: "direct main" description: flutter @@ -70,76 +105,41 @@ packages: description: flutter source: sdk version: "0.0.0" - intl: - dependency: transitive - description: - name: intl - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.15.7" - json_rpc_2: - dependency: transitive - description: - name: json_rpc_2 - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.9" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.12.3+1" + version: "0.12.10" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.4.0" + version: "1.8.0" platform: dependency: transitive description: name: platform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "3.0.0" process: dependency: transitive description: name: process - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.0.9" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.4.2" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.1" + version: "4.0.0" sky_engine: dependency: transitive description: flutter @@ -149,71 +149,79 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.5.4" + version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.6.8" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.1.0" + sync_http: + dependency: transitive + description: + name: sync_http + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.2.19" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" - vm_service_client: + version: "2.1.0" + vm_service: dependency: transitive description: - name: vm_service_client - url: "https://pub.flutter-io.cn" + name: vm_service + url: "https://pub.dartlang.org" source: hosted - version: "0.2.6" - web_socket_channel: + version: "5.5.0" + webdriver: dependency: transitive description: - name: web_socket_channel - url: "https://pub.flutter-io.cn" + name: webdriver + url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "2.1.2" sdks: - dart: ">=2.1.0 <3.0.0" + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/pubspec.yaml b/pubspec.yaml index 02e5bea..f294de3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: transformer_page_view description: PageTransformer for flutter -version: 0.1.6 -author: JZoom +version: 0.2.0 homepage: https://github.com/jzoom/transformer_page_view environment: - sdk: ">=2.0.0-dev.50.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" dependencies: flutter: @@ -17,4 +17,4 @@ dev_dependencies: flutter_driver: sdk: flutter -flutter: +flutter: \ No newline at end of file diff --git a/transformer_page_view.iml b/transformer_page_view.iml index 77dcfac..6048a33 100644 --- a/transformer_page_view.iml +++ b/transformer_page_view.iml @@ -9,15 +9,11 @@ - - - - - + + -