import 'package:test_sa/views/app_style/sizing.dart'; import 'package:flutter/material.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), ), ], ), ), ); } }