You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/old_lib/views/widgets/drawer/drawer_item.dart

42 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import '../../../extensions/int_extensions.dart';
import '../../../extensions/widget_extensions.dart';
import '../../app_style/colors.dart';
import '../../app_style/sizing.dart';
class DrawerItem extends StatelessWidget {
final String? title;
final IconData icon;
final VoidCallback? onPressed;
const DrawerItem({Key? key, this.title, required this.icon, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(0.0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
elevation: 0,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context))),
primary: Theme.of(context).colorScheme.onPrimary,
),
onPressed: onPressed,
child: Row(
children: [
Icon(icon, color: AColors.grey3A,size: 20),
12.width,
Text(
title??"",
style: Theme.of(context).textTheme.headline6?.copyWith(fontSize: 14, color: AColors.grey3A),
textScaleFactor: AppStyle.getScaleFactor(context),
),
],
).paddingOnly(left: 20,right: 20),
),
);
}
}