Merge branch 'master' of tzw/fcs into master
This commit is contained in:
@@ -28,6 +28,7 @@ class _CartonListState extends State<CartonList> {
|
|||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
List<FcsShipment> _shipments = [];
|
List<FcsShipment> _shipments = [];
|
||||||
FcsShipment? _selectedShipment;
|
FcsShipment? _selectedShipment;
|
||||||
|
bool _down = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -120,105 +121,151 @@ class _CartonListState extends State<CartonList> {
|
|||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
shipmentFilterBox,
|
AnimatedSwitcher(
|
||||||
Wrap(
|
duration: const Duration(milliseconds: 300),
|
||||||
runSpacing: 8,
|
transitionBuilder: (Widget child, Animation<double> animation) =>
|
||||||
children: [
|
FadeTransition(
|
||||||
cartonModel.filterByConsingee != null
|
opacity: animation,
|
||||||
? Padding(
|
child: SizeTransition(
|
||||||
padding: const EdgeInsets.only(left: 15),
|
child: child,
|
||||||
child: Row(
|
sizeFactor: animation,
|
||||||
|
axis: Axis.vertical,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: _down
|
||||||
|
? Column(
|
||||||
|
children: [
|
||||||
|
shipmentFilterBox,
|
||||||
|
Wrap(
|
||||||
|
runSpacing: 8,
|
||||||
children: [
|
children: [
|
||||||
Wrap(
|
cartonModel.filterByConsingee != null
|
||||||
children: [
|
? Padding(
|
||||||
Row(
|
padding: const EdgeInsets.only(left: 15),
|
||||||
children: [
|
child: Row(
|
||||||
const Text("Consignee: ",
|
children: [
|
||||||
style: TextStyle(
|
Wrap(
|
||||||
fontSize: 12, color: Colors.grey)),
|
children: [
|
||||||
Text(
|
Row(
|
||||||
cartonModel.filterByConsingee!.name ??
|
children: [
|
||||||
"",
|
const Text("Consignee: ",
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12, color: Colors.black)),
|
fontSize: 12,
|
||||||
const SizedBox(width: 3),
|
color: Colors.grey)),
|
||||||
Text(
|
Text(
|
||||||
cartonModel.filterByConsingee!.fcsID ??
|
cartonModel
|
||||||
"",
|
.filterByConsingee!
|
||||||
style: const TextStyle(
|
.name ??
|
||||||
fontSize: 12, color: labelColor)),
|
"",
|
||||||
],
|
style: const TextStyle(
|
||||||
)
|
fontSize: 12,
|
||||||
],
|
color: Colors.black)),
|
||||||
),
|
const SizedBox(width: 3),
|
||||||
Padding(
|
Text(
|
||||||
padding: const EdgeInsets.only(left: 5),
|
cartonModel
|
||||||
child: InkResponse(
|
.filterByConsingee!
|
||||||
radius: 30,
|
.fcsID ??
|
||||||
onTap: () {
|
"",
|
||||||
context
|
style: const TextStyle(
|
||||||
.read<CartonModel>()
|
fontSize: 12,
|
||||||
.clearFilterConsignee();
|
color: labelColor)),
|
||||||
},
|
],
|
||||||
child: const Icon(AntDesign.closecircleo,
|
)
|
||||||
size: 20, color: dangerColor),
|
],
|
||||||
),
|
),
|
||||||
)
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(left: 5),
|
||||||
|
child: InkResponse(
|
||||||
|
radius: 30,
|
||||||
|
onTap: () {
|
||||||
|
context
|
||||||
|
.read<CartonModel>()
|
||||||
|
.clearFilterConsignee();
|
||||||
|
},
|
||||||
|
child: const Icon(
|
||||||
|
AntDesign.closecircleo,
|
||||||
|
size: 20,
|
||||||
|
color: dangerColor),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
cartonModel.filterBySender != null
|
||||||
|
? Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 15),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Wrap(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const Text("Sender: ",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.grey)),
|
||||||
|
Text(
|
||||||
|
cartonModel.filterBySender!
|
||||||
|
.name ??
|
||||||
|
"",
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black)),
|
||||||
|
const SizedBox(width: 3),
|
||||||
|
Text(
|
||||||
|
cartonModel.filterBySender!
|
||||||
|
.fcsID ??
|
||||||
|
"",
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: labelColor)),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(left: 5),
|
||||||
|
child: InkResponse(
|
||||||
|
radius: 30,
|
||||||
|
onTap: () {
|
||||||
|
context
|
||||||
|
.read<CartonModel>()
|
||||||
|
.clearFilterSender();
|
||||||
|
},
|
||||||
|
child: const Icon(
|
||||||
|
AntDesign.closecircleo,
|
||||||
|
size: 20,
|
||||||
|
color: dangerColor),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
Divider(color: Colors.grey.shade400),
|
||||||
: const SizedBox(),
|
],
|
||||||
cartonModel.filterBySender != null
|
)
|
||||||
? Padding(
|
: const SizedBox(),
|
||||||
padding: const EdgeInsets.only(left: 15),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Wrap(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
const Text("Sender: ",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 12, color: Colors.grey)),
|
|
||||||
Text(cartonModel.filterBySender!.name ?? "",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 12, color: Colors.black)),
|
|
||||||
const SizedBox(width: 3),
|
|
||||||
Text(
|
|
||||||
cartonModel.filterBySender!.fcsID ?? "",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 12, color: labelColor)),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 5),
|
|
||||||
child: InkResponse(
|
|
||||||
radius: 30,
|
|
||||||
onTap: () {
|
|
||||||
context
|
|
||||||
.read<CartonModel>()
|
|
||||||
.clearFilterSender();
|
|
||||||
},
|
|
||||||
child: const Icon(AntDesign.closecircleo,
|
|
||||||
size: 20, color: dangerColor),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: const SizedBox(),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
Divider(color: Colors.grey.shade400),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: cartonModel.getBoxes == null
|
child: cartonModel.getBoxes == null
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: PaginatorListView<Carton>(
|
: PaginatorListView<Carton>(
|
||||||
paginatorListener: cartonModel.getBoxes!,
|
paginatorListener: cartonModel.getBoxes!,
|
||||||
rowBuilder: (p) => CartonListRow(box: p),
|
rowBuilder: (p) => CartonListRow(box: p),
|
||||||
color: primaryColor),
|
color: primaryColor,
|
||||||
|
onScroll: ((down) {
|
||||||
|
if (_down == down) return;
|
||||||
|
setState(() {
|
||||||
|
_down = down;
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -37,22 +37,22 @@ class DeliveryAddressRow extends StatelessWidget {
|
|||||||
deliveryAddress.addressLine1!=""
|
deliveryAddress.addressLine1!=""
|
||||||
?
|
?
|
||||||
line(context, deliveryAddress.addressLine1,
|
line(context, deliveryAddress.addressLine1,
|
||||||
iconData: Icons.location_on,color: Colors.black, fontSize: 16):SizedBox(),
|
iconData: Icons.location_on,color: Colors.grey, fontSize: 16):SizedBox(),
|
||||||
deliveryAddress.addressLine2!=""
|
deliveryAddress.addressLine2!=""
|
||||||
?
|
?
|
||||||
line(
|
line(
|
||||||
context,
|
context,
|
||||||
deliveryAddress.addressLine2,color: Colors.black, fontSize: 16
|
deliveryAddress.addressLine2,color: Colors.grey, fontSize: 16
|
||||||
):SizedBox(),
|
):SizedBox(),
|
||||||
deliveryAddress.city!=""
|
deliveryAddress.city!=""
|
||||||
?
|
?
|
||||||
line(
|
line(
|
||||||
context,
|
context,
|
||||||
deliveryAddress.city,color: Colors.black, fontSize: 16
|
deliveryAddress.city,color: Colors.grey, fontSize: 16
|
||||||
):SizedBox(),
|
):SizedBox(),
|
||||||
deliveryAddress.state!=""
|
deliveryAddress.state!=""
|
||||||
?
|
?
|
||||||
line(context, deliveryAddress.state,color: Colors.black, fontSize: 16):SizedBox(),
|
line(context, deliveryAddress.state,color: Colors.grey, fontSize: 16):SizedBox(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -69,7 +69,7 @@ class DeliveryAddressRow extends StatelessWidget {
|
|||||||
? SizedBox(width: 40)
|
? SizedBox(width: 40)
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.only(left: 8.0, right: 8),
|
padding: const EdgeInsets.only(left: 8.0, right: 8),
|
||||||
child: Icon(iconData, color: Colors.black38),
|
child: Icon(iconData, color: Colors.grey),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
child: TextLocalStyle(
|
child: TextLocalStyle(
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class _FcsShipmentListState extends State<FcsShipmentList> {
|
|||||||
value: choice,
|
value: choice,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(child: Text("${choice.text}")),
|
Flexible(child: Text("${choice.text}",style: TextStyle(color: Colors.black))),
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
import 'package:fcs/pages/main/util.dart';
|
||||||
import 'package:fcs/pages/widgets/local_button.dart';
|
import 'package:fcs/pages/widgets/local_button.dart';
|
||||||
import 'package:fcs/pages/widgets/local_text.dart';
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
import 'package:fcs/pages/widgets/progress.dart';
|
import 'package:fcs/pages/widgets/progress.dart';
|
||||||
@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
import 'package:pin_input_text_field/pin_input_text_field.dart';
|
||||||
|
|
||||||
class PinLoginPage extends StatefulWidget {
|
class PinLoginPage extends StatefulWidget {
|
||||||
|
//final User user;
|
||||||
const PinLoginPage({super.key});
|
const PinLoginPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -16,12 +17,17 @@ class PinLoginPage extends StatefulWidget {
|
|||||||
class _PinLoginPageState extends State<PinLoginPage> {
|
class _PinLoginPageState extends State<PinLoginPage> {
|
||||||
bool _isLoading = false;
|
bool _isLoading = false;
|
||||||
late String pin;
|
late String pin;
|
||||||
|
//late User _user;
|
||||||
TextEditingController _fcsIdCtl = new TextEditingController();
|
TextEditingController _fcsIdCtl = new TextEditingController();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
pin = "";
|
//_user=widget.user;
|
||||||
|
//pin = _user.pinDigit ?? "";
|
||||||
super.initState();
|
super.initState();
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -59,18 +65,19 @@ class _PinLoginPageState extends State<PinLoginPage> {
|
|||||||
padding: EdgeInsets.only(top: 30),
|
padding: EdgeInsets.only(top: 30),
|
||||||
child: LocalButton(
|
child: LocalButton(
|
||||||
textKey: "welcome.pinlogin",
|
textKey: "welcome.pinlogin",
|
||||||
callBack: () {},
|
callBack: _login,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return LocalProgress(
|
return LocalProgress(
|
||||||
inAsyncCall: _isLoading,
|
inAsyncCall: _isLoading,
|
||||||
child: new Scaffold(
|
child: new Scaffold(
|
||||||
appBar: LocalAppBar(
|
// appBar: LocalAppBar(
|
||||||
backgroundColor: null,
|
// backgroundColor: primaryColor,
|
||||||
arrowColor: Colors.black,
|
|
||||||
),
|
|
||||||
|
// ),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
padding: EdgeInsets.only(top: 20, left: 15, right: 15, bottom: 20),
|
padding: EdgeInsets.only(top: 80, left: 15, right: 15, bottom: 20),
|
||||||
children: [
|
children: [
|
||||||
pinLoginLogo,
|
pinLoginLogo,
|
||||||
Padding(
|
Padding(
|
||||||
@@ -117,4 +124,29 @@ class _PinLoginPageState extends State<PinLoginPage> {
|
|||||||
this.pin = pin;
|
this.pin = pin;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
_login() async {
|
||||||
|
if (pin == "") {
|
||||||
|
showMsgDialog(context, "Error", "Invalid PIN");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pin.length < 6) {
|
||||||
|
showMsgDialog(context, "Error", "PIN must be 6 digits");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
_isLoading = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
Navigator.pop(context, true);
|
||||||
|
} catch (e) {
|
||||||
|
showMsgDialog(context, "Error", e.toString());
|
||||||
|
} finally {
|
||||||
|
setState(() {
|
||||||
|
_isLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,9 +107,9 @@ class _LocalPopupMenuButtonState extends State<LocalPopupMenuButton> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color:
|
color:
|
||||||
choice.enabled ? primaryColor : Colors.grey))
|
choice.enabled ? Colors.black : Colors.grey))
|
||||||
: LocalText(context, choice.textKey ?? "",
|
: LocalText(context, choice.textKey ?? "",
|
||||||
color: choice.enabled ? primaryColor : Colors.grey,
|
color: choice.enabled ? Colors.black : Colors.grey,
|
||||||
fontSize: 14),
|
fontSize: 14),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
|
|||||||
Reference in New Issue
Block a user