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

@@ -125,7 +125,7 @@ class _CustomerListState extends State<CustomerList> {
Padding(
padding: const EdgeInsets.only(top: 2.0),
child: new Text(
customer.name,
customer.name ?? "",
style: new TextStyle(
fontSize: 20.0, color: primaryColor),
),
@@ -171,7 +171,7 @@ class _CustomerListState extends State<CustomerList> {
children: [
Padding(
padding: const EdgeInsets.only(right: 5),
child: _status(customer.status),
child: _status(customer.status ?? ""),
),
Padding(
padding: const EdgeInsets.only(right: 5),
@@ -222,17 +222,17 @@ class _CustomerListState extends State<CustomerList> {
)))
.then((value) {
if (customer.fcsUnseenCount > 0) {
messageModel.seenMessages(customer.id, false);
messageModel.seenMessages(customer.id ?? "", false);
}
});
if (customer.fcsUnseenCount > 0) {
messageModel.seenMessages(customer.id, false);
messageModel.seenMessages(customer.id ?? "", false);
}
}
_share(User user) async {
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
String appUrl = mainModel.setting.appUrl;
String appUrl = mainModel.setting?.appUrl ?? "";
final RenderBox? box = context.findRenderObject() as RenderBox;
await Share.share(
"Join us on FCS Logistics App. Here is the link:\n $appUrl\n" +