|
|
|
@ -1,8 +1,10 @@
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:flutter/material.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 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
import 'package:map_launcher/map_launcher.dart';
|
|
|
|
|
|
|
|
import 'dart:io' show Platform;
|
|
|
|
|
|
|
|
|
|
|
|
class AvailabilityInfo extends StatelessWidget {
|
|
|
|
class AvailabilityInfo extends StatelessWidget {
|
|
|
|
final ProductDetailViewModel previousModel;
|
|
|
|
final ProductDetailViewModel previousModel;
|
|
|
|
@ -54,15 +56,19 @@ class AvailabilityInfo extends StatelessWidget {
|
|
|
|
icon: Icon(Icons.location_on),
|
|
|
|
icon: Icon(Icons.location_on),
|
|
|
|
color: Colors.red,
|
|
|
|
color: Colors.red,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
MapLauncher.showMarker(
|
|
|
|
if (Platform.isIOS) { MapLauncher.showMarker(
|
|
|
|
mapType: MapType.googleGo,
|
|
|
|
mapType: MapType.apple,
|
|
|
|
coords: Coords(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude)),
|
|
|
|
coords: Coords(double.parse(previousModel.productLocationService[index].latitude),
|
|
|
|
|
|
|
|
double.parse(previousModel.productLocationService[index].longitude)),
|
|
|
|
|
|
|
|
title: previousModel.productLocationService[index].locationDescription,);
|
|
|
|
|
|
|
|
} else { MapLauncher.showMarker(
|
|
|
|
|
|
|
|
mapType: MapType.google,
|
|
|
|
|
|
|
|
coords: Coords(double.parse(previousModel.productLocationService[index].latitude),
|
|
|
|
|
|
|
|
double.parse(previousModel.productLocationService[index].longitude)),
|
|
|
|
title: previousModel.productLocationService[index].locationDescription,
|
|
|
|
title: previousModel.productLocationService[index].locationDescription,
|
|
|
|
// description: location.locationName,
|
|
|
|
// description: location.locationName,
|
|
|
|
).then((value) {}).catchError((err) {
|
|
|
|
); }
|
|
|
|
print(err);
|
|
|
|
// MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
|
|
|
|
});
|
|
|
|
|
|
|
|
// MapLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|