Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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