check null safety
This commit is contained in:
@@ -21,7 +21,8 @@ class ContactPage extends StatefulWidget {
|
||||
class _ContactPageState extends State<ContactPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Setting setting = Provider.of<MainModel>(context).setting;
|
||||
Setting? setting = Provider.of<MainModel>(context).setting;
|
||||
if (setting == null) return Container();
|
||||
bool isEditable = context.select((MainModel m) => m.contactEditable());
|
||||
|
||||
return Scaffold(
|
||||
@@ -61,14 +62,14 @@ class _ContactPageState extends State<ContactPage> {
|
||||
children: [
|
||||
itemTitle(context, "contact.callus"),
|
||||
contactItem(context, setting.usaContactNumber, CupertinoIcons.phone,
|
||||
onTap: () => _call(setting.usaContactNumber),
|
||||
onTap: () => _call(setting.usaContactNumber ?? ""),
|
||||
labelKey: "contact.usa.phone"),
|
||||
contactItem(
|
||||
context,
|
||||
setting.mmContactNumber,
|
||||
CupertinoIcons.phone,
|
||||
onTap: () => _call(
|
||||
setting.mmContactNumber,
|
||||
setting.mmContactNumber ?? "",
|
||||
),
|
||||
labelKey: "contact.mm.phone",
|
||||
),
|
||||
@@ -90,7 +91,7 @@ class _ContactPageState extends State<ContactPage> {
|
||||
context,
|
||||
setting.emailAddress,
|
||||
CupertinoIcons.mail,
|
||||
onTap: () => _email(setting.emailAddress),
|
||||
onTap: () => _email(setting.emailAddress ?? ""),
|
||||
labelKey: "contact.fcs.email",
|
||||
),
|
||||
itemTitle(context, "contact.visitus"),
|
||||
@@ -98,7 +99,7 @@ class _ContactPageState extends State<ContactPage> {
|
||||
context,
|
||||
setting.facebookLink,
|
||||
FontAwesomeIcons.facebook,
|
||||
onTap: () => _opencontactItem(setting.facebookLink),
|
||||
onTap: () => _opencontactItem(setting.facebookLink ?? ""),
|
||||
labelKey: "contact.facebook",
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user