null safety
This commit is contained in:
@@ -11,7 +11,7 @@ import 'package:provider/provider.dart';
|
||||
typedef void FindCallBack();
|
||||
|
||||
class InvitationEditor extends StatefulWidget {
|
||||
final User customer;
|
||||
final User? customer;
|
||||
const InvitationEditor({this.customer});
|
||||
@override
|
||||
_InvitationEditorState createState() => _InvitationEditorState();
|
||||
@@ -31,13 +31,13 @@ class _InvitationEditorState extends State<InvitationEditor> {
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: DisplayText(
|
||||
text: widget.customer.phoneNumber,
|
||||
text: widget.customer!.phoneNumber,
|
||||
labelTextKey: getLocalString(context, "customer.phone"),
|
||||
iconData: Icons.phone,
|
||||
)),
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user