Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String txt = "";
- TextEditingController controllerTxt = new TextEditingController();
- @override
- Widget build(BuildContext context) {
- return new Scaffold(
- appBar: new AppBar(
- title: Text('Create'),
- actions: <Widget>[
- FlatButton(
- child: Text('Submit'),
- textColor: Colors.white,
- onPressed: () {
- Navigator.pushNamed(context, '/ResultPage',
- arguments: (controllerTxt.text));
- },
- ),
- ],
- ),
- body: new ListView(
- children: <Widget>[
- new Container(
- child: new Column(
- children: <Widget>[
- new TextField(
- controller: controllerTxt,
- maxLines: 25,
- ),
- ],
- ),
- ),
- ],
- ),
- );
- }
- class _ResultPageState extends State<ResultPage> {
- String result;
- @override
- Widget build(BuildContext context) {
- RouteSettings settings = ModalRoute.of(context).settings;
- result = settings.arguments;
- return new Scaffold(
- appBar: new AppBar(
- title: Text('Create'),
- actions: <Widget>[
- ],
- ),
- body: new Container(
- padding: EdgeInsets.all(10.0),
- child: new Row(
- children: <Widget>[
- new Text('Name : '),
- Expanded(
- child: new TextField(
- enabled: false,
- decoration: new InputDecoration(
- border: new OutlineInputBorder(
- borderSide: new BorderSide(color: Colors.black)),
- labelText: ('${result}'),
- ),
- )),
- ],
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement