flutter_page_transition 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

flutter_page_transition #

A rich, convenient, easy-to-use flutter page transition package.

Version

README in Chinese

Some Demos #

Getting Started #

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_page_transition: ^0.1.0

You can also depend on this package stored in my repository:

flutter_page_transition:
  git:
    url: git://github.com/handoing/flutter_page_transition.git

You should then run flutter packages upgrade.

Transition Type #

Page Transition TypeDirection
slideInLeft⬅️
slideInLeft➡️
slideInUp⬆️
slideInDown⬇️
slideLeft⬅️
slideRight➡️
slideUp⬆️
slideDown⬇️
slideParallaxLeft⬅️
slideParallaxRight➡️
slideParallaxUp⬆️
slideParallaxDown⬇️
slideZoomLeft⬅️
slideZoomRight➡️
slideZoomUp⬆️
slideZoomDown⬇️
rippleRightUp↖️
rippleLeftUp↗️
transferRight⬅️
transferUp⬆️
fadeIn
custom

Example #

Use PageRouteBuilder Widget

initialRoute: 'Home',
onGenerateRoute: (RouteSettings routeSettings){
    return new PageRouteBuilder<dynamic>(
      settings: routeSettings,
      pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
        switch (routeSettings.name){
          case 'Home':
            return HomePage();
          case 'Other':
            return OtherPage();
          default:
            return null;
        }
      },
      transitionDuration: const Duration(milliseconds: 300),
      transitionsBuilder: (BuildContext context, Animation<double> animation,
          Animation<double> secondaryAnimation, Widget child) {
          return effectMap[PageTransitionType.slideInLeft](Curves.linear, animation, secondaryAnimation, child);
      }
    );
}

// use Navigator
Navigator.of(context).pushNamed('Other');
// or
Navigator.of(context).push(PageTransition(type: PageTransitionType.slideInLeft, child: FirstPage()));


Create custom methods:

transitionEffect.createCustomEffect(
  handle: (Curve curve, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
    return new SlideTransition(
      position: new Tween<Offset>(
        begin: const Offset(1.0, 0.0),
        end: const Offset(0.0, 0.0),
      ).animate(CurvedAnimation(parent: animation, curve: curve)),
      child: child,
    );
  }
);

// use custom
effectMap[PageTransitionType.custom](Curves.linear, animation, secondaryAnimation, child);

Test #

run test

flutter test

Test Driver #

run driver test

cd example/
flutter drive --target=test_driver/app.dart

License #

MIT

[0.1.4] - Update README (2019.07.18)

  • update README.md.

[0.1.3] - Add README-zh (2019.07.18)

  • add README-zh.md.

[0.1.2] - Update Description (2019.07.18)

  • update description to increase maintenance.

[0.1.1] - Update README (2019.07.18)

  • update README.md.

[0.1.0] - Add Test (2019.07.18)

  • add test.

[0.0.5] - Add Example (2019.07.18)

  • add example.

[0.0.4] - Update Describe (2019.07.18)

  • remove editor files.
  • update README.md.

[0.0.3] - Add Transfer Type (2019.04.26)

  • add transferRight and transferUp.

[0.0.2] - Add Custom Type (2019.04.24)

  • add custom type.
  • add demo screenshots.

[0.0.1] - Init Package (2019.04.23)

  • init package.

example/README.md

example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Test Driver #

run driver test

flutter drive --target=test_driver/app.dart

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_page_transition: ^0.1.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_page_transition/flutter_page_transition.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

We analyzed this package on Oct 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-0.35 points)

88 out of 90 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/flutter_page_transition.dart.

Run flutter format to format lib/flutter_page_transition.dart.

Format lib/page_transition_type.dart.

Run flutter format to format lib/page_transition_type.dart.

Format lib/transition_effect.dart.

Run flutter format to format lib/transition_effect.dart.

Format lib/transition_tween.dart.

Run flutter format to format lib/transition_tween.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test