update carton info
This commit is contained in:
@@ -3,7 +3,7 @@ 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/helpers/theme.dart';
|
||||
import 'package:fcs/pages/carton/carton_image_upload.dart';
|
||||
import 'package:fcs/pages/carton/carton_image_upload_editor.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/widgets/display_text.dart';
|
||||
@@ -18,6 +18,7 @@ import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../widgets/local_button.dart';
|
||||
import 'carton_package_editor.dart';
|
||||
import 'mix_carton/mix_carton_editor.dart';
|
||||
import 'model/carton_model.dart';
|
||||
|
||||
@@ -297,7 +298,7 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => CartonImageUpload(box: _carton)),
|
||||
builder: (context) => CartonImageUploadEditor(box: _carton)),
|
||||
);
|
||||
},
|
||||
child: const Text('Upload Images'),
|
||||
@@ -404,28 +405,25 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
}
|
||||
|
||||
_gotoEditor() async {
|
||||
if (_carton.cartonType == carton_mix_carton) {
|
||||
bool? updated = await Navigator.push<bool>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => MixCartonEditor(carton: _carton)),
|
||||
);
|
||||
bool? updated = _carton.cartonType == carton_mix_carton
|
||||
? await Navigator.push<bool>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => MixCartonEditor(carton: _carton)),
|
||||
)
|
||||
: await Navigator.push<bool>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => CartonPackageEditor(carton: _carton)),
|
||||
);
|
||||
|
||||
if (updated ?? false) {
|
||||
Carton? c =
|
||||
await context.read<CartonModel>().getCarton(widget.carton.id ?? "");
|
||||
if (c == null) return;
|
||||
_carton = c;
|
||||
_init();
|
||||
}
|
||||
// bool? updated = await Navigator.push<bool>(
|
||||
// context,
|
||||
// CupertinoPageRoute(
|
||||
// builder: (context) => MixCartonEditor(carton: _carton)),
|
||||
// );
|
||||
// if (updated ?? false) {
|
||||
// // var cartonModel = Provider.of<CartonModel>(context, listen: false);
|
||||
// // var c = await cartonModel.getCarton(widget.box.id ?? "");
|
||||
// // setState(() {
|
||||
// // _box = c;
|
||||
// // _loadPackages();
|
||||
// // _loadMixCartons();
|
||||
// // _updateBoxData();
|
||||
// // });
|
||||
// }
|
||||
}
|
||||
|
||||
_delete() {
|
||||
|
||||
Reference in New Issue
Block a user