diff --git a/lib/core/model/pending_orders/pending_orders_res_model.dart b/lib/core/model/pending_orders/pending_orders_res_model.dart index a5c8420..6809612 100644 --- a/lib/core/model/pending_orders/pending_orders_res_model.dart +++ b/lib/core/model/pending_orders/pending_orders_res_model.dart @@ -129,8 +129,8 @@ class PendingOrdersRes { class ItemsQuantitiesList { String itemName; - int productID; - int quantity; + var productID; + var quantity; ItemsQuantitiesList({this.itemName, this.productID, this.quantity}); diff --git a/lib/core/service/orders_service.dart b/lib/core/service/orders_service.dart index fbc4184..b5c9bd9 100644 --- a/lib/core/service/orders_service.dart +++ b/lib/core/service/orders_service.dart @@ -28,6 +28,7 @@ class OrdersService extends BaseService { response['PatientER_Delivery_GetAllOrderList'].forEach((order) { _orders.add(PendingOrdersRes.fromJson(order)); }); + var asd = ""; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index 1604d95..c0a9c1b 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -4,6 +4,9 @@ import 'package:driverapp/widgets/delivery/delivery_action_button.dart'; import 'package:driverapp/widgets/delivery/package_content.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:map_launcher/map_launcher.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; import '../../uitl/translations_delegate_base.dart'; import '../../widgets/others/app_scaffold_widget.dart'; @@ -44,9 +47,7 @@ class InformationPage extends StatelessWidget { ), Container( child: Text( - TranslationBase - .of(context) - .deliveryInfo, + TranslationBase.of(context).deliveryInfo, style: TextStyle( color: Colors.white, fontSize: 20, @@ -87,10 +88,11 @@ class InformationPage extends StatelessWidget { size: 30, color: Colors.white, ), - btnName: TranslationBase - .of(context) - .location, - btnFunction: () {}, + btnName: TranslationBase.of(context).location, + btnFunction: () { + MapsLauncher.launchCoordinates( + item.longitude, item.latitude); + }, ), delivery_info_button( btnColor: Colors.green, @@ -109,9 +111,7 @@ class InformationPage extends StatelessWidget { size: 30, color: Colors.white, ), - btnName: TranslationBase - .of(context) - .sms, + btnName: TranslationBase.of(context).sms, btnFunction: () {}, ), delivery_info_button( @@ -121,10 +121,11 @@ class InformationPage extends StatelessWidget { size: 30, color: Colors.white, ), - btnName: TranslationBase - .of(context) - .call, - btnFunction: () {}, + btnName: TranslationBase.of(context).call, + btnFunction: () { + launch( + "tel://" + item.mobileNumber.toString()); + }, ), ], ), @@ -137,9 +138,7 @@ class InformationPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase - .of(context) - .packageContent, + TranslationBase.of(context).packageContent, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20), @@ -162,7 +161,8 @@ class InformationPage extends StatelessWidget { height: 10, ), package_content( - packageName: 'Oltment for Rash unbranded 50 ml', + packageName: + 'Oltment for Rash unbranded 50 ml', packageCount: '1 tube', ), SizedBox( @@ -197,9 +197,7 @@ class InformationPage extends StatelessWidget { side: BorderSide(color: Color(0xff41bdbb)), ), child: Text( - TranslationBase - .of(context) - .clientReached, + TranslationBase.of(context).clientReached, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, @@ -207,19 +205,22 @@ class InformationPage extends StatelessWidget { ), onPressed: () { Navigator.push( - context, MaterialPageRoute( - builder: (context) => - DeliveryConfirmedPage(item))); + context, + MaterialPageRoute( + builder: (context) => + DeliveryConfirmedPage(item))); }, ), ], ), ), CustomerBrief( - itemId: item.driverID, - customerFirstName: item.firstName, - customerLastName: item.lastName, - mobileNo: item.mobileNumber + itemId: item.driverID, + customerFirstName: item.firstName, + customerLastName: item.lastName, + mobileNo: item.mobileNumber, + latitude: item.latitude, + longitude: item.longitude, ), ], ), @@ -231,8 +232,3 @@ class InformationPage extends StatelessWidget { ); } } - - - - - diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart index 7b2fce5..89edb41 100644 --- a/lib/widgets/delivery/customer_brief_card.dart +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -11,16 +11,20 @@ class CustomerBrief extends StatelessWidget { final String direction; final String totalPayment; final String deliveryTime; + final double longitude; + final double latitude; CustomerBrief( {this.itemId, - this.time, - this.customerFirstName, - this.customerLastName, - this.mobileNo, - this.direction, - this.totalPayment, - this.deliveryTime}); + this.time, + this.customerFirstName, + this.customerLastName, + this.mobileNo, + this.direction, + this.totalPayment, + this.deliveryTime, + this.longitude, + this.latitude}); @override Widget build(BuildContext context) { @@ -111,9 +115,7 @@ class CustomerBrief extends StatelessWidget { Row( children: [ Text( - TranslationBase - .of(context) - .payment, + TranslationBase.of(context).payment, ), SizedBox( width: 170, @@ -130,9 +132,7 @@ class CustomerBrief extends StatelessWidget { Row( children: [ Text( - TranslationBase - .of(context) - .delivryTime, + TranslationBase.of(context).delivryTime, ), SizedBox( width: 50, @@ -149,4 +149,4 @@ class CustomerBrief extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/pubspec.yaml b/pubspec.yaml index 358a44e..a45ddbb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -67,6 +67,8 @@ dependencies: # Qr code Scanner barcode_scan: ^3.0.1 + #mape + map_launcher: ^0.12.0