null safety
This commit is contained in:
@@ -12,9 +12,9 @@ import 'package:provider/provider.dart';
|
||||
import 'invoice_list_row.dart';
|
||||
|
||||
class InvoiceList extends StatefulWidget {
|
||||
final bool forCustomer;
|
||||
final bool? forCustomer;
|
||||
|
||||
const InvoiceList({Key key, this.forCustomer}) : super(key: key);
|
||||
const InvoiceList({Key? key, this.forCustomer}) : super(key: key);
|
||||
@override
|
||||
_InvoiceListState createState() => _InvoiceListState();
|
||||
}
|
||||
@@ -29,13 +29,13 @@ class _InvoiceListState extends State<InvoiceList> {
|
||||
_controller.addListener(() async {
|
||||
if (_controller.position.pixels == _controller.position.maxScrollExtent) {
|
||||
Provider.of<InvoiceModel>(context, listen: false)
|
||||
.loadMore(isCustomer: widget.forCustomer);
|
||||
.loadMore(isCustomer: widget.forCustomer!);
|
||||
}
|
||||
});
|
||||
|
||||
InvoiceModel invoiceModel =
|
||||
Provider.of<InvoiceModel>(context, listen: false);
|
||||
invoiceModel.initData(widget.forCustomer, true, false);
|
||||
invoiceModel.initData(widget.forCustomer!, true, false);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -66,13 +66,13 @@ class _InvoiceListState extends State<InvoiceList> {
|
||||
invoiceModel.selectedIndex = p.id;
|
||||
if (p.id == 2) {
|
||||
Provider.of<InvoiceModel>(context, listen: false)
|
||||
.initData(widget.forCustomer, false, true);
|
||||
.initData(widget.forCustomer!, false, true);
|
||||
} else if (p.id == 3) {
|
||||
Provider.of<InvoiceModel>(context, listen: false)
|
||||
.initData(widget.forCustomer, true, false);
|
||||
.initData(widget.forCustomer!, true, false);
|
||||
} else {
|
||||
Provider.of<InvoiceModel>(context, listen: false)
|
||||
.initData(widget.forCustomer, true, false);
|
||||
.initData(widget.forCustomer!, true, false);
|
||||
}
|
||||
}),
|
||||
);
|
||||
@@ -93,7 +93,7 @@ class _InvoiceListState extends State<InvoiceList> {
|
||||
color: Colors.white, fontSize: 20),
|
||||
actions: <Widget>[popupMenu],
|
||||
),
|
||||
floatingActionButton: widget.forCustomer
|
||||
floatingActionButton: widget.forCustomer!
|
||||
? null
|
||||
: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
|
||||
Reference in New Issue
Block a user