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

36 lines
1.1 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';
3 years ago
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),
3 years ago
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AColors.primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppStyle.getBorderRadius(context)),
3 years ago
),
),
onPressed: () {
3 years ago
onPressed(department);
},
child: ListTile(
title: Text(
department.name ?? "",
style: Theme.of(context).textTheme.subtitle1.copyWith(color: AColors.white),
3 years ago
textDirection: TextDirection.rtl,
),
),
),
);
}
}