@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
77class AnimatedCrossFadeExample extends StatefulWidget {
88 final String title;
99
10- AnimatedCrossFadeExample (this .title);
10+ const AnimatedCrossFadeExample (this .title);
1111
1212 @override
1313 _AnimatedCrossFadeExampleState createState () =>
@@ -23,32 +23,28 @@ class _AnimatedCrossFadeExampleState extends State<AnimatedCrossFadeExample> {
2323 appBar: AppBar (
2424 title: Text (widget.title),
2525 ),
26- body: Container (
27- child: Center (
28- child: Column (
29- children: < Widget > [
30- TextButton (
31- onPressed: () {
32- setState (() {
33- _first = ! _first;
34- });
35- },
36- child: Text ("Click" )),
37- AnimatedCrossFade (
38- sizeCurve: ElasticOutCurve (),
39- firstCurve: Curves .decelerate,
40- secondCurve: Curves .decelerate,
41- duration: const Duration (seconds: 3 ),
42- firstChild: const FlutterLogo (
43- style: FlutterLogoStyle .horizontal, size: 100.0 ),
44- secondChild: const FlutterLogo (
45- style: FlutterLogoStyle .markOnly, size: 100.0 ),
46- crossFadeState: _first
47- ? CrossFadeState .showFirst
48- : CrossFadeState .showSecond,
49- ),
50- ],
51- ),
26+ body: Center (
27+ child: Column (
28+ children: < Widget > [
29+ TextButton (
30+ onPressed: () {
31+ setState (() {
32+ _first = ! _first;
33+ });
34+ },
35+ child: const Text ("Click" )),
36+ AnimatedCrossFade (
37+ sizeCurve: const ElasticOutCurve (),
38+ firstCurve: Curves .decelerate,
39+ secondCurve: Curves .decelerate,
40+ duration: const Duration (seconds: 3 ),
41+ firstChild: const FlutterLogo (
42+ style: FlutterLogoStyle .horizontal, size: 100.0 ),
43+ secondChild: const FlutterLogo (size: 100.0 ),
44+ crossFadeState:
45+ _first ? CrossFadeState .showFirst : CrossFadeState .showSecond,
46+ ),
47+ ],
5248 ),
5349 ),
5450 );
0 commit comments