128 lines
3.5 KiB
Dart
128 lines
3.5 KiB
Dart
import 'package:auto_size_text/auto_size_text.dart';
|
|
import 'package:baligh_dashboard/screens/report_details_screen.dart';
|
|
import 'package:cloud_firestore/cloud_firestore.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class DashboardTile extends StatelessWidget {
|
|
const DashboardTile({
|
|
super.key,
|
|
required this.id,
|
|
required this.name,
|
|
required this.address,
|
|
required this.school,
|
|
required this.type,
|
|
required this.status,
|
|
required this.age,
|
|
required this.attachments,
|
|
required this.createdAt,
|
|
required this.description,
|
|
required this.nationalIdNumber,
|
|
required this.phone,
|
|
});
|
|
|
|
final String id;
|
|
final String name;
|
|
final String address;
|
|
final String school;
|
|
final String type;
|
|
final String status;
|
|
final Timestamp createdAt;
|
|
final int age;
|
|
final String phone;
|
|
final int nationalIdNumber;
|
|
final String description;
|
|
final List attachments;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
|
hoverColor: Colors.transparent,
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => ReportDetailsScreen(
|
|
id: id,
|
|
name: name,
|
|
age: age,
|
|
phone: phone,
|
|
address: address,
|
|
school: school,
|
|
nationalIdNumber: nationalIdNumber,
|
|
description: description,
|
|
attachments: attachments,
|
|
type: type,
|
|
createdAt: createdAt,
|
|
status: status,
|
|
)));
|
|
},
|
|
child: Container(
|
|
width: double.infinity,
|
|
clipBehavior: Clip.hardEdge,
|
|
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
|
decoration: BoxDecoration(
|
|
color: Theme.of(context).cardColor,
|
|
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: AutoSizeText(
|
|
name,
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
maxLines: 3,
|
|
minFontSize: 8,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 5,
|
|
),
|
|
Expanded(
|
|
child: AutoSizeText(
|
|
address,
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
maxLines: 3,
|
|
minFontSize: 8,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 5,
|
|
),
|
|
Expanded(
|
|
child: AutoSizeText(
|
|
school,
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
maxLines: 3,
|
|
minFontSize: 8,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 5,
|
|
),
|
|
Expanded(
|
|
child: AutoSizeText(
|
|
type,
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
maxLines: 3,
|
|
minFontSize: 8,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 5,
|
|
),
|
|
Expanded(
|
|
child: AutoSizeText(
|
|
status,
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
maxLines: 3,
|
|
minFontSize: 8,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|