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/lib/views/widgets/drawer/drawer_item.dart

50 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class DrawerItem extends StatelessWidget {
final String title;
final IconData icon;
final VoidCallback onPressed;
const DrawerItem({Key key, this.title, this.icon, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context)
)
),
primary: Theme.of(context).colorScheme.onPrimary,
),
onPressed: onPressed,
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: SizedBox(
width: 48,
child: Icon(
icon, color: Theme.of(context).colorScheme.primary
),
),
),
Text(
title,
style: Theme.of(context).textTheme.headline6.copyWith(
fontSize: 16,
color: Theme.of(context).colorScheme.primary
),
textScaleFactor: AppStyle.getScaleFactor(context),
),
],
),
),
);
}
}