import 'package:farm_tpf/authentication/bloc/authentication_bloc.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; class HomePage extends StatelessWidget { static Route route() { return MaterialPageRoute(builder: (_) => HomePage()); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text('Home')), body: Center( child: Column( mainAxisSize: MainAxisSize.min, children: [ Text( 'UserID: ${context.bloc().state.user.id}', ), RaisedButton( child: const Text('Đăng xuất'), onPressed: () { context .bloc() .add(AuthenticationLogoutRequested()); }, ), ], ), ), ); } }