2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 10:15:32 +00:00

Fixes for type casting

This commit is contained in:
Oliver
2021-09-28 17:53:14 +10:00
parent 9d95cae612
commit c1152ee286
18 changed files with 294 additions and 228 deletions

View File

@ -146,7 +146,10 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
data: {
"parent": (pk > 0) ? pk : null,
},
onSuccess: (data) async {
onSuccess: (result) async {
Map<String, dynamic> data = result as Map<String, dynamic>;
if (data.containsKey("pk")) {
var loc = InvenTreeStockLocation.fromJson(data);
@ -175,7 +178,10 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
data: {
"location": pk,
},
onSuccess: (data) async {
onSuccess: (result) async {
Map<String, dynamic> data = result as Map<String, dynamic>;
if (data.containsKey("pk")) {
var item = InvenTreeStockItem.fromJson(data);
@ -515,7 +521,8 @@ class _PaginatedStockListState extends State<PaginatedStockList> {
params["search"] = "${_searchTerm}";
// Do we include stock items from sub-locations?
final bool cascade = await InvenTreeSettingsManager().getValue("stockSublocation", true);
final bool cascade = await InvenTreeSettingsManager().getBool("stockSublocation", true);
params["cascade"] = "${cascade}";
final page = await InvenTreeStockItem().listPaginated(_pageSize, pageKey, filters: params);