Created
August 28, 2019 03:23
-
-
Save lawreyios/bd445ad482d6fc425cda4ac56273f5c4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
class SecondPage extends StatelessWidget { | |
final TextEditingController textController = new TextEditingController(); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: <Widget>[ | |
Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: TextField( | |
autofocus: true, | |
style: TextStyle(fontSize: 20.0), | |
controller: textController, | |
), | |
), | |
SizedBox( | |
height: 8.0, | |
), | |
RaisedButton( | |
child: Text( | |
'Submit', | |
style: TextStyle(color: Colors.white), | |
), | |
color: Colors.blue, | |
onPressed: () { | |
Navigator.pop(context, textController.text); | |
}, | |
) | |
], | |
)), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment