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

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