null safety

This commit is contained in:
phyothandar
2021-09-10 16:48:21 +06:30
parent 03c5fc5016
commit bb4f4ad7c2
40 changed files with 393 additions and 352 deletions

View File

@@ -42,8 +42,8 @@ class _ReceivingEditorState extends State<ReceivingEditor> {
_isNew = widget.package == null;
if (!_isNew) {
package = widget.package!;
_trackingIDCtl.text = package.trackingID;
_remarkCtl.text = package.remark;
_trackingIDCtl.text = package.trackingID!;
_remarkCtl.text = package.remark!;
_multiImgController.setImageUrls = package.photoUrls;
user = User(
fcsID: package.fcsID,

View File

@@ -149,8 +149,8 @@ class _ReceivingInfoState extends State<ReceivingInfo> {
);
PackageModel packageModel =
Provider.of<PackageModel>(context, listen: false);
var pkg = await packageModel.getPackage(widget.package!.id);
initPackage(pkg);
var pkg = await packageModel.getPackage(widget.package!.id!);
initPackage(pkg!);
}
_delete() {

View File

@@ -94,7 +94,7 @@ class _ReceivingListState extends State<ReceivingList> {
_searchCallback(Package package) async {
var packageModel = Provider.of<PackageModel>(context, listen: false);
Package _package = await packageModel.getPackage(package.id);
Package? _package = await packageModel.getPackage(package.id!);
if (_package == null) return;
Navigator.push(
context,

View File

@@ -55,7 +55,7 @@ class ReceivingListRow extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Text(
package!.id == null ? '' : package!.trackingID,
package!.id == null ? '' : package!.trackingID!,
style: new TextStyle(
fontSize: 15.0, color: Colors.black),
),
@@ -63,7 +63,7 @@ class ReceivingListRow extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: new Text(
package!.market == null ? '' : package!.market,
package!.market == null ? '' : package!.market!,
style: new TextStyle(
fontSize: 15.0, color: Colors.black),
),
@@ -79,12 +79,14 @@ class ReceivingListRow extends StatelessWidget {
children: <Widget>[
Padding(
padding: const EdgeInsets.all(3.0),
child: getStatus(package!.status),
child: getStatus(package!.status??""),
),
Padding(
padding: const EdgeInsets.all(0),
child: new Text(
dateFormat.format(package!.currentStatusDate),
package!.currentStatusDate != null
? dateFormat.format(package!.currentStatusDate!)
: '',
style: new TextStyle(fontSize: 15.0, color: Colors.grey),
),
),