call and location button functionality

logut
hussam al-habibeh 5 years ago
parent 259cc3810a
commit 99ad3f1a4a

@ -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});

@ -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;

@ -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: <Widget>[
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 {
);
}
}

@ -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: <Widget>[
Text(
TranslationBase
.of(context)
.payment,
TranslationBase.of(context).payment,
),
SizedBox(
width: 170,
@ -130,9 +132,7 @@ class CustomerBrief extends StatelessWidget {
Row(
children: <Widget>[
Text(
TranslationBase
.of(context)
.delivryTime,
TranslationBase.of(context).delivryTime,
),
SizedBox(
width: 50,
@ -149,4 +149,4 @@ class CustomerBrief extends StatelessWidget {
),
);
}
}
}

@ -67,6 +67,8 @@ dependencies:
# Qr code Scanner
barcode_scan: ^3.0.1
#mape
map_launcher: ^0.12.0

Loading…
Cancel
Save