在Flutter中重新创建crossDissolve导航

时间:2019-01-17 20:36:49

标签: animation routes navigation flutter

在Flutter中使用路线在两个页面之间导航时,如何从iOS重新创建modalTransitionStyle = .crossDissolve

1 个答案:

答案 0 :(得分:1)

在这里,您可以更改transitionDuration:

              Navigator.of(context).push(
        PageRouteBuilder<Null>(
            pageBuilder: (BuildContext context, Animation<double> animation,
                Animation<double> secondaryAnimation) {
              return AnimatedBuilder(
                  animation: animation,
                  builder: (BuildContext context, Widget child) {
                    return Opacity(
                      opacity: animation.value,
                      child: YourWidgetPage(),
                    );
                  });
            },
            transitionDuration: Duration(milliseconds: 600)),
      );