89 lines
3.3 KiB
Dart
89 lines
3.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:ftc_mobile_app/ftc_mobile_app.dart';
|
|
import 'package:ftc_mobile_app/models/clients/recent_incidents_model.dart';
|
|
import 'package:ftc_mobile_app/utilities/extensions/custom_extensions.dart';
|
|
import 'package:ftc_mobile_app/view/custom_widgets/common_cancel_button.dart';
|
|
import 'package:quill_html_editor/quill_html_editor.dart';
|
|
|
|
class RecentIncidentDetailDialog extends StatelessWidget {
|
|
final RecentIncidentsModel data;
|
|
|
|
const RecentIncidentDetailDialog({super.key, required this.data});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AlertDialog(
|
|
insetPadding: REdgeInsets.all(18),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2.r)),
|
|
backgroundColor: Colors.white,
|
|
surfaceTintColor: Colors.white,
|
|
contentPadding: EdgeInsets.zero,
|
|
content: SizedBox(
|
|
width: double.maxFinite,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
20.verticalSpace,
|
|
Text("Incident Date - Time",
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 14.sp,
|
|
color: Colors.black,
|
|
)).addPaddingHorizontal(16),
|
|
Text(
|
|
DateFormatter.ddMMyyyyhhmmFormat(
|
|
DateTime.parse(data.createdAt).toLocal()),
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.w400,
|
|
fontSize: 12.sp,
|
|
color: CustomAppColors.kBlackColor,
|
|
)).addPaddingHorizontal(16),
|
|
8.verticalSpace,
|
|
Divider(
|
|
color: CustomAppColors.kLightGreyColor,
|
|
),
|
|
8.verticalSpace,
|
|
CustomTextWidget(
|
|
text: data.incidentTitle.isNotEmpty
|
|
? data.incidentTitle
|
|
: "Untitled Incident",
|
|
isExpanded: false,
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 14.sp,
|
|
textAlign: TextAlign.left,
|
|
).addPaddingHorizontal(16),
|
|
4.verticalSpace,
|
|
Expanded(
|
|
child: QuillHtmlEditor(
|
|
text: data.note,
|
|
hintText: 'Hint text goes here',
|
|
controller: data.quillController,
|
|
isEnabled: false,
|
|
ensureVisible: false,
|
|
minHeight: 50.h,
|
|
autoFocus: false,
|
|
textStyle: TextStyle(
|
|
fontSize: 14.sp,
|
|
fontWeight: FontWeight.w400,
|
|
),
|
|
// hintTextStyle: _hintTextStyle,
|
|
hintTextAlign: TextAlign.start,
|
|
loadingBuilder: (context) {
|
|
return const Center(
|
|
child: CircularProgressIndicator(
|
|
strokeWidth: 1,
|
|
color: Colors.red,
|
|
));
|
|
},
|
|
).addPaddingHorizontal(16),
|
|
),
|
|
const CommonCloseTextButton().addPaddingAll(16),
|
|
8.verticalSpace,
|
|
],
|
|
),
|
|
));
|
|
}
|
|
}
|