buildForwardTransition()
For those times when you want to do something as you move away from a route into the next one, as well as when you move into it from the previous one.
This commit is contained in:
@@ -8,6 +8,7 @@ import 'dart:async';
|
||||
import 'dart:math' as math;
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
|
||||
@@ -146,13 +146,22 @@ class StockHomeState extends State<StockHome> {
|
||||
}
|
||||
|
||||
Widget buildToolBar() {
|
||||
PageRoute page = ModalRoute.of(context);
|
||||
return new ToolBar(
|
||||
elevation: 0,
|
||||
left: new IconButton(
|
||||
icon: "navigation/menu",
|
||||
onPressed: _showDrawer
|
||||
),
|
||||
center: new Text('Stocks'),
|
||||
center: new FadeTransition(
|
||||
opacity: new AnimatedValue<double>(
|
||||
1.0,
|
||||
end: 0.0,
|
||||
curve: const Interval(0.0, 0.5)
|
||||
),
|
||||
performance: page.forwardPerformance,
|
||||
child: new Text('Stocks')
|
||||
),
|
||||
right: <Widget>[
|
||||
new IconButton(
|
||||
icon: "action/search",
|
||||
|
||||
@@ -53,6 +53,7 @@ class StockSymbolPage extends StatelessComponent {
|
||||
final Stock stock;
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
PageRoute page = ModalRoute.of(context);
|
||||
return new Scaffold(
|
||||
toolBar: new ToolBar(
|
||||
left: new IconButton(
|
||||
@@ -61,7 +62,15 @@ class StockSymbolPage extends StatelessComponent {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
),
|
||||
center: new Text(stock.name)
|
||||
center: new FadeTransition(
|
||||
opacity: new AnimatedValue<double>(
|
||||
0.0,
|
||||
end: 1.0,
|
||||
curve: const Interval(0.5, 1.0)
|
||||
),
|
||||
performance: page.performance,
|
||||
child: new Text(stock.name)
|
||||
)
|
||||
),
|
||||
body: new Block(<Widget>[
|
||||
new Container(
|
||||
|
||||
Reference in New Issue
Block a user