Files
prosappco/lib/components/general_drawer_item.dart

48 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
class GeneralDrawerItem extends StatelessWidget {
final String label;
final String? subtitle;
final IconData? leading;
final bool trailing;
final Color? color;
final VoidCallback? onTap;
const GeneralDrawerItem({
super.key,
required this.label,
this.subtitle,
this.leading,
this.trailing = false,
this.color,
this.onTap,
});
@override
Widget build(BuildContext context) {
return ListTile(
onTap: onTap == null ? null : () => onTap!(),
leading: leading == null
? null
: Icon(
leading,
color: Colors.black,
),
trailing: trailing
? const Icon(
Icons.keyboard_arrow_right,
color: Colors.black,
)
: null,
title: Text(
label,
style: TextStyle(fontSize: 15, color: color),
),
subtitle: subtitle == null
? null
: Text(subtitle ?? "", style: const TextStyle(color: Colors.black54)),
// dense: true,
);
}
}