mobile-app/lib/pages/Home/Home.dart

30 lines
736 B
Dart

import 'package:daily_ledger/helper/AuthProvider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
final authProvider = Provider.of<AuthProvider>(context);
return Scaffold(
appBar: AppBar(
title: const Text('Home'),
actions: [
IconButton(
icon: const Icon(Icons.logout),
onPressed: () async {
await authProvider.logout(); // Log the user out
},
),
],
),
body: const Center(
child: Text('Welcome to the Home Screen!'),
),
);
}
}