Created
March 5, 2018 21:50
-
-
Save anilcancakir/ddfaf99944f4d7228ab943a823858523 to your computer and use it in GitHub Desktop.
How to use dynamic home page in Flutter? - HomePage
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:app/main.dart'; | |
| import 'package:flutter/material.dart'; | |
| class HomePage extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) => new Scaffold( | |
| appBar: new AppBar( | |
| title: new Text('Home'), | |
| ), | |
| body: new Container( | |
| margin: new EdgeInsets.only( | |
| top: 50.0 | |
| ), | |
| alignment: Alignment.center, | |
| child: new Column( | |
| children: <Widget>[ | |
| new Text('Welcome to App!'), | |
| new FlatButton( | |
| child: new Text( | |
| 'Logout' | |
| ), | |
| onPressed: () { | |
| appAuth.logout().then( | |
| (_) => Navigator.of(context).pushReplacementNamed('/login') | |
| ); | |
| } | |
| ) | |
| ], | |
| ), | |
| ), | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment