check null safety

This commit is contained in:
tzw
2021-09-10 16:33:52 +06:30
parent 3eacbef117
commit d8c86a512b
46 changed files with 275 additions and 304 deletions

View File

@@ -40,7 +40,7 @@ class _CustomerEditorState extends State<CustomerEditor> {
)),
IconButton(
icon: Icon(Icons.open_in_new, color: primaryColor),
onPressed: () => call(context, widget.customer!.phoneNumber)),
onPressed: () => call(context, widget.customer?.phoneNumber ?? "")),
],
);
@@ -68,7 +68,7 @@ class _CustomerEditorState extends State<CustomerEditor> {
onPressed: () => Navigator.of(context).pop(),
),
title: Text(
widget.customer!.name,
widget.customer?.name ?? "",
style: TextStyle(
fontSize: 20,
color: primaryColor,
@@ -119,7 +119,7 @@ class _CustomerEditorState extends State<CustomerEditor> {
CustomerModel customerModel =
Provider.of<CustomerModel>(context, listen: false);
try {
await customerModel.acceptRequest(widget.customer!.id);
await customerModel.acceptRequest(widget.customer?.id ?? "");
Navigator.pop(context);
} catch (e) {
showMsgDialog(context, "Error", e.toString());