null safety
This commit is contained in:
@@ -2,7 +2,7 @@ import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../main/util.dart';
|
||||
@@ -11,8 +11,8 @@ import 'invoice_customer_list.dart';
|
||||
typedef OnSelect(FcsShipment fcsShipment);
|
||||
|
||||
class InvoiceShipmentListRow extends StatefulWidget {
|
||||
final OnSelect onSelect;
|
||||
final FcsShipment fcsShipment;
|
||||
final OnSelect? onSelect;
|
||||
final FcsShipment? fcsShipment;
|
||||
const InvoiceShipmentListRow({this.fcsShipment, this.onSelect});
|
||||
|
||||
@override
|
||||
@@ -28,7 +28,7 @@ class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.fcsShipment != null) {
|
||||
_fcsShipment = widget.fcsShipment;
|
||||
_fcsShipment = widget.fcsShipment!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class _InvoiceShipmentListRowState extends State<InvoiceShipmentListRow> {
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (widget.onSelect != null) widget.onSelect(widget.fcsShipment);
|
||||
if (widget.onSelect != null) widget.onSelect!(widget.fcsShipment!);
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
|
||||
Reference in New Issue
Block a user