1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
| import 'dart:ui';
|
| import 'package:flutter/cupertino.dart';
|
| //滑动效果
| class CustomRouteSlide extends PageRouteBuilder {
| final Widget widget;
|
| CustomRouteSlide(this.widget)
| : super(
| transitionDuration: const Duration(milliseconds: 500),
| pageBuilder: (BuildContext context, Animation<double> animation1,
| Animation<double> animation2) {
| return widget;
| },
| transitionsBuilder: (BuildContext context,
| Animation<double> animation1,
| Animation<double> animation2,
| Widget child) {
| return SlideTransition(
| position: Tween<Offset>(
| begin: Offset(1.0, 0.0), end: Offset(0.0, 0.0))
| .animate(CurvedAnimation(
| parent: animation1, curve: Curves.fastOutSlowIn)),
| child: child,
| );
| });
| }
|
|