|
|
|
|
@ -106,7 +106,8 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
|
|
|
|
|
Fluttertoast.showToast(
|
|
|
|
|
msg: _subtitle.requestCompleteSuccessfully,
|
|
|
|
|
);
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
Navigator.of(context).pop(_formModel.status);
|
|
|
|
|
setState(() { });
|
|
|
|
|
} else {
|
|
|
|
|
String errorMessage = HttpStatusManger.getStatusMessage(status: status, subtitle: _subtitle);
|
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
|
|
|
|
@ -151,7 +152,7 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
|
|
|
|
|
_settingProvider = Provider.of<SettingProvider>(context);
|
|
|
|
|
if (_gasRefillProvider == null) {
|
|
|
|
|
_gasRefillProvider = Provider.of<GasRefillProvider>(context, listen: false);
|
|
|
|
|
_gasRefillProvider.reset();
|
|
|
|
|
//_gasRefillProvider.reset();
|
|
|
|
|
}
|
|
|
|
|
if (_firstTime) {
|
|
|
|
|
if (widget.gasRefillModel != null) {
|
|
|
|
|
@ -298,27 +299,27 @@ class _RequestGasRefillState extends State<RequestGasRefill> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
if (_userProvider.user?.type == UsersTypes.normal_user || widget.gasRefillModel != null)
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
|
|
|
|
const ASubTitle("Expected Date"),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
),
|
|
|
|
|
ADateTimePicker(
|
|
|
|
|
date: _gasRefillProvider.expectedDateTime,
|
|
|
|
|
from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
onDateTimePicker: (date) {
|
|
|
|
|
_gasRefillProvider.expectedDateTime = date;
|
|
|
|
|
_formModel.expectedDate = _gasRefillProvider.expectedDateTime;
|
|
|
|
|
setState(() {});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
//const SizedBox(height: 8),
|
|
|
|
|
// if (_userProvider.user?.type == UsersTypes.normal_user || widget.gasRefillModel != null)
|
|
|
|
|
// Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
// children: [
|
|
|
|
|
// const ASubTitle("Expected Date"),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 8 * AppStyle.getScaleFactor(context),
|
|
|
|
|
// ),
|
|
|
|
|
// ADateTimePicker(
|
|
|
|
|
// date: _gasRefillProvider.expectedDateTime,
|
|
|
|
|
// from: DateTime.now().subtract(const Duration(days: 365)),
|
|
|
|
|
// to: DateTime.now().add(const Duration(days: 365)),
|
|
|
|
|
// onDateTimePicker: (date) {
|
|
|
|
|
// _gasRefillProvider.expectedDateTime = date;
|
|
|
|
|
// _formModel.expectedDate = _gasRefillProvider.expectedDateTime;
|
|
|
|
|
// setState(() {});
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// if (_userProvider.user?.type == UsersTypes.engineer)
|
|
|
|
|
// Column(
|
|
|
|
|
// children: [
|
|
|
|
|
|