mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-27 21:16:48 +00:00
* Add new models for SalesOrder - Create generic Order and OrderLine models with common functionality * Refactor - Move some widgets around - Cleanup directory structure * Add link to home screen and nav drawer * Add SalesOrder list widget * Linting fixes * Fix string * Refactor PurchaseOrderDetailWidget * Tweaks to existing code * linting * Fixes for drawer widget * Add "detail" page for SalesOrder * Add more tiles to SalesOrder detail * Allow editing of salesorder * add list filters for sales orders * Display list of line items * Customer updates - Display customer icon on home screen - Fetch sales orders for customer detail page * Cleanup company detail view * Create new sales order from list * Stricter typing for formFields method * Create new PurchaseOrder and SalesOrder from company deatil * Status code updates - Add function for name comparison - Remove hard-coded values * Update view permission checks for home widget * Add ability to manually add SalesOrderLineItem * Add nice progress bar widgets * Display detail view for sales order line item * edit SalesOrderLineItem * Fix unused import * Hide "shipped items" tab - Will be added in a future update
61 lines
961 B
Dart
61 lines
961 B
Dart
|
|
|
|
import "package:flutter/material.dart";
|
|
import "package:flutter_overlay_loader/flutter_overlay_loader.dart";
|
|
import "package:inventree/app_colors.dart";
|
|
|
|
|
|
/*
|
|
* A simplified linear progress bar widget,
|
|
* with standardized color depiction
|
|
*/
|
|
Widget ProgressBar(
|
|
double value,
|
|
{
|
|
double maximum = 1.0
|
|
}) {
|
|
|
|
double v = 0;
|
|
|
|
if (value <= 0 || maximum <= 0) {
|
|
v = 0;
|
|
} else {
|
|
v = value / maximum;
|
|
}
|
|
|
|
return LinearProgressIndicator(
|
|
value: v,
|
|
backgroundColor: Colors.grey,
|
|
color: v >= 1 ? COLOR_SUCCESS : COLOR_WARNING,
|
|
);
|
|
}
|
|
|
|
|
|
/*
|
|
* Construct a circular progress indicator
|
|
*/
|
|
Widget progressIndicator() {
|
|
|
|
return Center(
|
|
child: CircularProgressIndicator()
|
|
);
|
|
}
|
|
|
|
|
|
void showLoadingOverlay(BuildContext? context) {
|
|
|
|
if (context == null) {
|
|
return;
|
|
}
|
|
|
|
Loader.show(
|
|
context,
|
|
themeData: Theme.of(context).copyWith(colorScheme: ColorScheme.fromSwatch())
|
|
);
|
|
}
|
|
|
|
|
|
void hideLoadingOverlay() {
|
|
Loader.hide();
|
|
}
|