cleanup code
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CargoTable extends StatefulWidget {
|
||||
@@ -68,7 +66,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
c.name ?? "",
|
||||
style: textStyle,
|
||||
)),
|
||||
DataCell(c.qty == null || c.qty == 0
|
||||
DataCell(c.qty == 0
|
||||
? Center(
|
||||
child: Text(
|
||||
"-",
|
||||
@@ -82,8 +80,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
),
|
||||
)),
|
||||
DataCell(
|
||||
Text(c.weight == null ? "0" : c.weight.toStringAsFixed(2),
|
||||
style: textStyle),
|
||||
Text(c.weight.toStringAsFixed(2), style: textStyle),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/dialog_input.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
typedef OnRemove(CargoType cargoType);
|
||||
@@ -94,7 +93,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
c.isCutomDuty!
|
||||
? GestureDetector(
|
||||
onTap: () async {
|
||||
String _t = await showDialog(
|
||||
String? _t = await showDialog(
|
||||
context: context,
|
||||
builder: (_) => DialogInput(
|
||||
label: "cargo.qty", value: c.qty.toString()));
|
||||
@@ -114,7 +113,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
),
|
||||
child: new Text(
|
||||
c.qty == null ? "" : c.qty.toString(),
|
||||
c.qty.toString(),
|
||||
style: textStyle,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -140,7 +139,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
return;
|
||||
}
|
||||
|
||||
String _t = await showDialog(
|
||||
String? _t = await showDialog(
|
||||
context: context,
|
||||
builder: (_) => DialogInput(
|
||||
label: "cargo.weight",
|
||||
@@ -161,9 +160,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
border: Border.all(color: primaryColor),
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
),
|
||||
child: Text(
|
||||
c.weight == null ? "0.00" : c.weight.toStringAsFixed(2),
|
||||
style: textStyle),
|
||||
child: Text(c.weight.toStringAsFixed(2), style: textStyle),
|
||||
),
|
||||
),
|
||||
widget.onRemove == null
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -78,7 +77,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
style: textStyle,
|
||||
),
|
||||
new Text(
|
||||
c.qty == null || c.qty == 0 ? "" : " x ${c.qty.toString()}",
|
||||
c.qty == 0 ? "" : " x ${c.qty.toString()}",
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
],
|
||||
@@ -135,9 +134,7 @@ class _CargoTableState extends State<CargoTable> {
|
||||
totalWeight = _t;
|
||||
this.remainingWeight = this.totalWeight - _total;
|
||||
widget.cargoTypes!.forEach((c) {
|
||||
if (c.qty == null) {
|
||||
this._cargos.add(c);
|
||||
}
|
||||
this._cargos.add(c);
|
||||
});
|
||||
this._cargos.forEach((c) {
|
||||
_list.add(c.name!);
|
||||
|
||||
@@ -110,6 +110,7 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
name: _carton!.senderName);
|
||||
_selectedMixBoxType = _carton!.mixBoxType;
|
||||
this._mixCartons =
|
||||
// ignore: unnecessary_null_comparison
|
||||
_carton!.mixCartons == null ? [] : List.from(_carton!.mixCartons);
|
||||
bool isMixBox = _carton!.cartonType == carton_mix_box;
|
||||
bool isFromPackages = _carton!.cartonType == carton_from_packages;
|
||||
@@ -665,11 +666,11 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
bool isFromPackages = _selectedCartonType == carton_from_packages;
|
||||
bool isFromCartons = _selectedCartonType == carton_from_cartons;
|
||||
|
||||
if (isFromPackages) {
|
||||
_loadPackages();
|
||||
c.value.packages = _carton!.packages;
|
||||
Carton _c = await Navigator.push(
|
||||
Carton? _c = await Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => PackageCartonEditor(
|
||||
@@ -791,10 +792,8 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
_updateCargo(CargoType cargo) {
|
||||
setState(() {
|
||||
var _c = _cargoTypes.firstWhere((e) => e.id == cargo.id);
|
||||
if (_c != null) {
|
||||
_c.weight = cargo.weight;
|
||||
_c.qty = cargo.qty;
|
||||
}
|
||||
_c.weight = cargo.weight;
|
||||
_c.qty = cargo.qty;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -880,7 +879,6 @@ class _CartonEditorState extends State<CartonEditor> {
|
||||
}
|
||||
|
||||
_addMixCarton(Carton carton) {
|
||||
if (carton == null) return;
|
||||
if (this._mixCartons.any((c) => c.id == carton.id)) return;
|
||||
setState(() {
|
||||
this._mixCartons.add(carton);
|
||||
|
||||
@@ -272,11 +272,11 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
final cargoTableBox = CargoTable(
|
||||
cargoTypes: _box!.cargoTypes,
|
||||
);
|
||||
final mixCartonNumberBox = DisplayText(
|
||||
text: _box!.mixCartonNumber,
|
||||
labelTextKey: "box.mix.carton",
|
||||
iconData: MaterialCommunityIcons.package,
|
||||
);
|
||||
// final mixCartonNumberBox = DisplayText(
|
||||
// text: _box!.mixCartonNumber,
|
||||
// labelTextKey: "box.mix.carton",
|
||||
// iconData: MaterialCommunityIcons.package,
|
||||
// );
|
||||
|
||||
final mixTypeBox = Container(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
|
||||
@@ -293,11 +293,9 @@ class _PackageCartonEditorState extends State<PackageCartonEditor> {
|
||||
_updateCargo(CargoType cargo) {
|
||||
setState(() {
|
||||
var _c = _cargoTypes.firstWhere((e) => e.id == cargo.id);
|
||||
if (_c != null) {
|
||||
_c.weight = cargo.weight;
|
||||
_c.qty = cargo.qty;
|
||||
}
|
||||
});
|
||||
_c.weight = cargo.weight;
|
||||
_c.qty = cargo.qty;
|
||||
});
|
||||
}
|
||||
|
||||
_creatCarton() async {
|
||||
|
||||
@@ -119,7 +119,7 @@ class _CartonSizeListState extends State<CartonSizeList> {
|
||||
));
|
||||
}
|
||||
|
||||
_remove(CartonSize cartonSize) {
|
||||
_remove(CartonSize? cartonSize) {
|
||||
if (cartonSize == null) {
|
||||
showMsgDialog(context, "Esrror", "Invalid cartonsize!");
|
||||
return;
|
||||
|
||||
@@ -191,7 +191,7 @@ class _CustomerListState extends State<CustomerList> {
|
||||
}
|
||||
|
||||
Widget getCount(User customer) {
|
||||
return customer.fcsUnseenCount != null && customer.fcsUnseenCount > 0
|
||||
return customer.fcsUnseenCount > 0
|
||||
? Container(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
decoration:
|
||||
|
||||
@@ -146,10 +146,7 @@ class _InvitationCreateState extends State<InvitationCreate> {
|
||||
_invite() async {
|
||||
String userName = _nameController.text;
|
||||
String phoneNumber = dialCode + _phoneController.text;
|
||||
if (userName == null ||
|
||||
userName == "" ||
|
||||
phoneNumber == null ||
|
||||
phoneNumber == "") {
|
||||
if (userName == "" || phoneNumber == "") {
|
||||
showMsgDialog(context, "Error", "Invalid name or phone number");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:fcs/domain/constants.dart';
|
||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||
import 'package:fcs/domain/entities/carton.dart';
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/domain/vo/delivery_address.dart';
|
||||
@@ -14,7 +13,6 @@ import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||
import 'package:fcs/pages/widgets/defalut_delivery_address.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||
import 'package:fcs/pages/widgets/length_picker.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_radio_buttons.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
@@ -39,11 +37,8 @@ class DeliveryInfo extends StatefulWidget {
|
||||
class _DeliveryInfoState extends State<DeliveryInfo> {
|
||||
bool _isLoading = false;
|
||||
late Carton _box;
|
||||
late String _selectedCartonType;
|
||||
List<Package> _packages = [];
|
||||
List<Carton> _mixBoxes = [];
|
||||
Carton _selectedShipmentBox = new Carton();
|
||||
List<CargoType> _cargoTypes = [];
|
||||
|
||||
// List<CargoType> _cargoTypes = [];
|
||||
DeliveryAddress _deliveryAddress = new DeliveryAddress();
|
||||
TextEditingController _widthController = new TextEditingController();
|
||||
TextEditingController _heightController = new TextEditingController();
|
||||
@@ -61,7 +56,6 @@ class _DeliveryInfoState extends State<DeliveryInfo> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.box != null) _box = widget.box!;
|
||||
_selectedCartonType = _box.cartonType ?? '';
|
||||
|
||||
//for shipment weight
|
||||
volumetricRatio = Provider.of<ShipmentRateModel>(context, listen: false)
|
||||
@@ -79,7 +73,7 @@ class _DeliveryInfoState extends State<DeliveryInfo> {
|
||||
_widthController.text = _box.width.toString();
|
||||
_heightController.text = _box.height.toString();
|
||||
_lengthController.text = _box.length.toString();
|
||||
_cargoTypes = _box.cargoTypes;
|
||||
// _cargoTypes = _box.cargoTypes;
|
||||
_deliveryAddress = _box.deliveryAddress!;
|
||||
isMixBox = _box.cartonType == carton_mix_box;
|
||||
isFromShipments = _box.cartonType == carton_from_shipments;
|
||||
@@ -155,70 +149,70 @@ class _DeliveryInfoState extends State<DeliveryInfo> {
|
||||
iconData: Icons.person,
|
||||
);
|
||||
|
||||
final shipmentBoxTitle = Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 10.0, top: 20),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child:
|
||||
LocalText(context, 'box.shipment_number', color: Colors.grey),
|
||||
),
|
||||
LocalText(context, 'box.shipment.desc', color: Colors.grey),
|
||||
],
|
||||
),
|
||||
);
|
||||
// final shipmentBoxTitle = Container(
|
||||
// padding: EdgeInsets.only(left: 15, right: 10.0, top: 20),
|
||||
// child: Row(
|
||||
// children: <Widget>[
|
||||
// Expanded(
|
||||
// child:
|
||||
// LocalText(context, 'box.shipment_number', color: Colors.grey),
|
||||
// ),
|
||||
// LocalText(context, 'box.shipment.desc', color: Colors.grey),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
|
||||
final shipmentBoxRow = Container(
|
||||
padding: EdgeInsets.only(left: 15.0, right: 10.0, top: 5.0, bottom: 5.0),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: new Text(
|
||||
_selectedShipmentBox.shipmentNumber ?? "",
|
||||
style: textStyle,
|
||||
)),
|
||||
new Text(
|
||||
_selectedShipmentBox.desc ?? "",
|
||||
style: textStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
// final shipmentBoxRow = Container(
|
||||
// padding: EdgeInsets.only(left: 15.0, right: 10.0, top: 5.0, bottom: 5.0),
|
||||
// child: Row(
|
||||
// children: <Widget>[
|
||||
// Expanded(
|
||||
// child: new Text(
|
||||
// _selectedShipmentBox.shipmentNumber ?? "",
|
||||
// style: textStyle,
|
||||
// )),
|
||||
// new Text(
|
||||
// _selectedShipmentBox.desc ?? "",
|
||||
// style: textStyle,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
|
||||
final lengthBox = LengthPicker(
|
||||
controller: _lengthController,
|
||||
lableKey: "box.length",
|
||||
isReadOnly: true,
|
||||
);
|
||||
final widthBox = LengthPicker(
|
||||
controller: _widthController,
|
||||
lableKey: "box.width",
|
||||
isReadOnly: true,
|
||||
);
|
||||
final heightBox = LengthPicker(
|
||||
controller: _heightController,
|
||||
lableKey: "box.height",
|
||||
isReadOnly: true,
|
||||
);
|
||||
// final lengthBox = LengthPicker(
|
||||
// controller: _lengthController,
|
||||
// lableKey: "box.length",
|
||||
// isReadOnly: true,
|
||||
// );
|
||||
// final widthBox = LengthPicker(
|
||||
// controller: _widthController,
|
||||
// lableKey: "box.width",
|
||||
// isReadOnly: true,
|
||||
// );
|
||||
// final heightBox = LengthPicker(
|
||||
// controller: _heightController,
|
||||
// lableKey: "box.height",
|
||||
// isReadOnly: true,
|
||||
// );
|
||||
|
||||
final dimBox = Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 8.0),
|
||||
child: Icon(FontAwesome.arrow_circle_right, color: primaryColor),
|
||||
),
|
||||
SizedBox(child: lengthBox, width: 80),
|
||||
SizedBox(child: widthBox, width: 80),
|
||||
SizedBox(child: heightBox, width: 80),
|
||||
],
|
||||
);
|
||||
// final dimBox = Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(right: 8.0),
|
||||
// child: Icon(FontAwesome.arrow_circle_right, color: primaryColor),
|
||||
// ),
|
||||
// SizedBox(child: lengthBox, width: 80),
|
||||
// SizedBox(child: widthBox, width: 80),
|
||||
// SizedBox(child: heightBox, width: 80),
|
||||
// ],
|
||||
// );
|
||||
|
||||
final shipmentWeightBox = DisplayText(
|
||||
text: shipmentWeight.toStringAsFixed(0),
|
||||
labelTextKey: "box.shipment_weight",
|
||||
iconData: MaterialCommunityIcons.weight,
|
||||
);
|
||||
// final shipmentWeightBox = DisplayText(
|
||||
// text: shipmentWeight.toStringAsFixed(0),
|
||||
// labelTextKey: "box.shipment_weight",
|
||||
// iconData: MaterialCommunityIcons.weight,
|
||||
// );
|
||||
final mixCartonNumberBox = DisplayText(
|
||||
text: _box.mixCartonNumber,
|
||||
labelTextKey: "box.mix.carton",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'package:barcode_scan2/gen/protos/protos.pb.dart';
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:fcs/data/services/services.dart';
|
||||
import 'package:fcs/domain/vo/delivery_address.dart';
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/discount/discount_list_row.dart';
|
||||
import 'package:fcs/pages/discount/model/discount_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/local_popup_menu_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import 'package:fcs/domain/entities/carton.dart';
|
||||
import 'package:fcs/domain/entities/discount.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/discount/discount_editor.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@@ -59,7 +59,7 @@ class DiscountModel extends BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
Paginator _getUsed() {
|
||||
Paginator? _getUsed() {
|
||||
if (user == null || !user!.hasFcsShipments()) throw "No Privilege";
|
||||
|
||||
var pageQuery = FirebaseFirestore.instance
|
||||
|
||||
@@ -28,9 +28,9 @@ class _FAQDetailPageState extends State<FAQDetailPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if(widget.faq.id != null)
|
||||
faq = context.select((FAQModel m) => m.getFAQ(widget.faq.id!));
|
||||
if (faq == null) return Text("Deleted");
|
||||
if (widget.faq.id != null)
|
||||
faq = context.select((FAQModel m) => m.getFAQ(widget.faq.id!));
|
||||
// if (faq == null) return Text("Deleted");
|
||||
|
||||
bool isEditable = context.select((MainModel m) => m.faqEditable());
|
||||
return LocalProgress(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/domain/constants.dart';
|
||||
import 'package:fcs/domain/entities/faq.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/faq/model/faq_model.dart';
|
||||
import 'package:fcs/pages/faq/widgets.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
|
||||
@@ -15,7 +15,6 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import 'model/faq_model.dart';
|
||||
|
||||
const Duration _kExpand = Duration(milliseconds: 200);
|
||||
|
||||
class FAQListPage extends StatefulWidget {
|
||||
@override
|
||||
@@ -24,18 +23,6 @@ class FAQListPage extends StatefulWidget {
|
||||
|
||||
class _FAQListPageState extends State<FAQListPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
AnimationController? _controller;
|
||||
Animation<double>? _iconTurns;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(duration: _kExpand, vsync: this);
|
||||
var _halfTween = Tween<double>(begin: 0.0, end: 0.5);
|
||||
var _easeInTween = CurveTween(curve: Curves.easeIn);
|
||||
_iconTurns = _controller?.drive(_halfTween.chain(_easeInTween));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
FAQModel faqModel = Provider.of<FAQModel>(context);
|
||||
|
||||
@@ -14,7 +14,8 @@ Widget itemTitle(BuildContext context, String textKey) {
|
||||
);
|
||||
}
|
||||
|
||||
Widget subItemTitle(BuildContext context, String textKey, {IconData? iconData}) {
|
||||
Widget subItemTitle(BuildContext context, String textKey,
|
||||
{IconData? iconData}) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 0, top: 0, bottom: 0),
|
||||
child: Row(
|
||||
@@ -74,7 +75,7 @@ Widget contactItem(BuildContext context, String text, IconData iconData,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
text == null ? "" : text,
|
||||
text,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 5,
|
||||
style: TextStyle(
|
||||
|
||||
@@ -88,11 +88,11 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
|
||||
iconData: Icons.date_range,
|
||||
);
|
||||
|
||||
final departureDateBox = DisplayText(
|
||||
text: _departureDateControler.text,
|
||||
labelTextKey: "FCSshipment.departure_date",
|
||||
iconData: Icons.date_range,
|
||||
);
|
||||
// final departureDateBox = DisplayText(
|
||||
// text: _departureDateControler.text,
|
||||
// labelTextKey: "FCSshipment.departure_date",
|
||||
// iconData: Icons.date_range,
|
||||
// );
|
||||
|
||||
final shipTypeBox = DisplayText(
|
||||
text: _shipmentTypeControler.text,
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import 'package:fcs/domain/entities/carton.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/carton/model/carton_model.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BoxAddition extends StatefulWidget {
|
||||
final Carton? box;
|
||||
@@ -16,25 +14,10 @@ class BoxAddition extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _BoxAdditionState extends State<BoxAddition> {
|
||||
Carton _box = new Carton();
|
||||
bool _isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.box != null) {
|
||||
_box = widget.box!;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var boxModel = Provider.of<CartonModel>(context);
|
||||
return LocalProgress(
|
||||
inAsyncCall: _isLoading,
|
||||
child: Scaffold(
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// ignore_for_file: unnecessary_null_comparison
|
||||
|
||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||
import 'package:fcs/domain/entities/carton.dart';
|
||||
import 'package:fcs/domain/entities/custom_duty.dart';
|
||||
@@ -81,7 +83,8 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
||||
await _loadCartons();
|
||||
await _loadShipments();
|
||||
await _loadDiscount();
|
||||
} catch (e) {} finally {
|
||||
} catch (e) {
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
@@ -118,7 +121,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
||||
DiscountModel discountModel =
|
||||
Provider.of<DiscountModel>(context, listen: false);
|
||||
discounts = (await discountModel.getDiscount(widget.customer!.id!))!;
|
||||
if (discounts != null && discounts.length > 0) {
|
||||
if (discounts.isNotEmpty) {
|
||||
setState(() {
|
||||
_invoice!.discount = discounts.first;
|
||||
});
|
||||
@@ -257,7 +260,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
||||
InvoiceHandlingFeeList(shipments: _invoice!.shipments)));
|
||||
_addShipment(shipment);
|
||||
} else if (p.id == 3) {
|
||||
Discount discount =
|
||||
Discount? discount =
|
||||
await Navigator.of(context).push(CupertinoPageRoute(
|
||||
builder: (context) => InvoiceDiscountList(
|
||||
discounts: discounts,
|
||||
@@ -412,7 +415,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
||||
showMsgDialog(context, "Error", "Expected at least one cargo type");
|
||||
return;
|
||||
}
|
||||
if ((amount ) <= 0) {
|
||||
if ((amount) <= 0) {
|
||||
showMsgDialog(context, "Error", "Expected positive amount");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import 'package:fcs/domain/entities/fcs_shipment.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../main/util.dart';
|
||||
import 'invoice_customer_list.dart';
|
||||
|
||||
typedef OnSelect(FcsShipment fcsShipment);
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:fcs/domain/entities/invoice.dart';
|
||||
import 'package:fcs/domain/entities/rate.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@@ -89,7 +88,7 @@ class InvoiceTable extends StatelessWidget {
|
||||
});
|
||||
// // add delivery fee
|
||||
tableRows.add(InvoiceTableRow(
|
||||
data: invoice!.deliveryFee == null || invoice!.deliveryFee == 0
|
||||
data: invoice!.deliveryFee == 0
|
||||
? null
|
||||
: invoice!.deliveryFee,
|
||||
invoiceDataType: InvoiceDataType.DeliveryFeeType,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fcs/domain/entities/invoice.dart';
|
||||
import 'package:fcs/domain/entities/receipt.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
@@ -8,9 +7,7 @@ import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/image_file_picker.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_title.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:fcs/pages/widgets/show_img.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -28,7 +25,6 @@ class PaymentPageEdit extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _PaymentPageEditState extends State<PaymentPageEdit> {
|
||||
TextEditingController _amountController = new TextEditingController();
|
||||
var dateFormatter = new DateFormat('dd MMM yyyy');
|
||||
|
||||
Receipt _receipt = new Receipt();
|
||||
@@ -72,11 +68,11 @@ class _PaymentPageEditState extends State<PaymentPageEdit> {
|
||||
iconData: Icons.av_timer,
|
||||
text: _receipt.status);
|
||||
|
||||
final receiptFileBox = Row(children: [
|
||||
LocalText(context, 'pm.attachment', fontSize: 16, color: Colors.grey),
|
||||
IconButton(
|
||||
icon: Icon(Icons.attachment, color: primaryColor), onPressed: () {})
|
||||
]);
|
||||
// final receiptFileBox = Row(children: [
|
||||
// LocalText(context, 'pm.attachment', fontSize: 16, color: Colors.grey),
|
||||
// IconButton(
|
||||
// icon: Icon(Icons.attachment, color: primaryColor), onPressed: () {})
|
||||
// ]);
|
||||
|
||||
final comfirmBox =
|
||||
fcsButton(context, getLocalString(context, 'pm.btn_confirm'));
|
||||
|
||||
@@ -27,7 +27,6 @@ import 'package:fcs/pages/pickup/pickup_list.dart';
|
||||
import 'package:fcs/pages/processing/processing_list.dart';
|
||||
import 'package:fcs/pages/rates/shipment_rates.dart';
|
||||
import 'package:fcs/pages/receiving/receiving_list.dart';
|
||||
import 'package:fcs/pages/shipment/shipment_list.dart';
|
||||
import 'package:fcs/pages/staff/staff_list.dart';
|
||||
import 'package:fcs/pages/widgets/badge.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_widgets.dart';
|
||||
@@ -38,7 +37,6 @@ import 'package:fcs/pages/widgets/task_button.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -60,8 +58,8 @@ class _HomePageState extends State<HomePage> {
|
||||
bool login = false;
|
||||
bool _isLoading = false;
|
||||
List<bool> isSelected = [true, false];
|
||||
static FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
||||
FlutterLocalNotificationsPlugin();
|
||||
// static FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
|
||||
// FlutterLocalNotificationsPlugin();
|
||||
TextEditingController _searchCtl = TextEditingController();
|
||||
List<bool> isFcs = [false];
|
||||
|
||||
@@ -255,17 +253,17 @@ class _HomePageState extends State<HomePage> {
|
||||
btnCallback: () => Navigator.of(context).push<void>(
|
||||
CupertinoPageRoute(builder: (context) => CartonList())));
|
||||
|
||||
final shipmentBtn = TaskButton("shipment",
|
||||
icon: SimpleLineIcons.direction,
|
||||
btnCallback: () => Navigator.of(context)
|
||||
.push(CupertinoPageRoute(builder: (context) => ShipmentList())));
|
||||
// final shipmentBtn = TaskButton("shipment",
|
||||
// icon: SimpleLineIcons.direction,
|
||||
// btnCallback: () => Navigator.of(context)
|
||||
// .push(CupertinoPageRoute(builder: (context) => ShipmentList())));
|
||||
|
||||
final shipmentBtnFcs = TaskButton("shipment",
|
||||
icon: SimpleLineIcons.direction,
|
||||
btnCallback: () => Navigator.of(context).push(CupertinoPageRoute(
|
||||
builder: (context) => ShipmentList(
|
||||
forCustomer: false,
|
||||
))));
|
||||
// final shipmentBtnFcs = TaskButton("shipment",
|
||||
// icon: SimpleLineIcons.direction,
|
||||
// btnCallback: () => Navigator.of(context).push(CupertinoPageRoute(
|
||||
// builder: (context) => ShipmentList(
|
||||
// forCustomer: false,
|
||||
// ))));
|
||||
|
||||
final pickupBtnFcs = TaskButton("pickup.title",
|
||||
icon: SimpleLineIcons.direction,
|
||||
@@ -538,7 +536,7 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
try {
|
||||
String term = _searchCtl.text;
|
||||
if (term == null || term.trim() == "") return;
|
||||
if ( term.trim() == "") return;
|
||||
var packageModel = Provider.of<PackageModel>(context, listen: false);
|
||||
Package? package = await packageModel.lookupPackage(term);
|
||||
if (package == null) {
|
||||
|
||||
@@ -102,7 +102,7 @@ class _MarketEditorState extends State<MarketEditor> {
|
||||
));
|
||||
}
|
||||
|
||||
_remove(Market market) {
|
||||
_remove(Market? market) {
|
||||
if (market == null) {
|
||||
showMsgDialog(context, "Esrror", "Invalid market!");
|
||||
return;
|
||||
|
||||
@@ -258,7 +258,7 @@ class PackageModel extends BaseModel {
|
||||
}
|
||||
|
||||
Future<void> createReceiving(
|
||||
User user, Package package, List<File?> files) async {
|
||||
User? user, Package package, List<File?>? files) async {
|
||||
if (user != null) {
|
||||
package.fcsID = user.fcsID;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ class PackageModel extends BaseModel {
|
||||
throw Exception("Exceed number of file upload");
|
||||
}
|
||||
|
||||
package.photoUrls = package.photoUrls == null ? [] : package.photoUrls;
|
||||
package.photoUrls = package.photoUrls;
|
||||
String path = Path.join(pkg_files_path);
|
||||
List<String> urls = await uploadFiles(path, files);
|
||||
package.photoUrls = urls;
|
||||
@@ -284,26 +284,26 @@ class PackageModel extends BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateReceiving(User user, Package package, List<File?> files,
|
||||
Future<void> updateReceiving(User? user, Package package, List<File?> files,
|
||||
List<String?> deletedUrls) async {
|
||||
if (user != null) {
|
||||
package.fcsID = user.fcsID;
|
||||
}
|
||||
if (deletedUrls != null) {
|
||||
if (deletedUrls.isNotEmpty) {
|
||||
for (String? url in deletedUrls) {
|
||||
package.photoUrls.remove(url);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> uploadedURL = [];
|
||||
if (files != null) {
|
||||
if (files.isNotEmpty) {
|
||||
var count =
|
||||
(package.photoUrls.length) + files.length - (deletedUrls.length);
|
||||
|
||||
if (count > uploadPhotoLimit)
|
||||
throw Exception("Exceed number of file upload");
|
||||
|
||||
package.photoUrls = package.photoUrls == null ? [] : package.photoUrls;
|
||||
package.photoUrls = package.photoUrls;
|
||||
String path = Path.join(pkg_files_path);
|
||||
uploadedURL = await uploadFiles(path, files);
|
||||
uploadedURL.forEach((url) {
|
||||
@@ -329,20 +329,20 @@ class PackageModel extends BaseModel {
|
||||
|
||||
Future<void> updateProcessing(
|
||||
Package package, List<File?> files, List<String?> deletedUrls) async {
|
||||
if (deletedUrls != null) {
|
||||
if (deletedUrls.isNotEmpty) {
|
||||
for (String? url in deletedUrls) {
|
||||
package.photoUrls.remove(url);
|
||||
}
|
||||
}
|
||||
|
||||
List<String> uploadedURL = [];
|
||||
if (files != null) {
|
||||
if (files.isNotEmpty) {
|
||||
var count =
|
||||
(package.photoUrls.length) + files.length - (deletedUrls.length);
|
||||
|
||||
if (count > uploadPhotoLimit)
|
||||
throw Exception("Exceed number of file upload");
|
||||
package.photoUrls = package.photoUrls == null ? [] : package.photoUrls;
|
||||
package.photoUrls = package.photoUrls;
|
||||
String path = Path.join(pkg_files_path);
|
||||
uploadedURL = await uploadFiles(path, files);
|
||||
uploadedURL.forEach((url) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/market/market_editor.dart';
|
||||
import 'package:fcs/pages/market/model/market_model.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package/tracking_id_page.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
@@ -226,8 +225,7 @@ class _PackageEditorPageState extends State<PackageEditorPage> {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
PackageModel packageModel =
|
||||
Provider.of<PackageModel>(context, listen: false);
|
||||
|
||||
try {
|
||||
_package!.desc = _descCtl.text;
|
||||
_package!.remark = _remarkCtl.text;
|
||||
@@ -252,8 +250,7 @@ class _PackageEditorPageState extends State<PackageEditorPage> {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
PackageModel packageModel =
|
||||
Provider.of<PackageModel>(context, listen: false);
|
||||
|
||||
try {
|
||||
// await packageModel.deletePackage(_package);
|
||||
Navigator.pop<bool>(context, true);
|
||||
|
||||
@@ -3,9 +3,7 @@ import 'package:fcs/domain/entities/user.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/package/tracking_id_page.dart';
|
||||
import 'package:fcs/pages/user_search/user_serach.dart';
|
||||
import 'package:fcs/pages/staff/model/staff_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
@@ -187,7 +185,7 @@ class _PackageNewState extends State<PackageNew> {
|
||||
}
|
||||
|
||||
_create() async {
|
||||
if (user == null || packages == null || packages.length == 0) {
|
||||
if (user == null || packages.length == 0) {
|
||||
showMsgDialog(context, "Error", "Invalid user!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,14 +5,12 @@ import 'package:fcs/pages/market/market_editor.dart';
|
||||
import 'package:fcs/pages/market/model/market_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/barcode_scanner.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
const MANAGE_MARKET = "Manage Market";
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package/package_list_row.dart';
|
||||
import 'package:fcs/pages/widgets/barcode_scanner.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
Future<Package?> searchPackage(BuildContext context,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:fcs/domain/entities/payment_method.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/payment_methods/model/payment_method_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import 'package:fcs/domain/entities/payment_method.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/payment_methods/model/payment_method_model.dart';
|
||||
import 'package:fcs/pages/payment_methods/payment_method_editor.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
@@ -128,7 +126,7 @@ class _PaymentMethodPageState extends State<PaymentMethodPage> {
|
||||
}
|
||||
|
||||
_itemRow(String text, String labelKey, {IconData? iconData}) {
|
||||
return text == null || text == ""
|
||||
return text == ""
|
||||
? Container()
|
||||
: Row(
|
||||
children: [
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/domain/entities/market.dart';
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/domain/entities/pickup.dart';
|
||||
import 'package:fcs/domain/entities/user.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/market/market_editor.dart';
|
||||
import 'package:fcs/pages/market/model/market_model.dart';
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/domain/entities/pickup.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package_search/package_serach.dart';
|
||||
import 'package:fcs/pages/pickup/pickup_editor.dart';
|
||||
import 'package:fcs/pages/pickup/pickup_info.dart';
|
||||
import 'package:fcs/pages/pickup/pickup_list_row.dart';
|
||||
import 'package:fcs/pages/pickup_search/pickup_serach.dart';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/domain/entities/processing.dart';
|
||||
import 'package:fcs/pages/main/model/base_model.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
@@ -9,7 +9,6 @@ import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package/tracking_id_page.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/package_search/package_serach.dart';
|
||||
import 'package:fcs/pages/widgets/barcode_scanner.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
@@ -19,7 +18,6 @@ import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class PackageEditor extends StatefulWidget {
|
||||
|
||||
@@ -257,12 +257,6 @@ class _ProcesingEditorState extends State<ProcesingEditor> {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
_removePackage(Package package) {
|
||||
if (package == null) return;
|
||||
this.packages.removeWhere((p) => p.trackingID == package.trackingID);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
_save() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package/tracking_id_page.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/user_search/user_serach.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package_search/package_serach.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
|
||||
@@ -35,8 +35,7 @@ class _CustomEditorState extends State<CustomEditor> {
|
||||
_custom = widget.custom!;
|
||||
_productController.text = _custom.name ?? "";
|
||||
_feeController.text = _custom.customDutyFee.toStringAsFixed(2);
|
||||
_shipmentRateController.text =
|
||||
_custom.rate == null ? "" : _custom.rate.toStringAsFixed(2);
|
||||
_shipmentRateController.text = _custom.rate.toStringAsFixed(2);
|
||||
} else {
|
||||
_isNew = true;
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ class _CustomListState extends State<CustomList> {
|
||||
child: _row(
|
||||
custom.name??"",
|
||||
"Custom Fee \$ " + custom.customDutyFee.toStringAsFixed(2),
|
||||
// ignore: unnecessary_null_comparison
|
||||
custom.rate == null
|
||||
? ""
|
||||
: "Shipment rate \$ " +
|
||||
|
||||
@@ -200,7 +200,7 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
||||
}
|
||||
|
||||
List<Widget> getDiscountWidget(List<DiscountByWeight> discounts) {
|
||||
if (discounts == null) return [];
|
||||
if (discounts.isEmpty) return [];
|
||||
return discounts.map((d) {
|
||||
return Container(
|
||||
child: _row("${d.weight.toStringAsFixed(2)} lb",
|
||||
|
||||
@@ -67,7 +67,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
setState(() {
|
||||
_deliveryFee =
|
||||
effectiveWeight > rate.freeDeliveryWeight ? 0 : rate.deliveryFee;
|
||||
_amount = amount == null ? 0 : amount + _deliveryFee;
|
||||
_amount = amount + _deliveryFee;
|
||||
_shipmentWeight = shipmentWeight.toDouble();
|
||||
});
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
||||
);
|
||||
|
||||
final shipmentWeightBox = DisplayText(
|
||||
text: _shipmentWeight != null ? _shipmentWeight.toStringAsFixed(2) : "0",
|
||||
text: _shipmentWeight.toStringAsFixed(2),
|
||||
labelTextKey: "box.shipment_weight",
|
||||
iconData: MaterialCommunityIcons.weight,
|
||||
);
|
||||
|
||||
@@ -49,8 +49,6 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var shipmentRateModel = Provider.of<ShipmentRateModel>(context);
|
||||
|
||||
final minWigBox = InputText(
|
||||
labelTextKey: 'rate.min_weight',
|
||||
iconData: FontAwesomeIcons.weightHanging,
|
||||
|
||||
@@ -15,7 +15,6 @@ import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
typedef void FindCallBack();
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
import 'package:fcs/pages/widgets/fcs_id_icon.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_controller.dart';
|
||||
import 'package:fcs/pages/widgets/multi_img_file.dart';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package_search/package_serach.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:fcs/pagination/paginator_listview.dart';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:fcs/domain/constants.dart';
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/domain/entities/user.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
@@ -8,7 +7,6 @@ import 'package:fcs/pages/staff/model/staff_model.dart';
|
||||
import 'package:fcs/pages/widgets/input_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_dropdown.dart';
|
||||
import 'package:fcs/pages/widgets/local_radio_buttons.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/local_title.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
@@ -42,7 +40,6 @@ class _ShipmentAssignState extends State<ShipmentAssign> {
|
||||
bool _isLoading = false;
|
||||
var now = new DateTime.now();
|
||||
|
||||
String? _selectedShipmentType;
|
||||
User? _user;
|
||||
List<User>? _users;
|
||||
|
||||
@@ -53,13 +50,10 @@ class _ShipmentAssignState extends State<ShipmentAssign> {
|
||||
_shipment = widget.shipment;
|
||||
_loadUsers();
|
||||
|
||||
_selectedShipmentType = _shipment!.shipmentType;
|
||||
_fromTimeEditingController.text = _shipment!.pickupTimeStart!;
|
||||
_toTimeEditingController.text = _shipment!.pickupTimeEnd!;
|
||||
_pickupDate.text = dateFormatter.format(_shipment!.pickupDate ?? now);
|
||||
_handlingFee.text = _shipment!.handlingFee != null
|
||||
? _shipment!.handlingFee.toString()
|
||||
: "0";
|
||||
_handlingFee.text = _shipment!.handlingFee.toString();
|
||||
}
|
||||
|
||||
_loadUsers() async {
|
||||
@@ -74,12 +68,7 @@ class _ShipmentAssignState extends State<ShipmentAssign> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ShipmentModel pickupModel = Provider.of<ShipmentModel>(context);
|
||||
final shipmentNumberBox = getShipmentNumberStatus(context, _shipment!);
|
||||
bool isLocalPickup = _selectedShipmentType == shipment_local_pickup;
|
||||
bool isCourierPickup = _selectedShipmentType == shipment_courier_pickup;
|
||||
bool isLocalDropoff = _selectedShipmentType == shipment_local_dropoff;
|
||||
bool isCourierDropoff = _selectedShipmentType == shipment_courier_dropoff;
|
||||
|
||||
var usersBox = LocalDropdown<User>(
|
||||
callback: (v) {
|
||||
|
||||
@@ -50,9 +50,9 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
if (widget.box != null) {
|
||||
_box = widget.box;
|
||||
_isNew = false;
|
||||
_lengthCtl.text = _box!.length != null ? _box!.length.toString() : '';
|
||||
_widthCtl.text = _box!.width != null ? _box!.width.toString() : '';
|
||||
_heightCtl.text = _box!.height != null ? _box!.height.toString() : '';
|
||||
_lengthCtl.text = _box!.length.toString();
|
||||
_widthCtl.text = _box!.width.toString();
|
||||
_heightCtl.text = _box!.height.toString();
|
||||
} else {
|
||||
var shipmentModel =
|
||||
Provider.of<DeliveryAddressModel>(context, listen: false);
|
||||
@@ -86,7 +86,7 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
|
||||
final shipmentWeightBox = DisplayText(
|
||||
labelTextKey: "shipment.box.shipment.weight",
|
||||
text: shipmentWeight == null ? "" : shipmentWeight.toStringAsFixed(0),
|
||||
text: shipmentWeight.toStringAsFixed(0),
|
||||
iconData: MaterialCommunityIcons.weight,
|
||||
);
|
||||
|
||||
@@ -212,7 +212,7 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
}
|
||||
|
||||
List<DataRow> getCargoRows(BuildContext context) {
|
||||
if (_box!.cargoTypes == null) {
|
||||
if (_box!.cargoTypes.isEmpty) {
|
||||
return [];
|
||||
}
|
||||
double total = 0;
|
||||
@@ -238,8 +238,7 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(c.weight == null ? "0" : c.weight.toStringAsFixed(2),
|
||||
style: textStyle),
|
||||
Text(c.weight.toStringAsFixed(2), style: textStyle),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.remove_circle,
|
||||
@@ -281,7 +280,7 @@ class _ShipmentBoxEditorState extends State<ShipmentBoxEditor> {
|
||||
return rows;
|
||||
}
|
||||
|
||||
_addCargo(CargoType cargo) {
|
||||
_addCargo(CargoType? cargo) {
|
||||
if (cargo == null) return;
|
||||
setState(() {
|
||||
_box!.cargoTypes.remove(cargo);
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons_null_safety/flutter_icons_null_safety.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
@@ -279,19 +279,19 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
}).toList();
|
||||
}
|
||||
|
||||
_addBox(Carton box) {
|
||||
_addBox(Carton? box) {
|
||||
if (box == null) return;
|
||||
box.cartonType = carton_from_shipments;
|
||||
_shipment!.boxes.add(box);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
_saveBox(Carton box) {
|
||||
_saveBox(Carton? box) {
|
||||
if (box == null) return;
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
_removeBox(Carton box) {
|
||||
_removeBox(Carton? box) {
|
||||
if (box == null) return;
|
||||
_shipment!.boxes.remove(box);
|
||||
setState(() {});
|
||||
|
||||
@@ -53,14 +53,7 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
TextEditingController _noOfPackageEditingController =
|
||||
new TextEditingController();
|
||||
TextEditingController _weightEditingController = new TextEditingController();
|
||||
TextEditingController _recipientNameEditingController =
|
||||
new TextEditingController();
|
||||
TextEditingController _recipientPhoneEditingController =
|
||||
new TextEditingController();
|
||||
TextEditingController _recipientAddressEditingController =
|
||||
new TextEditingController();
|
||||
TextEditingController _pickupDate = new TextEditingController();
|
||||
TextEditingController _handlingFeeController = new TextEditingController();
|
||||
|
||||
Shipment? _shipment;
|
||||
bool _isLoading = false;
|
||||
@@ -77,11 +70,8 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
_addressEditingController.text = _shipment!.address ?? "";
|
||||
_fromTimeEditingController.text = _shipment!.pickupTimeStart ?? "";
|
||||
_toTimeEditingController.text = _shipment!.pickupTimeEnd ?? "";
|
||||
_noOfPackageEditingController.text = _shipment!.numberOfPackage != null
|
||||
? _shipment!.numberOfPackage.toString()
|
||||
: "";
|
||||
_weightEditingController.text =
|
||||
_shipment!.weight != null ? _shipment!.weight.toString() : "";
|
||||
_noOfPackageEditingController.text = _shipment!.numberOfPackage.toString();
|
||||
_weightEditingController.text = _shipment!.weight.toString();
|
||||
_pickupDate.text = dateFormatter.format(_shipment!.pickupDate ?? now);
|
||||
}
|
||||
|
||||
@@ -362,7 +352,7 @@ class _ShipmentInfoState extends State<ShipmentInfo> {
|
||||
}
|
||||
|
||||
List<Widget> getBoxList(BuildContext context, List<Carton> boxes) {
|
||||
if (boxes == null) return [];
|
||||
if (boxes.isEmpty) return [];
|
||||
return boxes.asMap().entries.map((_box) {
|
||||
return Row(
|
||||
children: [
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/widgets/local_popup_menu_button.dart';
|
||||
import 'package:fcs/pages/widgets/local_popupmenu.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
|
||||
@@ -276,7 +276,7 @@ class _StaffEditorState extends State<StaffEditor> {
|
||||
this.selectedUser = _user;
|
||||
this.user = _user;
|
||||
setState(() {
|
||||
if (user.privileges != null) {
|
||||
if (user.privileges.isNotEmpty) {
|
||||
privileges.forEach((p) => user.privileges.contains(p.id)
|
||||
? p.isChecked = true
|
||||
: p.isChecked = false);
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:fcs/domain/vo/term.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/term/model/term_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:fcs/pages/widgets/progress.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
// import 'package:zefyrka/zefyrka.dart';
|
||||
// import 'package:zefyr/zefyr.dart';
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:fcs/domain/entities/setting.dart';
|
||||
import 'package:fcs/domain/vo/term.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/term/term_edit.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
@@ -24,14 +22,14 @@ class TermPage extends StatefulWidget {
|
||||
|
||||
class _TermPageState extends State<TermPage> {
|
||||
// late ZefyrController _controller;
|
||||
late FocusNode _focusNode;
|
||||
// late FocusNode _focusNode;
|
||||
// late NotusDocument document = new NotusDocument();
|
||||
bool isLoading = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_focusNode = FocusNode();
|
||||
// _focusNode = FocusNode();
|
||||
}
|
||||
|
||||
// NotusDocument _loadDocument(Setting? setting) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget badgeCounter(Widget child, int counter) {
|
||||
Widget badgeCounter(Widget child, int? counter) {
|
||||
return Container(
|
||||
width: 120,
|
||||
child: new Stack(
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class BottomUpPageRoute<T> extends PageRouteBuilder<T> {
|
||||
final Widget child;
|
||||
|
||||
BottomUpPageRoute(this.child)
|
||||
: super(
|
||||
pageBuilder: (context, animation, secondaryAnimation) => child,
|
||||
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||
var begin = Offset(0.0, 1.0);
|
||||
var end = Offset.zero;
|
||||
var curve = Curves.ease;
|
||||
|
||||
var tween =
|
||||
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
|
||||
|
||||
return SlideTransition(
|
||||
position: animation.drive(tween),
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import 'package:fcs/pages/term/term_page.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/domain/vo/delivery_address.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/delivery_address/delivery_address_row.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:fcs/domain/entities/discount.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'local_text.dart';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class InputDate extends StatelessWidget {
|
||||
final String labelTextKey;
|
||||
final IconData iconData;
|
||||
final String? labelTextKey;
|
||||
final IconData? iconData;
|
||||
final TextEditingController controller;
|
||||
final FormFieldValidator<String>? validator;
|
||||
final int maxLines;
|
||||
@@ -44,7 +43,7 @@ class InputDate extends StatelessWidget {
|
||||
var dateFormatter = new DateFormat(dateFormatString);
|
||||
FocusScope.of(context).unfocus();
|
||||
var initialDate = DateTime.now();
|
||||
if (controller != null) {
|
||||
if (controller.text != "") {
|
||||
try {
|
||||
initialDate = dateFormatter.parse(controller.text);
|
||||
} catch (e) {} // ignore error
|
||||
@@ -55,7 +54,7 @@ class InputDate extends StatelessWidget {
|
||||
lastDate: DateTime(2025),
|
||||
initialDate: initialDate,
|
||||
);
|
||||
if (d != null && controller != null) {
|
||||
if (d != null && controller.text != "") {
|
||||
controller.text = dateFormatter.format(d);
|
||||
}
|
||||
},
|
||||
@@ -72,7 +71,7 @@ class InputDate extends StatelessWidget {
|
||||
),
|
||||
labelText: labelTextKey == null
|
||||
? null
|
||||
: AppTranslations.of(context)!.text(labelTextKey),
|
||||
: AppTranslations.of(context)!.text(labelTextKey!),
|
||||
labelStyle: languageModel.isEng
|
||||
? newLabelStyle(color: Colors.black54, fontSize: 20)
|
||||
: newLabelStyleMM(color: Colors.black54, fontSize: 20),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'img_url.dart';
|
||||
@@ -28,7 +27,7 @@ Widget labeledText(BuildContext context, String text, String label,
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
// alignment: number ? Alignment.topRight : null,
|
||||
child: Text(
|
||||
text == null ? "" : text,
|
||||
text,
|
||||
style: textStyle,
|
||||
maxLines: 3,
|
||||
),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'callbacks.dart';
|
||||
|
||||
@@ -122,7 +122,6 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
||||
|
||||
bool _needHighlight() {
|
||||
popmenus.forEach((e) {
|
||||
if (e == null) return;
|
||||
if (e.selected && e.highlight) return;
|
||||
});
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LocalRadioButtons<T> extends StatelessWidget {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LocalTitle extends StatelessWidget {
|
||||
|
||||
@@ -15,7 +15,7 @@ class MultiImgController {
|
||||
fileContainers = [];
|
||||
}
|
||||
|
||||
set setImageUrls(List<String> imageUrls) {
|
||||
set setImageUrls(List<String>? imageUrls) {
|
||||
if (imageUrls == null) {
|
||||
return;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class MultiImgController {
|
||||
}
|
||||
}
|
||||
|
||||
set setImageFiles(List<File> imageFiles) {
|
||||
set setImageFiles(List<File>? imageFiles) {
|
||||
if (imageFiles == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// ignore_for_file: unnecessary_null_comparison, dead_code
|
||||
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// Signature for [MyDataColumn.onSort] callback.
|
||||
typedef MyDataColumnSortCallback = void Function(
|
||||
@@ -13,7 +13,7 @@ typedef MyDataColumnSortCallback = void Function(
|
||||
///
|
||||
/// One column configuration must be provided for each column to
|
||||
/// display in the table. The list of [MyDataColumn] objects is passed
|
||||
/// as the `columns` argument to the [new MyDataTable] constructor.
|
||||
/// as the `columns` argument to the [MyDataTable.new] constructor.
|
||||
@immutable
|
||||
class MyDataColumn {
|
||||
/// Creates the configuration for a column of a [MyDataTable].
|
||||
@@ -62,7 +62,7 @@ class MyDataColumn {
|
||||
///
|
||||
/// One row configuration must be provided for each row to
|
||||
/// display in the table. The list of [MyDataRow] objects is passed
|
||||
/// as the `rows` argument to the [new MyDataTable] constructor.
|
||||
/// as the `rows` argument to the [MyDataTable.new] constructor.
|
||||
///
|
||||
/// The data for this row of the table is provided in the [cells]
|
||||
/// property of the [MyDataRow] object.
|
||||
@@ -137,7 +137,7 @@ class MyDataRow {
|
||||
/// The data for a cell of a [MyDataTable].
|
||||
///
|
||||
/// One list of [MyDataCell] objects must be provided for each [MyDataRow]
|
||||
/// in the [MyDataTable], in the [new MyDataRow] constructor's `cells`
|
||||
/// in the [MyDataTable], in the [MyDataRow.new] constructor's `cells`
|
||||
/// argument.
|
||||
@immutable
|
||||
class MyDataCell {
|
||||
@@ -314,19 +314,18 @@ class MyDataTable extends StatelessWidget {
|
||||
this.sortColumnIndex,
|
||||
this.sortAscending = true,
|
||||
this.onSelectAll,
|
||||
this.MyDataRowHeight = kMinInteractiveDimension,
|
||||
this.myDataRowHeight = kMinInteractiveDimension,
|
||||
this.headingRowHeight = 56.0,
|
||||
this.horizontalMargin = 24.0,
|
||||
this.columnSpacing = 56.0,
|
||||
this.oddLine,
|
||||
this.evenLine,
|
||||
required this.rows,
|
||||
}) : assert(columns != null),
|
||||
assert(columns.isNotEmpty),
|
||||
}) : assert(columns.isNotEmpty),
|
||||
assert(sortColumnIndex == null ||
|
||||
(sortColumnIndex >= 0 && sortColumnIndex < columns.length)),
|
||||
assert(sortAscending != null),
|
||||
assert(MyDataRowHeight != null),
|
||||
assert(myDataRowHeight != null),
|
||||
assert(headingRowHeight != null),
|
||||
assert(horizontalMargin != null),
|
||||
assert(columnSpacing != null),
|
||||
@@ -382,7 +381,7 @@ class MyDataTable extends StatelessWidget {
|
||||
///
|
||||
/// This value defaults to kMinInteractiveDimension to adhere to the Material
|
||||
/// Design specifications.
|
||||
final double MyDataRowHeight;
|
||||
final double myDataRowHeight;
|
||||
|
||||
/// The height of the heading row.
|
||||
///
|
||||
@@ -567,7 +566,7 @@ class MyDataTable extends StatelessWidget {
|
||||
}
|
||||
label = Container(
|
||||
padding: padding,
|
||||
height: MyDataRowHeight,
|
||||
height: myDataRowHeight,
|
||||
alignment: (numeric ?? false)
|
||||
? Alignment.centerRight
|
||||
: AlignmentDirectional.centerStart,
|
||||
@@ -605,7 +604,6 @@ class MyDataTable extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
assert(!_debugInteractive || debugCheckHasMaterial(context));
|
||||
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final BoxDecoration _kSelectedDecoration = BoxDecoration(
|
||||
border: Border(bottom: Divider.createBorderSide(context, width: 1.0)),
|
||||
// The backgroundColor has to be transparent so you can see the ink on the material
|
||||
@@ -618,7 +616,6 @@ class MyDataTable extends StatelessWidget {
|
||||
);
|
||||
|
||||
final bool showCheckboxColumn = false;
|
||||
final bool allChecked = false;
|
||||
|
||||
final List<TableColumnWidth> tableColumns = (columns.length +
|
||||
(showCheckboxColumn ? 1 : 0)) as List<TableColumnWidth>;
|
||||
@@ -641,7 +638,7 @@ class MyDataTable extends StatelessWidget {
|
||||
|
||||
int rowIndex;
|
||||
|
||||
int displayColumnIndex = 0;
|
||||
int displayColumnIndex = 0;
|
||||
// if (showCheckboxColumn) {
|
||||
// tableColumns[0] = FixedColumnWidth(
|
||||
// horizontalMargin + Checkbox.width + horizontalMargin / 2.0);
|
||||
@@ -696,7 +693,7 @@ class MyDataTable extends StatelessWidget {
|
||||
} else {
|
||||
tableColumns[displayColumnIndex] = const IntrinsicColumnWidth();
|
||||
}
|
||||
tableRows[0].children![displayColumnIndex] = _buildHeadingCell(
|
||||
tableRows[0].children[displayColumnIndex] = _buildHeadingCell(
|
||||
context: context,
|
||||
padding: padding,
|
||||
label: column.label,
|
||||
@@ -712,7 +709,7 @@ class MyDataTable extends StatelessWidget {
|
||||
rowIndex = 1;
|
||||
for (MyDataRow row in rows) {
|
||||
final MyDataCell cell = row.cells[MyDataColumnIndex];
|
||||
tableRows[rowIndex].children?[displayColumnIndex] = _buildMyDataCell(
|
||||
tableRows[rowIndex].children[displayColumnIndex] = _buildMyDataCell(
|
||||
context: context,
|
||||
padding: padding,
|
||||
label: cell.child,
|
||||
@@ -780,13 +777,13 @@ class TableRowInkWell extends InkResponse {
|
||||
parentBox.applyPaintTransform(cell, transform);
|
||||
assert(table == cell.parent);
|
||||
cell = parentBox;
|
||||
table = table?.parent;
|
||||
table = table.parent;
|
||||
}
|
||||
if (table is RenderTable) {
|
||||
final TableCellParentData cellParentData =
|
||||
cell.parentData as TableCellParentData;
|
||||
assert(cellParentData.y != null);
|
||||
final Rect rect = table .getRowBox(cellParentData.y!);
|
||||
final Rect rect = table.getRowBox(cellParentData.y!);
|
||||
// The rect is in the table's coordinate space. We need to change it to the
|
||||
// TableRowInkWell's coordinate space.
|
||||
table.applyPaintTransform(cell, transform);
|
||||
|
||||
@@ -13,8 +13,7 @@ class NumberCell extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Text(
|
||||
this.number == null ? '0' : numberFormatter.format(this.number),
|
||||
return new Text(numberFormatter.format(this.number),
|
||||
style: textStyle == null ? theme.textStyle : textStyle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:progress/progress.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
|
||||
class LocalProgress extends Progress {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:fcs/domain/constants.dart';
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/domain/vo/shipment_status.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
typedef BtnCallback();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/widgets/local_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'callbacks.dart';
|
||||
|
||||
Reference in New Issue
Block a user