-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome_view.dart
More file actions
30 lines (27 loc) · 888 Bytes
/
home_view.dart
File metadata and controls
30 lines (27 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import 'package:app/main/init.dart';
import 'package:domain/bloc/auth/auth_cubit.dart';
import 'package:flutter/material.dart';
import 'package:app/presentation/ui/custom/app_theme_switch.dart';
class HomeView extends StatelessWidget {
/// Given this is a global cubit, we can access it directly from getIt
/// otherwise use context.read<AuthCubit>() to read the Cubit under that context
AuthCubit get _authCubit => getIt();
const HomeView({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Home'),
automaticallyImplyLeading: false,
actions: [
IconButton(
onPressed: () => _authCubit.logOut(),
icon: const Icon(Icons.logout),
),
const AppThemeSwitch(),
],
),
body: const Text('Home Page'),
);
}
}