You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
979B

  1. import 'package:farm_tpf/authentication/bloc/authentication_bloc.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter_bloc/flutter_bloc.dart';
  4. class HomePage extends StatelessWidget {
  5. static Route route() {
  6. return MaterialPageRoute<void>(builder: (_) => HomePage());
  7. }
  8. @override
  9. Widget build(BuildContext context) {
  10. return Scaffold(
  11. appBar: AppBar(title: const Text('Home')),
  12. body: Center(
  13. child: Column(
  14. mainAxisSize: MainAxisSize.min,
  15. children: <Widget>[
  16. Text("logged in."
  17. // 'UserID: ${context.bloc<AuthenticationBloc>().state.user.id}',
  18. ),
  19. RaisedButton(
  20. child: const Text('Đăng xuất'),
  21. onPressed: () {
  22. context
  23. .bloc<AuthenticationBloc>()
  24. .add(AuthenticationLogoutRequested());
  25. },
  26. ),
  27. ],
  28. ),
  29. ),
  30. );
  31. }
  32. }