Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(new MaterialApp(
- home: new MyApp(),
- ));
- }
- class Countdown extends AnimatedWidget {
- Countdown({ Key key, this.animation }) : super(key: key, listenable: animation);
- Animation<int> animation;
- @override
- build(BuildContext context){
- return new Text(
- animation.value.toString(),
- style: new TextStyle(fontSize: 150.0),
- );
- }
- }
- class MyApp extends StatefulWidget {
- State createState() => new _MyAppState();
- }
- class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
- AnimationController _controller;
- static const int kStartValue = 4;
- @override
- void initState() {
- super.initState();
- _controller = new AnimationController(
- vsync: this,
- duration: new Duration(seconds: kStartValue),
- );
- }
- @override
- Widget build(BuildContext context) {
- return new Scaffold(
- floatingActionButton: new FloatingActionButton(
- child: new Icon(Icons.play_arrow),
- onPressed: () => _controller.forward(from: 0.0),
- ),
- body: new Stack(
- children: <Widget>[
- new ListView(
- scrollDirection: Axis.horizontal,
- children: <Widget>[
- new Container(
- color: Colors.lightBlueAccent,
- child: new Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- new Container(
- width: 30.0,
- height: 30.0,
- color: Colors.grey,
- ),
- new Container(
- width: 30.0,
- height: 30.0,
- color: Colors.orange,
- ),
- new Container(
- width: 30.0,
- height: 30.0,
- color: Colors.blue,
- ),
- new Container(
- color: Colors.black87,
- child: new Row(
- children: <Widget>[
- new Container(
- width: 30.0,
- height: 30.0,
- color: Colors.pinkAccent,
- ),
- new Container(
- width: 30.0,
- height: 30.0,
- color: Colors.greenAccent,
- ),
- new Container(
- width: 30.0,
- height: 30.0,
- color: Colors.yellow,
- ),
- ],
- ),
- ),
- new Container(
- width: 90.0,
- height: MediaQuery.of(context).size.height-120,
- child: new Column(
- children: <Widget>[
- new Expanded(
- child: new Container(
- color: Colors.black,
- ),
- flex: 1,
- ),
- new Expanded(
- child: new Container(
- color: Colors.yellow,
- ),
- flex: 1,
- ),
- new Expanded(
- child: new Container(
- color: Colors.white,
- ),
- flex: 1,
- ),
- ],
- ),
- )
- ],
- ),
- ),
- new Container(
- width: 200.0,
- color: Colors.pinkAccent,
- ),
- new SizedBox(
- width: 10.0,
- ),
- new Container(
- width: 200.0,
- color: Colors.pinkAccent,
- ),
- new SizedBox(
- width: 10.0,
- ),
- new Container(
- width: 200.0,
- color: Colors.pinkAccent,
- ),
- new SizedBox(
- width: 10.0,
- ),
- ],
- ),
- new Positioned(
- bottom: 200.0,
- left: 50.0,
- child: new Container(
- width: 150.0,
- height: 150.0,
- color: Colors.black45,
- )
- ),
- ],
- )
- );
- }
- }
Add Comment
Please, Sign In to add comment