Skip to content

Instantly share code, notes, and snippets.

@nuxibyte
Created April 1, 2018 16:16
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/9abd551217eb3781b67e0f04f2b34fe4 to your computer and use it in GitHub Desktop.
Save nuxibyte/9abd551217eb3781b67e0f04f2b34fe4 to your computer and use it in GitHub Desktop.
textfieldtab
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.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 CupertinoTabScaffold(
tabBar: new CupertinoTabBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(icon: new Icon(Icons.home), title: new Text("One")),
new BottomNavigationBarItem(icon: new Icon(Icons.home), title: new Text("Two")),
new BottomNavigationBarItem(icon: new Icon(Icons.home), title: new Text("Three")),
],
),
tabBuilder: (BuildContext context, int index) {
return new CupertinoTabView(builder: (BuildContext context){
return new CupertinoPageScaffold(
navigationBar: new CupertinoNavigationBar(),
child: createTextFieldListView(),
);
});
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment