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; stateCode = response.statusCode;
if (response.statusCode >= 200 && response.statusCode < 300) { if (response.statusCode >= 200 && response.statusCode < 300) {
recurrentWoData = RecurrentWoData.fromJson(json.decode(response.body)["data"]); 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(); notifyListeners();
} }
isLoading = false; isLoading = false;

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

@ -294,7 +294,7 @@ class PlanRecurrentMedicalTaskRoomTabAttributes {
PlanRecurrentMedicalTaskRoomTabAttributes.fromJson(Map<String, dynamic> json) { PlanRecurrentMedicalTaskRoomTabAttributes.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
attribute = json['attribute'] != null ? Attribute.fromJson(json['attribute']) : null; 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() { Map<String, dynamic> toJson() {

@ -203,6 +203,9 @@ class _GasRefillFormState extends State<GasRefillForm> {
// setState(() {}); // 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( return Scaffold(
appBar: DefaultAppBar(title: context.translation.gasRefill), appBar: DefaultAppBar(title: context.translation.gasRefill),
key: _scaffoldKey, key: _scaffoldKey,
@ -263,7 +266,7 @@ class _GasRefillFormState extends State<GasRefillForm> {
// : context.translation.onlyNumbers, // : context.translation.onlyNumbers,
// ), // ),
// 8.height, // 8.height,
_timerWidget(context, _formModel.workingHours ?? 0), _timerWidget(context, totalWorkingHours),
8.height, 8.height,
// SingleItemDropDownMenu<Lookup, GasStatusProvider>( // SingleItemDropDownMenu<Lookup, GasStatusProvider>(
// context: context, // context: context,

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

@ -64,8 +64,8 @@ class RecurrentTaskInfoWidget extends StatelessWidget {
// ], // ],
).toShadowContainer(context, padding: 12) ).toShadowContainer(context, padding: 12)
: Column( : 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 String? title; // Now nullable
final bool enable; final bool enable;
final bool showAsBottomSheet; 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); : super(key: key);
@override @override
@ -74,7 +75,7 @@ class _SingleAssistantEmployeeMenuState extends State<AssistantEmployeeMenu> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: widget.backgroundColor ?? (context.isDark ? AppColor.neutral50 : AppColor.neutral120), color: widget.backgroundColor ?? (context.isDark ? AppColor.neutral50 : AppColor.neutral120),
borderRadius: BorderRadius.circular(10), 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( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,

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

Loading…
Cancel
Save