Created
December 8, 2018 15:04
-
-
Save ramansah/e7b7c6f3d999395f55c3d189757b2bb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Welcome to Flutter', | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('Timer'), | |
), | |
body: Center( | |
child: Column( | |
mainAxisSize: MainAxisSize.min, | |
children: <Widget>[ | |
Row( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
CustomTextContainer(label: 'HRS'), | |
CustomTextContainer(label: 'MIN'), | |
CustomTextContainer(label: 'SEC'), | |
], | |
), | |
Container( | |
margin: EdgeInsets.only(top: 20), | |
child: RaisedButton( | |
child: Text('START'), | |
onPressed: () { | |
}, | |
), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} | |
class CustomTextContainer extends StatelessWidget { | |
CustomTextContainer({this.label}); | |
final String label; | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
margin: EdgeInsets.symmetric(horizontal: 5), | |
padding: EdgeInsets.all(20), | |
decoration: new BoxDecoration( | |
borderRadius: new BorderRadius.circular(10), | |
color: Colors.black87, | |
), | |
child: Column( | |
mainAxisSize: MainAxisSize.min, | |
children: <Widget>[ | |
Text( | |
'00', | |
style: TextStyle( | |
color: Colors.white, | |
fontSize: 54, | |
fontWeight: FontWeight.bold, | |
), | |
), | |
Text( | |
'$label', | |
style: TextStyle( | |
color: Colors.white70, | |
), | |
) | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment