Skip to content

Instantly share code, notes, and snippets.

@nuxibyte
Created April 1, 2018 16:15
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 nuxibyte/e11df7abd3bfed392b18fb55e4529a3e to your computer and use it in GitHub Desktop.
Save nuxibyte/e11df7abd3bfed392b18fb55e4529a3e to your computer and use it in GitHub Desktop.
textfield
import 'package:flutter/material.dart';
void main() => runApp(new MaterialApp(home: new MyHomePage()));
class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Widget createTextFieldListView(){
return new ListView(
shrinkWrap: true,
reverse: true,
children: <Widget>[
new TextField(
decoration: new InputDecoration(hintText: "Add text here"),
),
new AspectRatio(
aspectRatio: 1.0,
child: new Container(
color: Colors.green,
),
),
].toList(),
);
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text("textfield")),
body: createTextFieldListView(),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment