Guest User

Untitled

a guest
Aug 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. void main() {
  4. runApp(new MaterialApp(
  5. home: new MyApp(),
  6. ));
  7. }
  8.  
  9. class Countdown extends AnimatedWidget {
  10. Countdown({ Key key, this.animation }) : super(key: key, listenable: animation);
  11. Animation<int> animation;
  12.  
  13. @override
  14. build(BuildContext context){
  15. return new Text(
  16. animation.value.toString(),
  17. style: new TextStyle(fontSize: 150.0),
  18. );
  19. }
  20. }
  21.  
  22. class MyApp extends StatefulWidget {
  23. State createState() => new _MyAppState();
  24. }
  25.  
  26. class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
  27. AnimationController _controller;
  28.  
  29. static const int kStartValue = 4;
  30.  
  31. @override
  32. void initState() {
  33. super.initState();
  34. _controller = new AnimationController(
  35. vsync: this,
  36. duration: new Duration(seconds: kStartValue),
  37. );
  38. }
  39.  
  40. @override
  41. Widget build(BuildContext context) {
  42. return new Scaffold(
  43. floatingActionButton: new FloatingActionButton(
  44. child: new Icon(Icons.play_arrow),
  45. onPressed: () => _controller.forward(from: 0.0),
  46. ),
  47. body: new Stack(
  48. children: <Widget>[
  49. new ListView(
  50. scrollDirection: Axis.horizontal,
  51. children: <Widget>[
  52. new Container(
  53. color: Colors.lightBlueAccent,
  54. child: new Column(
  55. crossAxisAlignment: CrossAxisAlignment.start,
  56. children: <Widget>[
  57. new Container(
  58. width: 30.0,
  59. height: 30.0,
  60. color: Colors.grey,
  61. ),
  62. new Container(
  63. width: 30.0,
  64. height: 30.0,
  65. color: Colors.orange,
  66. ),
  67. new Container(
  68. width: 30.0,
  69. height: 30.0,
  70. color: Colors.blue,
  71. ),
  72. new Container(
  73. color: Colors.black87,
  74. child: new Row(
  75. children: <Widget>[
  76. new Container(
  77. width: 30.0,
  78. height: 30.0,
  79. color: Colors.pinkAccent,
  80. ),
  81. new Container(
  82. width: 30.0,
  83. height: 30.0,
  84. color: Colors.greenAccent,
  85. ),
  86. new Container(
  87. width: 30.0,
  88. height: 30.0,
  89. color: Colors.yellow,
  90. ),
  91. ],
  92. ),
  93. ),
  94. new Container(
  95. width: 90.0,
  96. height: MediaQuery.of(context).size.height-120,
  97. child: new Column(
  98. children: <Widget>[
  99. new Expanded(
  100. child: new Container(
  101. color: Colors.black,
  102. ),
  103. flex: 1,
  104. ),
  105. new Expanded(
  106. child: new Container(
  107. color: Colors.yellow,
  108. ),
  109. flex: 1,
  110. ),
  111. new Expanded(
  112. child: new Container(
  113. color: Colors.white,
  114. ),
  115. flex: 1,
  116. ),
  117. ],
  118. ),
  119. )
  120. ],
  121. ),
  122. ),
  123.  
  124. new Container(
  125. width: 200.0,
  126. color: Colors.pinkAccent,
  127. ),
  128. new SizedBox(
  129. width: 10.0,
  130. ),
  131. new Container(
  132. width: 200.0,
  133. color: Colors.pinkAccent,
  134. ),
  135. new SizedBox(
  136. width: 10.0,
  137. ),
  138. new Container(
  139. width: 200.0,
  140. color: Colors.pinkAccent,
  141. ),
  142. new SizedBox(
  143. width: 10.0,
  144. ),
  145. ],
  146. ),
  147. new Positioned(
  148. bottom: 200.0,
  149. left: 50.0,
  150. child: new Container(
  151. width: 150.0,
  152. height: 150.0,
  153. color: Colors.black45,
  154. )
  155. ),
  156.  
  157. ],
  158. )
  159.  
  160. );
  161. }
  162. }
Add Comment
Please, Sign In to add comment