92 lines
3.1 KiB
Dart
92 lines
3.1 KiB
Dart
import 'package:fcs/domain/entities/pickup.dart';
|
|
import 'package:fcs/helpers/theme.dart';
|
|
import 'package:fcs/pages/pickup/pickup_info.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';
|
|
|
|
typedef CallbackPickupSelect(Pickup pickup);
|
|
|
|
class PickupListRow extends StatelessWidget {
|
|
final Pickup? pickup;
|
|
final CallbackPickupSelect? callbackPickupSelect;
|
|
final double dotSize = 15.0;
|
|
final DateFormat dateFormat = new DateFormat("dd MMM yyyy");
|
|
|
|
PickupListRow({Key? key, this.pickup, this.callbackPickupSelect})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: () {
|
|
if (callbackPickupSelect != null) {
|
|
callbackPickupSelect!(pickup!);
|
|
return;
|
|
}
|
|
Navigator.push(
|
|
context,
|
|
CupertinoPageRoute(builder: (context) => PickupInfo(pickup: pickup!)),
|
|
);
|
|
},
|
|
child: Container(
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
|
child: Row(
|
|
children: <Widget>[
|
|
Expanded(
|
|
child: new Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 13),
|
|
child: new Row(
|
|
children: <Widget>[
|
|
Icon(
|
|
SimpleLineIcons.direction,
|
|
color: primaryColor,
|
|
size: 30,
|
|
),
|
|
new Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(left: 15.0),
|
|
child: new Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
new Text(
|
|
pickup?.pickupNumber ?? '',
|
|
style: new TextStyle(
|
|
fontSize: 15.0, color: Colors.black),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 5),
|
|
child: new Text(
|
|
pickup!.pickupDate != null
|
|
? dateFormat.format(pickup!.pickupDate!)
|
|
: "",
|
|
style: new TextStyle(
|
|
fontSize: 15.0, color: Colors.grey),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
Text(pickup?.status ?? "",
|
|
style: TextStyle(
|
|
color: primaryColor,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.bold)),
|
|
// Column(
|
|
// children: <Widget>[
|
|
// getStatus(pickup!.status ?? ""),
|
|
// ],
|
|
// )
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|