import 'package:flutter/material.dart'; import 'package:test_sa/models/department.dart'; import 'package:test_sa/views/app_style/colors.dart'; import 'package:test_sa/views/app_style/sizing.dart'; class DepartmentItem extends StatelessWidget { final Department department; final Function(Department) onPressed; const DepartmentItem({Key key, this.department, this.onPressed}) : super(key: key); @override Widget build(BuildContext context) { return Padding( padding: EdgeInsets.symmetric(horizontal: 16,vertical: 6), child: ElevatedButton( style: ElevatedButton.styleFrom( backgroundColor: AColors.primaryColor, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( AppStyle.getBorderRadius(context) ), ), ), onPressed: (){ onPressed(department); }, child: ListTile( title: Text( department.name ?? "", style: Theme.of(context).textTheme.subtitle1.copyWith( color: AColors.white ), textDirection: TextDirection.rtl, ), ), ), ); } }