fix null safety
This commit is contained in:
@@ -12,7 +12,7 @@ import 'package:logging/logging.dart';
|
||||
|
||||
class CartonModel extends BaseModel {
|
||||
List<Carton> _boxes = [];
|
||||
late PaginatorListener<Carton> cartonsByFilter;
|
||||
PaginatorListener<Carton>? cartonsByFilter;
|
||||
|
||||
final log = Logger('CartonModel');
|
||||
List<Carton> get boxes => _selectedIndex == 1
|
||||
@@ -165,8 +165,8 @@ class CartonModel extends BaseModel {
|
||||
.where("status", isEqualTo: carton_packed_status)
|
||||
.orderBy(orderName, descending: true);
|
||||
|
||||
cartonsByFilter.refresh(
|
||||
listeningQuery: listenerQuery, pageQuery: pageQuery);
|
||||
cartonsByFilter!
|
||||
.refresh(listeningQuery: listenerQuery, pageQuery: pageQuery);
|
||||
} catch (e) {
|
||||
log.warning("Error!! $e");
|
||||
}
|
||||
@@ -211,7 +211,7 @@ class CartonModel extends BaseModel {
|
||||
if (listener != null) await listener!.cancel();
|
||||
if (cartonListener != null) await cartonListener!.cancel();
|
||||
if (_delivered != null) _delivered!.close();
|
||||
if (cartonsByFilter != null) cartonsByFilter.close();
|
||||
if (cartonsByFilter != null) cartonsByFilter!.close();
|
||||
_boxes = [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user