Line data Source code
1 : import 'package:flutter/material.dart';
2 : import 'package:nav/route/custom_page_route_builder.dart';
3 :
4 : class BlinkRoute<T> extends CustomPageRouteBuilder<T> {
5 : final Widget widget;
6 :
7 1 : BlinkRoute(this.widget)
8 1 : : super(
9 1 : pageBuilder: (BuildContext context, Animation<double> animation,
10 : Animation<double> secondaryAnimation) {
11 : return widget;
12 : },
13 : transitionDuration: const Duration(microseconds: 0),
14 1 : transitionsBuilder: (BuildContext context,
15 : Animation<double> animation,
16 : Animation<double> secondaryAnimation,
17 : Widget child) {
18 1 : return FadeTransition(
19 2 : opacity: Tween<double>(begin: 0.0, end: 1.0).animate(animation),
20 : child: child,
21 : );
22 : });
23 : }
|