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

40 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
3 years ago
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,
),
),
),
);
}
}