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
+1 -2
View File
@@ -39,7 +39,6 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn));
_controller.addListener(() {
print(_controller.value);
setState(() {});
});
_controller.addStatusListener((status) {
@@ -285,7 +284,7 @@ class _AddPageState extends State<AddPage> with SingleTickerProviderStateMixin {
"year": today.year,
});
Navigator.of(context).pop();
_controller.reverse();
} else {
Scaffold.of(context).showSnackBar(SnackBar(
content: Text("Select a value and a cagtegory")));
+1 -10
View File
@@ -90,16 +90,7 @@ class _HomePageState extends State<HomePage> {
onPressed: () {
buttonRect = RectGetter.getRectFromKey(globalKey);
print(buttonRect);
var page = AddPageTransition(
background: widget,
page: AddPage(
buttonRect: buttonRect,
),
);
Navigator.of(context).push(page);
Navigator.of(context).pushNamed('/add', arguments: buttonRect);
},
),
),