in packages/animations/example/lib/main.dart [39:123]
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Material Transitions')),
body: Column(
children: <Widget>[
Expanded(
child: ListView(
children: <Widget>[
_TransitionListTile(
title: 'Container transform',
subtitle: 'OpenContainer',
onTap: () {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (BuildContext context) {
return const OpenContainerTransformDemo();
},
),
);
},
),
_TransitionListTile(
title: 'Shared axis',
subtitle: 'SharedAxisTransition',
onTap: () {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (BuildContext context) {
return const SharedAxisTransitionDemo();
},
),
);
},
),
_TransitionListTile(
title: 'Fade through',
subtitle: 'FadeThroughTransition',
onTap: () {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (BuildContext context) {
return const FadeThroughTransitionDemo();
},
),
);
},
),
_TransitionListTile(
title: 'Fade',
subtitle: 'FadeScaleTransition',
onTap: () {
Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (BuildContext context) {
return const FadeScaleTransitionDemo();
},
),
);
},
),
],
),
),
const Divider(height: 0.0),
SafeArea(
child: SwitchListTile(
value: _slowAnimations,
onChanged: (bool value) async {
setState(() {
_slowAnimations = value;
});
// Wait until the Switch is done animating before actually slowing
// down time.
if (_slowAnimations) {
await Future<void>.delayed(const Duration(milliseconds: 300));
}
timeDilation = _slowAnimations ? 20.0 : 1.0;
},
title: const Text('Slow animations'),
),
),
],
),
);
}