ponit 87 fixed.

design_3.0_task_module_new
Sikander Saleem 7 months ago
parent 5963a27213
commit 015b73b634

@ -201,6 +201,16 @@ class AllRequestsProvider extends ChangeNotifier {
stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) {
recurrentWoData = RecurrentWoData.fromJson(json.decode(response.body)["data"]);
recurrentWoData?.planRecurrentMedicalTaskRooms?.forEach((element){
element.planRecurrentMedicalTaskRoomTabs?.forEach((tabs){
tabs.planRecurrentMedicalTaskRoomTabAttributes?.forEach((attribute){
print(attribute.attribute?.name);
if(attribute.attribute?.type=="bool" && attribute.attributeValue ==null) {
attribute.attributeValue = "true";
}
});
});
});
notifyListeners();
}
isLoading = false;

@ -72,7 +72,7 @@ class GasRefillModel {
List<GasRefillDetails>? gasRefillDetails; // Now nullable
Uint8List? localNurseSignature; // Now nullable
Uint8List? localEngineerSignature; // Now nullable
TimerModel? timer;
TimerModel? timer = TimerModel();
//TODO need to check when api provided..
List<TimerModel>? timerModelList = [];

@ -294,7 +294,7 @@ class PlanRecurrentMedicalTaskRoomTabAttributes {
PlanRecurrentMedicalTaskRoomTabAttributes.fromJson(Map<String, dynamic> json) {
id = json['id'];
attribute = json['attribute'] != null ? Attribute.fromJson(json['attribute']) : null;
attributeValue = json['attributeValue'] ?? (json['attribute']['type'] == 'bool' ? (json['attributeValue']?.toString() == 'true') : json['attributeValue']);
attributeValue = json['attributeValue'];
}
Map<String, dynamic> toJson() {

@ -203,6 +203,9 @@ class _GasRefillFormState extends State<GasRefillForm> {
// setState(() {});
// });
}
double totalWorkingHours =
_formModel.gasRefillTimers?.fold(0.0, (sum, item) => (sum ?? 0) + DateTime.parse(item.endDate!).difference(DateTime.parse(item.startDate!)).inSeconds) ?? 0;
return Scaffold(
appBar: DefaultAppBar(title: context.translation.gasRefill),
key: _scaffoldKey,
@ -263,7 +266,7 @@ class _GasRefillFormState extends State<GasRefillForm> {
// : context.translation.onlyNumbers,
// ),
// 8.height,
_timerWidget(context, _formModel.workingHours ?? 0),
_timerWidget(context, totalWorkingHours),
8.height,
// SingleItemDropDownMenu<Lookup, GasStatusProvider>(
// context: context,

@ -52,19 +52,8 @@ class _RoomInspectionCardState extends State<RoomInspectionCard> {
).toShadowContainer(context).paddingOnly(top: 12);
}
Widget inspectionStatusRadioWidget({
required int index,
required PlanRecurrentMedicalTaskRoomTabAttributes model,
required BuildContext context,
}) {
bool status = (model.attribute == null || model.attributeValue == null)
? true
: model.attribute != null
? model.attributeValue == 'true'
? true
: false
: false;
Widget inspectionStatusRadioWidget({required int index, required PlanRecurrentMedicalTaskRoomTabAttributes model, required BuildContext context}) {
bool status = (model.attribute == null || model.attributeValue == null) ? true : (model.attribute != null ? (model.attributeValue == 'true' ? true : false) : false);
return Row(

@ -64,8 +64,8 @@ class RecurrentTaskInfoWidget extends StatelessWidget {
// ],
).toShadowContainer(context, padding: 12)
: Column(
children: [_timerWidget(context, model!.totalWorkingHours!).toShadowContainer(context, padding: 12), 8.height, _commentWidget(context: context, model: model)],
),
children: [_timerWidget(context, model!.totalWorkingHours!), 8.height, _commentWidget(context: context, model: model)],
).toShadowContainer(context, padding: 12),
],
);
}

@ -18,8 +18,9 @@ class AssistantEmployeeMenu extends StatefulWidget {
final String? title; // Now nullable
final bool enable;
final bool showAsBottomSheet;
final bool hideShadow;
AssistantEmployeeMenu({Key? key, required this.statuses, this.title, this.showAsBottomSheet = false, required this.onSelect, this.initialStatus, this.backgroundColor, this.enable = true})
AssistantEmployeeMenu({Key? key, required this.statuses, this.title, this.showAsBottomSheet = false,this.hideShadow = false, required this.onSelect, this.initialStatus, this.backgroundColor, this.enable = true})
: super(key: key);
@override
@ -74,7 +75,7 @@ class _SingleAssistantEmployeeMenuState extends State<AssistantEmployeeMenu> {
decoration: BoxDecoration(
color: widget.backgroundColor ?? (context.isDark ? AppColor.neutral50 : AppColor.neutral120),
borderRadius: BorderRadius.circular(10),
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
boxShadow: widget.hideShadow ? null : [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 10)],
),
child: Stack(
alignment: Alignment.center,

@ -31,6 +31,7 @@ class ServiceReportAssistantEmployeeMenu extends StatelessWidget {
initialStatus: initialValue,
title: title,
showAsBottomSheet: true,
hideShadow: true,
statuses: menuProvider.assistantEmployees ?? [],
backgroundColor: backgroundColor,
// Provide an empty list if null

Loading…
Cancel
Save