Le menu de la page principale après s'être authentifié est ok

This commit is contained in:
DahoudG
2024-08-27 18:53:20 +00:00
parent e233f9f392
commit c653098560
16 changed files with 478 additions and 48 deletions

View File

@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final List<Widget> actions;
const CustomAppBar({
Key? key,
required this.title,
this.actions = const [],
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: Colors.black,
title: Text(
title,
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
actions: actions,
);
}
@override
Size get preferredSize => const Size.fromHeight(56.0);
}

View File

@@ -4,14 +4,25 @@ class CustomButton extends StatelessWidget {
final String text;
final VoidCallback onPressed;
const CustomButton({super.key, required this.text, required this.onPressed});
const CustomButton({
Key? key,
required this.text,
required this.onPressed,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric(vertical: 16.0),
textStyle: const TextStyle(fontSize: 18),
backgroundColor: Colors.blueAccent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
),
),
child: Text(text),
);
}
}

View File

@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
class CustomDrawer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
decoration: BoxDecoration(
color: Colors.blueAccent,
),
child: Text(
'AfterWork',
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
),
ListTile(
leading: Icon(Icons.home),
title: Text('Accueil'),
onTap: () {
Navigator.pushNamed(context, '/home');
},
),
ListTile(
leading: Icon(Icons.event),
title: Text('Événements'),
onTap: () {
Navigator.pushNamed(context, '/event');
},
),
ListTile(
leading: Icon(Icons.camera_alt), // Icône mise à jour pour la story
title: Text('Story'),
onTap: () {
Navigator.pushNamed(context, '/story');
},
),
],
),
);
}
}