Skip to content

Instantly share code, notes, and snippets.

@felangel
Created April 27, 2019 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felangel/17759f1b81f0ab74afe6f30ad798d2d7 to your computer and use it in GitHub Desktop.
Save felangel/17759f1b81f0ab74afe6f30ad798d2d7 to your computer and use it in GitHub Desktop.
[flutter_firebase_login] Home Screen
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