Make custom transition transparent so we dont need a 'background'

This reduces the animation overhead and cleanup the code.
This commit is contained in:
Ricardo Markiewicz
2019-07-02 10:02:37 -03:00
parent a9453903e8
commit 8ab8692bbb
4 changed files with 19 additions and 26 deletions
+5 -6
View File
@@ -2,14 +2,13 @@ import 'package:flutter/material.dart';
class AddPageTransition extends PageRouteBuilder {
final Widget page;
final Widget background;
AddPageTransition({this.page, this.background})
AddPageTransition({this.page})
: super(
transitionDuration: Duration(microseconds: 1),
pageBuilder: (context, animation1, animation2) => page,
transitionsBuilder: (context, animation1, animation, child) =>
Stack(
children: <Widget>[background, child],
));
transitionsBuilder: (context, animation1, animation, child) => child);
@override
bool get opaque => false;
}