check null safety

This commit is contained in:
tzw
2021-09-10 14:27:38 +06:30
parent a144c945b6
commit 7670779b03
57 changed files with 620 additions and 626 deletions

View File

@@ -3,17 +3,21 @@ import 'package:cloud_firestore/cloud_firestore.dart';
class ShipmentStatus {
String status;
DateTime date;
bool done;
String staffId;
String staffName;
bool? done;
String? staffId;
String? staffName;
ShipmentStatus(
{this.status, this.date, this.done, this.staffId, this.staffName});
{required this.status,
required this.date,
this.done,
this.staffId,
this.staffName});
factory ShipmentStatus.fromMap(Map<String, dynamic> map) {
var _date = (map['date'] as Timestamp);
return ShipmentStatus(
status: map['status'],
date: _date == null ? null : _date.toDate(),
date: _date.toDate(),
done: map['done'],
staffId: map['staff_id'],
staffName: map['staff_name']);