From 6a6db3a8ef47d3a9d673048a034db1a1cf46140f Mon Sep 17 00:00:00 2001 From: Shi-Hao Hong Date: Fri, 21 Feb 2020 10:26:04 -0800 Subject: [PATCH] [animations] Fix analyzer warnings (#109) * Update pubspec.yaml * Update CHANGELOG.md * Fix analyzer warnings --- packages/animations/CHANGELOG.md | 9 +++++++ .../example/lib/container_transition.dart | 25 +++++++++++++++---- .../example/lib/fade_through_transition.dart | 5 +++- .../example/lib/shared_axis_transition.dart | 10 ++++++-- packages/animations/lib/src/modal.dart | 3 +++ packages/animations/pubspec.yaml | 2 +- 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/packages/animations/CHANGELOG.md b/packages/animations/CHANGELOG.md index e0ccfcf2a1f..6a896e8afb0 100644 --- a/packages/animations/CHANGELOG.md +++ b/packages/animations/CHANGELOG.md @@ -1,3 +1,12 @@ +## [1.0.0+4] - February 21, 2020 + +* Fix a typo in the changelog dates +* Revert use of modern Material text style nomenclature in the example app + to be compatible with Flutter's `stable` branch for the time being. +* Add override analyzer ignore in modal.dart for reverseTransitionDuration + until Flutter's stable branch contains + https://github.com/flutter/flutter/pull/48274. + ## [1.0.0+3] - February 18, 2020 * Update README.md to better describe Material motion diff --git a/packages/animations/example/lib/container_transition.dart b/packages/animations/example/lib/container_transition.dart index 1af6d950871..e51286f0344 100644 --- a/packages/animations/example/lib/container_transition.dart +++ b/packages/animations/example/lib/container_transition.dart @@ -313,7 +313,10 @@ class _ExampleCard extends StatelessWidget { 'adipiscing elit, sed do eiusmod tempor.', style: Theme.of(context) .textTheme - .bodyText2 + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + .body1 .copyWith(color: Colors.black54), ), ), @@ -359,7 +362,10 @@ class _SmallerCard extends StatelessWidget { children: [ Text( 'Title', - style: Theme.of(context).textTheme.headline6, + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + style: Theme.of(context).textTheme.title, ), const SizedBox(height: 4), Text( @@ -409,7 +415,10 @@ class _ExampleSingleTile extends StatelessWidget { children: [ Text( 'Title', - style: Theme.of(context).textTheme.subtitle1, + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + style: Theme.of(context).textTheme.subhead, ), const SizedBox(height: 8), Text( @@ -476,7 +485,10 @@ class _DetailsPage extends StatelessWidget { children: [ Text( 'Title', - style: Theme.of(context).textTheme.headline5.copyWith( + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + style: Theme.of(context).textTheme.headline.copyWith( color: Colors.black54, fontSize: 30.0, ), @@ -484,7 +496,10 @@ class _DetailsPage extends StatelessWidget { const SizedBox(height: 10), Text( _loremIpsumParagraph, - style: Theme.of(context).textTheme.bodyText2.copyWith( + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + style: Theme.of(context).textTheme.body1.copyWith( color: Colors.black54, height: 1.5, fontSize: 16.0, diff --git a/packages/animations/example/lib/fade_through_transition.dart b/packages/animations/example/lib/fade_through_transition.dart index 65e13322bb5..c9b0f20bee5 100644 --- a/packages/animations/example/lib/fade_through_transition.dart +++ b/packages/animations/example/lib/fade_through_transition.dart @@ -93,7 +93,10 @@ class _ExampleCard extends StatelessWidget { children: [ Text( '123 photos', - style: Theme.of(context).textTheme.bodyText1, + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + style: Theme.of(context).textTheme.body2, ), Text( '123 photos', diff --git a/packages/animations/example/lib/shared_axis_transition.dart b/packages/animations/example/lib/shared_axis_transition.dart index 351ca5ecb59..d0bc920c741 100644 --- a/packages/animations/example/lib/shared_axis_transition.dart +++ b/packages/animations/example/lib/shared_axis_transition.dart @@ -122,7 +122,10 @@ class _CoursePage extends StatelessWidget { const Padding(padding: EdgeInsets.symmetric(vertical: 8.0)), Text( 'Streamling your courses', - style: Theme.of(context).textTheme.headline5, + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + style: Theme.of(context).textTheme.headline, textAlign: TextAlign.center, ), const Padding(padding: EdgeInsets.symmetric(vertical: 5.0)), @@ -194,7 +197,10 @@ class _SignInPage extends StatelessWidget { Padding(padding: EdgeInsets.symmetric(vertical: maxHeight / 50)), Text( 'Hi David Park', - style: Theme.of(context).textTheme.headline5, + // TODO(shihaohong): Remove this once Flutter stable adopts the modern + // Material text style nomenclature. + // ignore: deprecated_member_use + style: Theme.of(context).textTheme.headline, ), Padding(padding: EdgeInsets.symmetric(vertical: maxHeight / 50)), const Text( diff --git a/packages/animations/lib/src/modal.dart b/packages/animations/lib/src/modal.dart index c0366219902..4844a478138 100644 --- a/packages/animations/lib/src/modal.dart +++ b/packages/animations/lib/src/modal.dart @@ -106,6 +106,9 @@ class _ModalRoute extends PopupRoute { @override final Duration transitionDuration; + // TODO(shihaohong): Remove the override analyzer ignore once + // Flutter stable contains https://github.com/flutter/flutter/pull/48274. + // ignore: override_on_non_overriding_member @override final Duration reverseTransitionDuration; diff --git a/packages/animations/pubspec.yaml b/packages/animations/pubspec.yaml index df317e69c8a..c3784327360 100644 --- a/packages/animations/pubspec.yaml +++ b/packages/animations/pubspec.yaml @@ -1,6 +1,6 @@ name: animations description: Fancy pre-built animations that can easily be integrated into any Flutter application. -version: 1.0.0+3 +version: 1.0.0+4 homepage: https://github.com/flutter/packages/tree/master/packages/animations environment: