Skip to content

Instantly share code, notes, and snippets.

@anilcancakir
Created March 5, 2018 21:50
Show Gist options
  • Select an option

  • Save anilcancakir/ddfaf99944f4d7228ab943a823858523 to your computer and use it in GitHub Desktop.

Select an option

Save anilcancakir/ddfaf99944f4d7228ab943a823858523 to your computer and use it in GitHub Desktop.
How to use dynamic home page in Flutter? - HomePage
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