mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 05:18:55 +03:30
Fix transmitter name in package history
This commit is contained in:
@@ -58,12 +58,14 @@ class PackageHistoryObject extends Equatable {
|
|||||||
final String userHistoryName;
|
final String userHistoryName;
|
||||||
final String userHistoryId;
|
final String userHistoryId;
|
||||||
final String userHistoryPhon;
|
final String userHistoryPhon;
|
||||||
|
final String? userTransferName;
|
||||||
PackageHistoryObject({
|
PackageHistoryObject({
|
||||||
required this.fromDate,
|
required this.fromDate,
|
||||||
required this.toDate,
|
required this.toDate,
|
||||||
required this.userHistoryName,
|
required this.userHistoryName,
|
||||||
required this.userHistoryId,
|
required this.userHistoryId,
|
||||||
required this.userHistoryPhon,
|
required this.userHistoryPhon,
|
||||||
|
required this.userTransferName
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -39,10 +39,7 @@ class _MyPackagesHistoryScreenState extends State<MyPackagesHistoryScreen> {
|
|||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
if (_isInit) {
|
if (_isInit) {
|
||||||
packageData =
|
packageData =
|
||||||
ModalRoute
|
ModalRoute.of(context)!.settings.arguments as MyPackageResultObject?;
|
||||||
.of(context)!
|
|
||||||
.settings
|
|
||||||
.arguments as MyPackageResultObject?;
|
|
||||||
var _id = packageData!.id;
|
var _id = packageData!.id;
|
||||||
var myPackageResults = Provider.of<MyPackageProvider>(context);
|
var myPackageResults = Provider.of<MyPackageProvider>(context);
|
||||||
myPackageResults.setLoading();
|
myPackageResults.setLoading();
|
||||||
@@ -72,14 +69,17 @@ class _MyPackagesHistoryScreenState extends State<MyPackagesHistoryScreen> {
|
|||||||
final _media = MediaQuery.of(context);
|
final _media = MediaQuery.of(context);
|
||||||
final double _deviceWidth = _media.size.width;
|
final double _deviceWidth = _media.size.width;
|
||||||
final double _deviceBlockSize = _deviceWidth / 100;
|
final double _deviceBlockSize = _deviceWidth / 100;
|
||||||
final userData = Provider
|
final userData = Provider.of<Auth>(context, listen: false).user;
|
||||||
.of<Auth>(context, listen: false)
|
|
||||||
.user;
|
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
titleSpacing: -10,
|
titleSpacing: -10,
|
||||||
title: Text('My Packages', style: TextStyle(color: Colors.white,),),
|
title: Text(
|
||||||
|
'My Packages',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
@@ -152,9 +152,6 @@ class _MyPackagesHistoryScreenState extends State<MyPackagesHistoryScreen> {
|
|||||||
deviceBlockSize: _deviceBlockSize,
|
deviceBlockSize: _deviceBlockSize,
|
||||||
user: packageResults
|
user: packageResults
|
||||||
.packageHistory![index],
|
.packageHistory![index],
|
||||||
transmitterName: !(index ==
|
|
||||||
(packageResults.packageHistory!.length -
|
|
||||||
1)) ? packageResults.packageHistory![index + 1].userHistoryName : null,
|
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.0,
|
height: 20.0,
|
||||||
|
|||||||
@@ -11,12 +11,15 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
String searchBoxValue = '';
|
String searchBoxValue = '';
|
||||||
bool filterOn = false;
|
bool filterOn = false;
|
||||||
List<MyPackageResultObject>? myPackages;
|
List<MyPackageResultObject>? myPackages;
|
||||||
|
|
||||||
// List<MyPackageResultObject>? hospitalPackages;
|
// List<MyPackageResultObject>? hospitalPackages;
|
||||||
|
|
||||||
List<MyPackageResultObject>? originalMyPackages;
|
List<MyPackageResultObject>? originalMyPackages;
|
||||||
|
|
||||||
// List<MyPackageResultObject>? originalHospitalPackages;
|
// List<MyPackageResultObject>? originalHospitalPackages;
|
||||||
|
|
||||||
List<MyPackageResultObject>? originalMyPackagesRequests;
|
List<MyPackageResultObject>? originalMyPackagesRequests;
|
||||||
|
|
||||||
// List<MyPackageResultObject>? originalHospitalPackagesRequests;
|
// List<MyPackageResultObject>? originalHospitalPackagesRequests;
|
||||||
|
|
||||||
List<PackageHistoryObject>? packageHistory;
|
List<PackageHistoryObject>? packageHistory;
|
||||||
@@ -27,8 +30,10 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
// udi: '',
|
// udi: '',
|
||||||
);
|
);
|
||||||
int pageNumber = 1;
|
int pageNumber = 1;
|
||||||
|
|
||||||
void resetPageNumber() => pageNumber = 1;
|
void resetPageNumber() => pageNumber = 1;
|
||||||
bool isloading = false;
|
bool isloading = false;
|
||||||
|
|
||||||
void resetLoading() {
|
void resetLoading() {
|
||||||
isloading = false;
|
isloading = false;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
@@ -227,6 +232,9 @@ class MyPackageProvider extends ChangeNotifier {
|
|||||||
userHistoryName: transfer['user']['name'].toString(),
|
userHistoryName: transfer['user']['name'].toString(),
|
||||||
userHistoryId: transfer['user']['id'].toString(),
|
userHistoryId: transfer['user']['id'].toString(),
|
||||||
userHistoryPhon: transfer['user']['cell_number'].toString(),
|
userHistoryPhon: transfer['user']['cell_number'].toString(),
|
||||||
|
userTransferName: transfer['userTransfer'] != null
|
||||||
|
? transfer['userTransfer']['name'].toString()
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,11 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
class UserPackageDataBox extends StatelessWidget {
|
class UserPackageDataBox extends StatelessWidget {
|
||||||
final PackageHistoryObject? user;
|
final PackageHistoryObject? user;
|
||||||
final String? transmitterName;
|
|
||||||
|
|
||||||
const UserPackageDataBox({
|
const UserPackageDataBox({
|
||||||
Key? key,
|
Key? key,
|
||||||
required double deviceBlockSize,
|
required double deviceBlockSize,
|
||||||
this.user,
|
this.user,
|
||||||
this.transmitterName
|
|
||||||
}) : _deviceBlockSize = deviceBlockSize,
|
}) : _deviceBlockSize = deviceBlockSize,
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
@@ -42,7 +40,7 @@ class UserPackageDataBox extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
width: 30 * _deviceBlockSize,
|
width: 25 * _deviceBlockSize,
|
||||||
child: Text(
|
child: Text(
|
||||||
user!.userHistoryName,
|
user!.userHistoryName,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -52,7 +50,7 @@ class UserPackageDataBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
width: 30 * _deviceBlockSize,
|
width: 25 * _deviceBlockSize,
|
||||||
child: Text(
|
child: Text(
|
||||||
user!.userHistoryPhon,
|
user!.userHistoryPhon,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -64,25 +62,27 @@ class UserPackageDataBox extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
Row(
|
||||||
width: 3 * _deviceBlockSize,
|
children: [
|
||||||
),
|
|
||||||
Row(children: [
|
|
||||||
Text(
|
Text(
|
||||||
"Transmitter : ",
|
user!.userTransferName != null ? "Transmitter : " : "",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 3 * _deviceBlockSize,
|
fontSize: 3 * _deviceBlockSize,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Container(
|
||||||
transmitterName ?? "null",
|
width: 25 * _deviceBlockSize,
|
||||||
|
child: Text(
|
||||||
|
user!.userTransferName ?? "",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 3 * _deviceBlockSize,
|
fontSize: 3 * _deviceBlockSize,
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user