passo_mobile_app/unit2/lib/screens/unit2/homepage.dart/components/menu.dart

30 lines
737 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
import 'package:go_router/go_router.dart';
import 'package:unit2/utils/alerts.dart';
import '../../../../theme-data.dart/colors.dart';
Widget getTile(
IconData icondata, String title, String route, BuildContext context) {
return ListTile(
dense: true,
leading: Icon(
icondata,
color: primary,
),
title: Text(
title,
style: const TextStyle(color: Colors.black),
),
onTap: () async {
if (title.toLowerCase() == "logout") {
confirmAlert(context, () {
context.goNamed("login");
});
} else {
context.goNamed(route);
}
},
);
}