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/departments/department_item.dart

42 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import '../../../models/department.dart';
import '../../app_style/colors.dart';
import '../../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,
),
),
),
);
}
}