check null safety
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user