fix issues

merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
parent 1539945a29
commit ffc2f2b4bb

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel;
@ -49,7 +51,9 @@ class AvailabilityInfo extends StatelessWidget {
child: IconButton(
icon: Icon(Icons.location_on),
color: Colors.red,
onPressed: () {},
onPressed: () {
MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].latitude), previousModel.productLocationService[index].locationDescription);
},
),
),
Expanded(
@ -57,7 +61,9 @@ class AvailabilityInfo extends StatelessWidget {
child: IconButton(
icon: Icon(Icons.phone),
color: Colors.red,
onPressed: () {},
onPressed: () {
launch("tel://" + previousModel.productLocationService[index].phoneNumber);
},
),
),
],

@ -288,10 +288,20 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
product: widget.product,
previousModel: model,
)
: isAvailability
: isAvailability && widget.product.stockAvailability != "Out of stock"
? AvailabilityInfo(
previousModel: model
)
: isAvailability && widget.product.stockAvailability == "Out of stock"
? Container(
// padding: EdgeInsets.all(15),
padding: EdgeInsets.fromLTRB(15,15,15,20),
margin: EdgeInsets.only(bottom: 20),
alignment: Alignment.center,
child: Text(
TranslationBase.of(context).noLocationAvailable,
),
)
: Container(),
],
),

@ -32,9 +32,11 @@ class ReviewsInfo extends StatelessWidget {
children: [
Expanded(
child: Container(
child: Text(
previousModel.productDetailService[0].reviews[index].customer.firstName.toString() + " "
+ previousModel.productDetailService[0].reviews[index].customer.lastName.toString(),
child: Text(previousModel.productDetailService[0].reviews[index].customer.firstName != null
&& previousModel.productDetailService[0].reviews[index].customer.firstName != null
? previousModel.productDetailService[0].reviews[index].customer.firstName.toString() + " "
+ previousModel.productDetailService[0].reviews[index].customer.lastName.toString()
:"",
// previousModel.productDetailService[0]
// .reviews[index].customerId
// .toString(),

Loading…
Cancel
Save