Sunday, 4 August 2019

A rich and easy-to-use flutter page transition package



flutter_page_transition

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













Getting Started

Add this to your package's pubspec.yaml file:
dependencies:
  flutter_page_transition: ^0.1.0
YAML
You can also depend on this package stored in my repository:
flutter_page_transition:
  git:
    url: git://github.com/handoing/flutter_page_transition.git
YAML
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()));


Dart
Create custom methods:
Bash

Test Driver

run driver test
ce example/
flutter drive --target=test_driver/app.dart
Bash

GitHub

A rich, convenient, easy-to-use flutter page transition package — Read More
Latest commit to the master branch on 7-18-2019
Download as zip