Created
June 11, 2019 10:30
-
-
Save timbergus/3fa517ec460836a7ad5ad2dd9f819885 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/material.dart'; | |
class ViewB extends StatelessWidget { | |
final String message; | |
ViewB({Key key, this.message}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
final Map args = ModalRoute.of(context).settings.arguments; | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('View B'), | |
), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Text( | |
'${args['message']}', | |
style: TextStyle( | |
fontSize: 20, | |
), | |
), | |
RaisedButton( | |
onPressed: () => Navigator.pop(context), | |
color: Colors.green, | |
child: Text( | |
'Return to View A', | |
style: TextStyle( | |
color: Colors.white, | |
), | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment