Skip to content

Instantly share code, notes, and snippets.

@manujbahl
Created May 25, 2018 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manujbahl/874ab6c7ec8459899968bfb6fb367d6b to your computer and use it in GitHub Desktop.
Save manujbahl/874ab6c7ec8459899968bfb6fb367d6b to your computer and use it in GitHub Desktop.
Demo
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(new MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
home: new Scaffold( // 1
appBar: new AppBar(
title: new Text("Demo"), // screen title
),
body: new Container(
color: Colors.blueGrey,
child: myWidget()
)
)
);
}
Widget myWidget() {
var textStyle = new TextStyle(
color:Colors.red,
fontSize: 14.0
);
return new Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
new Container(
color: Colors.red,
height: 100.0,
width: 100.0,
),
new TextField(
keyboardType:TextInputType.number,
textAlign: TextAlign.center,
onChanged: (text) {
},
decoration: new InputDecoration(
hintText: 'placeholder',
fillColor: Colors.yellow,
filled: true,
hintStyle: textStyle
),
style: textStyle
),
new Container(
color: Colors.green,
height: 100.0,
width: 100.0,
)
],
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment