|
|
|
|
@ -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)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|