Skip to content

Instantly share code, notes, and snippets.

@jadehopepunk
Created April 21, 2019 03:04
Show Gist options
  • Save jadehopepunk/fb64378ddf1de4e62aee7c72cdcbc9c1 to your computer and use it in GitHub Desktop.
Save jadehopepunk/fb64378ddf1de4e62aee7c72cdcbc9c1 to your computer and use it in GitHub Desktop.
Function as child containing state
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
var auth = new Auth();
return MaterialApp(
title: 'Pod',
debugShowCheckedModeBanner: false,
theme: ThemeData(primarySwatch: Colors.amber),
home: WithAuth(auth: auth, builder: (user) => DummyRootPage()));
}
}
class DummyRootPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
drawer: Drawer(
child: Text("drawer"),
),
body: Text('body'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment