|
- 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<void>(builder: (_) => HomePage());
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(title: const Text('Home')),
- body: Center(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: <Widget>[
- Text("logged in."
- // 'UserID: ${context.bloc<AuthenticationBloc>().state.user.id}',
- ),
- RaisedButton(
- child: const Text('Đăng xuất'),
- onPressed: () {
- context
- .bloc<AuthenticationBloc>()
- .add(AuthenticationLogoutRequested());
- },
- ),
- ],
- ),
- ),
- );
- }
- }
|