Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class SecondScreen extends StatefulWidget {
  4. //Create an Object to receive the Passed Data from _TextFieldController
  5. final String value;
  6. //This is how it goes to Secondscreen using key value
  7. SecondScreen({Key key, this.value}) : super (key: key);
  8.  
  9. @override
  10. _SecondScreenState createState() => new _SecondScreenState();
  11. }
  12.  
  13. class _SecondScreenState extends State<SecondScreen> {
  14. @override
  15. Widget build(BuildContext context) {
  16. return Scaffold(
  17. appBar: AppBar(
  18. title: Text("Screen 2"),
  19. ),
  20. body: Center(
  21. //Display The Object received
  22. child: new Text("${widget.value}"),
  23. /*child: RaisedButton(
  24. child: Text('Goto Screen 3'),
  25. onPressed: () {
  26. //ke screen 3
  27. Navigator.of(context).pushNamed('/screen3');
  28. //----
  29. },
  30. ), */
  31. ),
  32. );
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement