2023-08-07 06:33:38 +00:00
|
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
2023-08-01 08:20:38 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../../model/profile/attachment.dart';
|
|
|
|
import '../../../theme-data.dart/box_shadow.dart';
|
|
|
|
import '../../../theme-data.dart/colors.dart';
|
|
|
|
|
|
|
|
class SingleAttachment extends StatelessWidget {
|
|
|
|
final Function()? onpressed;
|
|
|
|
final Attachment attachment;
|
2023-08-27 08:38:05 +00:00
|
|
|
final Function()? view;
|
2023-08-01 08:20:38 +00:00
|
|
|
const SingleAttachment({
|
|
|
|
required this.attachment,
|
|
|
|
required this.onpressed,
|
2023-08-27 08:38:05 +00:00
|
|
|
required this.view,
|
2023-08-01 08:20:38 +00:00
|
|
|
super.key,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
padding:
|
|
|
|
const EdgeInsets.all(
|
|
|
|
5),
|
|
|
|
decoration: box1().copyWith(
|
|
|
|
color: Colors
|
|
|
|
.grey
|
|
|
|
.shade300,
|
|
|
|
boxShadow: []),
|
|
|
|
child:
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child:
|
2023-08-27 08:38:05 +00:00
|
|
|
GestureDetector(
|
|
|
|
onTap: view,
|
2023-09-05 08:44:48 +00:00
|
|
|
child: Text(
|
2023-08-27 08:38:05 +00:00
|
|
|
attachment.filename!,
|
2023-09-05 08:44:48 +00:00
|
|
|
|
2023-08-27 08:38:05 +00:00
|
|
|
maxLines: 1,
|
|
|
|
),
|
|
|
|
),
|
2023-08-01 08:20:38 +00:00
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
width:
|
|
|
|
8,
|
|
|
|
),
|
|
|
|
GestureDetector(
|
|
|
|
onTap:onpressed,
|
|
|
|
child: const Icon(Icons.delete,color: primary,))
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|