Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ramansah
Created December 8, 2018 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ramansah/e7b7c6f3d999395f55c3d189757b2bb2 to your computer and use it in GitHub Desktop.
Save ramansah/e7b7c6f3d999395f55c3d189757b2bb2 to your computer and use it in GitHub Desktop.
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