2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-13 18:55:34 +00:00

Progress dialog is now a part of the model GET request

This commit is contained in:
Oliver Walters
2020-04-14 22:18:05 +10:00
parent ca7505796d
commit 8bd022bccd
10 changed files with 41 additions and 33 deletions

View File

@ -112,7 +112,7 @@ class _CategoryDisplayState extends State<CategoryDisplayWidget> {
Navigator.push(context, MaterialPageRoute(builder: (context) => CategoryDisplayWidget(null)));
} else {
// TODO - Refactor this code into the InvenTreePart class
InvenTreePartCategory().get(category.parentId).then((var cat) {
InvenTreePartCategory().get(context, category.parentId).then((var cat) {
if (cat is InvenTreePartCategory) {
Navigator.push(context, MaterialPageRoute(builder: (context) => CategoryDisplayWidget(cat)));
}
@ -211,7 +211,7 @@ class SubcategoryList extends StatelessWidget {
void _openCategory(BuildContext context, int pk) {
// Attempt to load the sub-category.
InvenTreePartCategory().get(pk).then((var cat) {
InvenTreePartCategory().get(context, pk).then((var cat) {
if (cat is InvenTreePartCategory) {
Navigator.push(context, MaterialPageRoute(builder: (context) => CategoryDisplayWidget(cat)));
@ -252,7 +252,7 @@ class PartList extends StatelessWidget {
void _openPart(BuildContext context, int pk) {
// Attempt to load the part information
InvenTreePart().get(pk).then((var part) {
InvenTreePart().get(context, pk).then((var part) {
if (part is InvenTreePart) {
Navigator.push(context, MaterialPageRoute(builder: (context) => PartDetailWidget(part)));

View File

@ -85,7 +85,7 @@ class _CompanyListState extends State<CompanyListWidget> {
),
onTap: () {
if (company.pk > 0) {
InvenTreeCompany().get(company.pk).then((var c) {
InvenTreeCompany().get(context, company.pk).then((var c) {
Navigator.push(context, MaterialPageRoute(builder: (context) => CompanyDetailWidget(c)));
});
}

View File

@ -119,7 +119,7 @@ class _LocationDisplayState extends State<LocationDisplayWidget> {
if (location.parentId < 0) {
Navigator.push(context, MaterialPageRoute(builder: (context) => LocationDisplayWidget(null)));
} else {
InvenTreeStockLocation().get(location.parentId).then((var loc) {
InvenTreeStockLocation().get(context, location.parentId).then((var loc) {
if (loc is InvenTreeStockLocation) {
Navigator.push(context, MaterialPageRoute(builder: (context) => LocationDisplayWidget(loc)));
}
@ -208,7 +208,7 @@ class SublocationList extends StatelessWidget {
void _openLocation(BuildContext context, int pk) {
InvenTreeStockLocation().get(pk).then((var loc) {
InvenTreeStockLocation().get(context, pk).then((var loc) {
if (loc is InvenTreeStockLocation) {
Navigator.push(context, MaterialPageRoute(builder: (context) => LocationDisplayWidget(loc)));
@ -244,7 +244,7 @@ class StockList extends StatelessWidget {
StockList(this._items);
void _openItem(BuildContext context, int pk) {
InvenTreeStockItem().get(pk).then((var item) {
InvenTreeStockItem().get(context, pk).then((var item) {
if (item is InvenTreeStockItem) {
Navigator.push(context, MaterialPageRoute(builder: (context) => StockDetailWidget(item)));
}

View File

@ -62,7 +62,7 @@ class _PartDisplayState extends State<PartDetailWidget> {
leading: FaIcon(FontAwesomeIcons.stream),
onTap: () {
if (part.categoryId > 0) {
InvenTreePartCategory().get(part.categoryId).then((var cat) {
InvenTreePartCategory().get(context, part.categoryId).then((var cat) {
Navigator.push(context, MaterialPageRoute(
builder: (context) => CategoryDisplayWidget(cat)));
});

View File

@ -322,7 +322,7 @@ class _StockItemDisplayState extends State<StockDetailWidget> {
leading: FaIcon(FontAwesomeIcons.shapes),
onTap: () {
if (item.partId > 0) {
InvenTreePart().get(item.partId).then((var part) {
InvenTreePart().get(context, item.partId).then((var part) {
if (part is InvenTreePart) {
Navigator.push(context, MaterialPageRoute(builder: (context) => PartDetailWidget(part)));
}
@ -362,7 +362,7 @@ class _StockItemDisplayState extends State<StockDetailWidget> {
leading: FaIcon(FontAwesomeIcons.mapMarkerAlt),
onTap: () {
if (item.locationId > 0) {
InvenTreeStockLocation().get(item.locationId).then((var loc) {
InvenTreeStockLocation().get(context, item.locationId).then((var loc) {
Navigator.push(context, MaterialPageRoute(
builder: (context) => LocationDisplayWidget(loc)));
});