File tree Expand file tree Collapse file tree 5 files changed +63
-0
lines changed Expand file tree Collapse file tree 5 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -217,4 +217,9 @@ const PAGE_ITEMS = [
217217 "img" : PageImage .FLUTTER_OPEN ,
218218 "click" : PageName .ANIM_ROTATION ,
219219 },
220+ {
221+ "title" : PageName .ANIM_DEFAULT_TEXT ,
222+ "img" : PageImage .FLUTTER_OPEN ,
223+ "click" : PageName .ANIM_DEFAULT_TEXT ,
224+ },
220225];
Original file line number Diff line number Diff line change @@ -48,4 +48,5 @@ class PageName {
4848 static const ANIM_FADE_TRANS = "FadeTranstion" ;
4949 static const ANIM_POSITION_TRANS = "PositionTransition" ;
5050 static const ANIM_ROTATION = "RotationTransition" ;
51+ static const ANIM_DEFAULT_TEXT = "DefaultText" ;
5152}
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ class FlutterOpenApp extends StatelessWidget {
6262 PageName .ANIM_FADE_TRANS : (context) => FadeTransitionPage (),
6363 PageName .ANIM_POSITION_TRANS : (context) => PositionTransitionPage (),
6464 PageName .ANIM_ROTATION : (context) => RotationPage (),
65+ PageName .ANIM_DEFAULT_TEXT : (context) => DefaultTextPage (),
6566 },
6667 );
6768 }
Original file line number Diff line number Diff line change 1+ ///
2+ /// Created by NieBin on 2019/6/9
3+ /// Github: https://github.com/nb312
4+ 5+ ///
6+ import "package:flutter/material.dart" ;
7+ import 'package:flutter_widgets/const/_const.dart' ;
8+
9+ class DefaultTextPage extends StatefulWidget {
10+ @override
11+ DefaultState createState () => DefaultState ();
12+ }
13+
14+ class DefaultState extends State <DefaultTextPage > {
15+ Color _color = RED_LIGHT ;
16+
17+ Widget _defaultText () => Column (
18+ children: < Widget > [
19+ AnimatedDefaultTextStyle (
20+ child: Text (
21+ "Default Text" ,
22+ style: TextStyle (fontSize: 20 ),
23+ ),
24+ style: TextStyle (color: _color),
25+ duration: Duration (seconds: 1 ),
26+ ),
27+ FloatingActionButton (
28+ child: Text ("Click" ),
29+ onPressed: () {
30+ setState (() {
31+ if (_color == RED_LIGHT ) {
32+ _color = BLUE_DEEP ;
33+ } else {
34+ _color = RED_LIGHT ;
35+ }
36+ });
37+ },
38+ )
39+ ],
40+ );
41+
42+ @override
43+ Widget build (BuildContext context) {
44+ return Scaffold (
45+ appBar: AppBar (
46+ title: Text (PageName .ANIM_DEFAULT_TEXT ),
47+ ),
48+ body: Column (
49+ children: < Widget > [
50+ _defaultText (),
51+ ],
52+ ),
53+ );
54+ }
55+ }
Original file line number Diff line number Diff line change @@ -9,3 +9,4 @@ export 'HeroPage.dart';
99export 'FadeTransitionPage.dart' ;
1010export 'PositionTransitionPage.dart' ;
1111export 'RotationPage.dart' ;
12+ export 'DefaultTextPage.dart' ;
You can’t perform that action at this time.
0 commit comments