Make custom transition transparent so we dont need a 'background'
This reduces the animation overhead and cleanup the code.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user