trying to move to an actual drawer

This commit is contained in:
Juan Marulanda De Los Rios 2024-10-20 00:29:57 -04:00
parent 19cde9177b
commit 85decfa0f8

View File

@ -1,3 +1,6 @@
// this file should handle most of the API calls
// it also builds some widgets, but it will be modulated later
import 'package:crab_ui/structs.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
@ -27,6 +30,7 @@ class MailAddress {
}
class EmailPage extends StatefulWidget {
// email widget
const EmailPage({super.key});
final String title = 'Emails';
@ -113,6 +117,11 @@ class EmailPageState extends State<EmailPage> {
return content;
}
// void _addMailBox async(BuildContext context){
// //add email folder
// showDialog(context: context, builder: builder)
// }
Future<List<Widget>> getDrawerItems(BuildContext context) async {
List<String> drawerItems = [];
@ -124,7 +133,7 @@ class EmailPageState extends State<EmailPage> {
print('getDrawerItems caught error: $e');
}
List<Widget> drawerWidgets = [];
List<Widget> drawerWidgets = []; // email folders
for (String item in drawerItems) {
drawerWidgets.add(
@ -138,6 +147,14 @@ class EmailPageState extends State<EmailPage> {
),
);
}
drawerWidgets.add(ListTile(
leading: Icon(Icons.add),
onTap: () {
// _addMailBox(context);
print('adding folder');
Navigator.pop(context);
},
));
return drawerWidgets;
}