Created
April 27, 2019 18:07
-
-
Save felangel/17759f1b81f0ab74afe6f30ad798d2d7 to your computer and use it in GitHub Desktop.
[flutter_firebase_login] Home Screen
This file contains 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'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:flutter_firebase_login/authentication_bloc/bloc.dart'; | |
class HomeScreen extends StatelessWidget { | |
final String name; | |
HomeScreen({Key key, @required this.name}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Home'), | |
actions: <Widget>[ | |
IconButton( | |
icon: Icon(Icons.exit_to_app), | |
onPressed: () { | |
BlocProvider.of<AuthenticationBloc>(context).dispatch( | |
LoggedOut(), | |
); | |
}, | |
) | |
], | |
), | |
body: Column( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: <Widget>[ | |
Center(child: Text('Welcome $name!')), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment