fix shipment detail click in noti
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:fcs/domain/constants.dart';
|
||||
import 'package:fcs/domain/entities/package.dart';
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/domain/entities/user.dart';
|
||||
import 'package:fcs/domain/vo/message.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
@@ -7,11 +8,12 @@ import 'package:fcs/pages/chat/model/message_model.dart';
|
||||
import 'package:fcs/pages/customer/customer_editor.dart';
|
||||
import 'package:fcs/pages/customer/model/customer_model.dart';
|
||||
import 'package:fcs/pages/main/model/main_model.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/package/model/package_model.dart';
|
||||
import 'package:fcs/pages/package/package_info.dart';
|
||||
import 'package:fcs/pages/profile/profile_page.dart';
|
||||
import 'package:fcs/pages/main/util.dart';
|
||||
import 'package:fcs/pages/widgets/bottom_up_page_route.dart';
|
||||
import 'package:fcs/pages/shipment/model/shipment_model.dart';
|
||||
import 'package:fcs/pages/shipment/shipment_info.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@@ -195,5 +197,20 @@ class MessageDetail extends StatelessWidget {
|
||||
builder: (context) => CustomerEditor(customer: user)));
|
||||
}
|
||||
}
|
||||
if (message.messageType == message_type_shipment &&
|
||||
message.messageID != null &&
|
||||
message.messageID != "") {
|
||||
ShipmentModel shipmentModel =
|
||||
Provider.of<ShipmentModel>(context, listen: false);
|
||||
Shipment s = await shipmentModel.getShipment(message.messageID);
|
||||
if (s == null) return;
|
||||
await Navigator.push<bool>(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) => ShipmentInfo(
|
||||
shipment: s,
|
||||
isCustomer: true,
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user