before
This commit is contained in:
@@ -2,13 +2,17 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class GeneralDrawerItem extends StatelessWidget {
|
||||
final String label;
|
||||
final IconData icon;
|
||||
final IconData? leading;
|
||||
final bool trailing;
|
||||
final Color? color;
|
||||
final VoidCallback onTap;
|
||||
|
||||
const GeneralDrawerItem({
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.icon,
|
||||
this.leading,
|
||||
this.trailing = false,
|
||||
this.color,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
@@ -16,13 +20,21 @@ class GeneralDrawerItem extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
onTap: onTap,
|
||||
leading: Icon(
|
||||
icon,
|
||||
color: Colors.black,
|
||||
),
|
||||
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: const TextStyle(fontSize: 15),
|
||||
style: TextStyle(fontSize: 15, color: color),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user