getLocationImage function

Widget getLocationImage(
  1. LocationChatMessage? locationChatMessage,
  2. double width,
  3. double height, {
  4. bool isSelected = false,
})

Implementation

Widget getLocationImage(
    LocationChatMessage? locationChatMessage, double width, double height,
    {bool isSelected = false}) {
  return InkWell(
      onTap: isSelected
          ? null
          : () async {
              Uri googleUrl = MessageUtils.getMapLaunchUri(
                  locationChatMessage!.latitude, locationChatMessage.longitude);
              AppUtils.launchWeb(googleUrl);
            },
      child: CachedNetworkImage(
        imageUrl: AppUtils.getMapImageUrl(
            locationChatMessage!.latitude, locationChatMessage.longitude),
        fit: BoxFit.fill,
        width: width,
        height: height,
        errorWidget: (ct, e, er) {
          return const Center(
            child: Text("Google map API_THUMP_KEY not found"),
          );
        },
      ));
}