pending asset requests new parameter added.

main_design2.1
Sikander Saleem 1 year ago
parent 865a2197ad
commit da442df2bb

@ -4,8 +4,8 @@ class URLs {
// static const host1 = "https://atomsm.hmg.com"; // production url
static const host1 = "https://atomsmdev.hmg.com"; // local UAT url
static String _baseUrl = "$_host/mobile";
// static String _baseUrl = "$_host/v2/mobile"; // new V2 apis
// static String _baseUrl = "$_host/mobile";
static String _baseUrl = "$_host/v2/mobile"; // new V2 apis
static String _host = host1;

@ -27,18 +27,27 @@ class PendingAssetServiceRequest {
class Details {
int id;
String message;
String callComments;
String voiceNote;
String createdBy;
Details({this.id, this.message});
Details.fromJson(Map<String, dynamic> json) {
id = json['id'];
message = json['message'];
callComments = json['callComments'];
voiceNote = json['voiceNote'];
createdBy = json['createdBy'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['message'] = this.message;
data['callComments'] = this.callComments;
data['voiceNote'] = this.voiceNote;
data['createdBy'] = this.createdBy;
return data;
}
}

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:test_sa/controllers/api_routes/urls.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
@ -6,6 +7,7 @@ import 'package:test_sa/models/service_request/pending_service_request_model.dar
import 'package:test_sa/models/service_request/service_request.dart';
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
import 'package:test_sa/views/pages/user/requests/service_request_details.dart';
import 'package:test_sa/views/widgets/sound/sound_player.dart';
class PendingServiceRequestScreen extends StatelessWidget {
final PendingAssetServiceRequest pendingAssetServiceRequest;
@ -21,17 +23,41 @@ class PendingServiceRequestScreen extends StatelessWidget {
padding: EdgeInsets.all(16),
separatorBuilder: (cxt, index) => 12.height,
itemBuilder: (cxt, index) => Container(
padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
padding: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
decoration: BoxDecoration(
color: Colors.grey[200],
borderRadius: BorderRadius.circular(16),
),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
pendingAssetServiceRequest.details[index].message.cleanupWhitespace?.capitalizeFirstOfEach ?? "",
style: Theme.of(context).textTheme.bodyLarge,
),
if ((pendingAssetServiceRequest.details[index].callComments ?? "").isNotEmpty) ...[
4.height,
Text(
"${pendingAssetServiceRequest.details[index].callComments}",
style: Theme.of(context).textTheme.bodyMedium.copyWith(color: Color(0xff7D859A)),
),
],
if ((pendingAssetServiceRequest.details[index].voiceNote ?? "").isNotEmpty) ...[
4.height,
ASoundPlayer(
audio: URLs.getFileUrl(pendingAssetServiceRequest.details[index].voiceNote),
),
],
4.height,
Text(
"Created By: ${pendingAssetServiceRequest.details[index].createdBy}",
style: Theme.of(context).textTheme.bodyMedium,
),
],
).expanded,
8.width,
Icon(Icons.arrow_forward_ios, size: 16)
],
),

Loading…
Cancel
Save