Commit ec8a1705 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

image issue solved

parent b5da9426
class allServiceListResponse {
String? error;
TechDetails? techDetails;
List<TechDetails>? techDetails;
List<AllServiceList>? allServiceList;
String? message;
......@@ -9,9 +9,12 @@ class allServiceListResponse {
allServiceListResponse.fromJson(Map<String, dynamic> json) {
error = json['error'];
techDetails = json['tech_details'] != null
? new TechDetails.fromJson(json['tech_details'])
: null;
if (json['tech_details'] != null) {
techDetails = <TechDetails>[];
json['tech_details'].forEach((v) {
techDetails!.add(new TechDetails.fromJson(v));
});
}
if (json['all_service_list'] != null) {
allServiceList = <AllServiceList>[];
json['all_service_list'].forEach((v) {
......@@ -25,7 +28,7 @@ class allServiceListResponse {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
if (this.techDetails != null) {
data['tech_details'] = this.techDetails!.toJson();
data['tech_details'] = this.techDetails!.map((v) => v.toJson()).toList();
}
if (this.allServiceList != null) {
data['all_service_list'] =
......@@ -90,7 +93,7 @@ class AllServiceList {
String? inOrOutTime;
String? runningHrs;
String? fsrExt;
String? fsrFilePath;
String? filePath;
String? fsrNo;
AllServiceList(
......@@ -106,7 +109,7 @@ class AllServiceList {
this.inOrOutTime,
this.runningHrs,
this.fsrExt,
this.fsrFilePath,
this.filePath,
this.fsrNo});
AllServiceList.fromJson(Map<String, dynamic> json) {
......@@ -122,7 +125,7 @@ class AllServiceList {
inOrOutTime = json['in_or_out_time'];
runningHrs = json['running_hrs'];
fsrExt = json['fsr_ext'];
fsrFilePath = json['fsr_file_path'];
filePath = json['file_path'];
fsrNo = json['fsr_no'];
}
......@@ -140,7 +143,7 @@ class AllServiceList {
data['in_or_out_time'] = this.inOrOutTime;
data['running_hrs'] = this.runningHrs;
data['fsr_ext'] = this.fsrExt;
data['fsr_file_path'] = this.fsrFilePath;
data['file_path'] = this.filePath;
data['fsr_no'] = this.fsrNo;
return data;
}
......
......@@ -211,7 +211,7 @@ class ServiceDetails {
data['in_or_out_time'] = this.inOrOutTime;
data['running_hrs'] = this.runningHrs;
data['fsr_ext'] = this.fsrExt;
data['fsr_file_path'] = this.fsrFilePath;
data['file_path'] = this.fsrFilePath;
data['fsr_no'] = this.fsrNo;
return data;
}
......
......@@ -770,30 +770,18 @@ class _ComplaintDetailsScreenState extends State<ComplaintDetailsScreen> {
Expanded(
child: InkResponse(
onTap:
serviceHeadings[i] ==
"FSR File" &&
(serviceData
?.fsrFilePath !=
null)
serviceHeadings[i] == "FSR File" && (serviceData?.fsrFilePath != null)
? () async {
await Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
serviceData
?.fsrExt ??
"-",
fileUrl:
serviceData
?.fsrFilePath ??
"-",
builder: (context,) => Fileviewer(
fileName: serviceData?.fsrExt ?? "-",
fileUrl: serviceData?.fsrFilePath ?? "-",
),
),
);
}
: null,
child: Text(
......
......@@ -235,17 +235,9 @@ class _serviceListScreenState extends State<serviceListScreen> {
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
data[j]
?.fsrExt ??
"-",
fileUrl:
data[j]
?.fsrFilePath ??
"-",
(context,) => Fileviewer(
fileName: data[j]?.fsrExt ?? "-",
fileUrl: data[j]?.filePath ?? "-",
),
),
);
......
// utils/custom_snackbar.dart
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
import 'AppColors.dart';
class CustomSnackBar {
static void show({
......@@ -345,4 +348,45 @@ class CustomSnackBar {
enableHaptic: enableHaptic,
);
}
}
PreferredSizeWidget appbarNew(BuildContext context, title, int color) {
return AppBar(
backgroundColor: Color(color),
automaticallyImplyLeading: false,
title: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkResponse(
onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset(
"assets/svg/appbar_back_button.svg",
height: 25,
),
),
SizedBox(width: 10),
InkResponse(
onTap: () => Navigator.pop(context, true),
child: Text(
title,
style: TextStyle(
fontSize: 16,
height: 1.1,
fontFamily: "JakartaSemiBold",
color: AppColors.subtitleText,
),
),
),
],
),
),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.vertical(
// bottom: Radius.circular(30), // Adjust the radius as needed
// ),
// ),
);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment