99 lines
3.4 KiB
Dart
99 lines
3.4 KiB
Dart
import 'package:fcs/domain/entities/package.dart';
|
|
import 'package:fcs/helpers/theme.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'processing_info.dart';
|
|
|
|
typedef CallbackPackageSelect = Function(Package package);
|
|
|
|
class ProcessingListRow extends StatelessWidget {
|
|
final Package package;
|
|
final CallbackPackageSelect? callbackPackageSelect;
|
|
final double dotSize = 15.0;
|
|
final DateFormat dateFormat = DateFormat("dd MMM yyyy");
|
|
|
|
ProcessingListRow(
|
|
{super.key, required this.package, this.callbackPackageSelect});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: () {
|
|
if (callbackPackageSelect != null) {
|
|
callbackPackageSelect!(package);
|
|
return;
|
|
}
|
|
Navigator.push(
|
|
context,
|
|
CupertinoPageRoute(
|
|
builder: (context) => ProcessingInfo(package: package)),
|
|
);
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
|
child: Row(
|
|
children: <Widget>[
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 13.0),
|
|
child: Row(
|
|
children: <Widget>[
|
|
Icon(FontAwesome.dropbox, color: primaryColor, size: 30),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 15),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Text(
|
|
package.trackingID == null
|
|
? ''
|
|
: package.trackingID!,
|
|
style: TextStyle(
|
|
fontSize: 15.0, color: Colors.black),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 5.0),
|
|
child: Text(
|
|
package.market == null ? '' : package.market!,
|
|
style: TextStyle(
|
|
fontSize: 15.0, color: Colors.grey),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: <Widget>[
|
|
Text(package.status ?? "",
|
|
style: TextStyle(
|
|
color: primaryColor,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.bold)),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 5),
|
|
child: Text(
|
|
package.currentStatusDate != null
|
|
? dateFormat.format(package.currentStatusDate!)
|
|
: '',
|
|
style: TextStyle(fontSize: 14.0, color: Colors.grey),
|
|
),
|
|
),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|