showQuickProfilePopup function

void showQuickProfilePopup({
  1. required dynamic context,
  2. required dynamic chatTap(),
  3. required dynamic callTap(),
  4. required dynamic videoTap(),
  5. required dynamic infoTap(),
  6. required Rx<Profile> profile,
})

Implementation

void showQuickProfilePopup(
    {required context,
    required Function() chatTap,
    required Function() callTap,
    required Function() videoTap,
    required Function() infoTap,
    required Rx<Profile> profile}) {
  showDialog(context: context, builder: (BuildContext context) {
    return Obx(() {
      return Dialog(
        shape: const RoundedRectangleBorder(
            borderRadius: BorderRadius.all(Radius.circular(20.0))),
        child: SizedBox(
          width: MediaQuery.of(context).size.width * 0.7,
          height: 300,
          child: Column(
            children: [
              Expanded(
                child: InkWell(
                  onTap: () {
                    mirrorFlyLog('image click', 'true');
                    debugPrint(
                        "quick profile click--> ${profile.toJson().toString()}");
                    if (profile.value.image!.isNotEmpty &&
                        !(profile.value.isBlockedMe.checkNull() ||
                            profile.value.isAdminBlocked.checkNull()) &&
                        !( //!profile.value.isItSavedContact.checkNull() || //This is commented because Android side received as true and iOS side false
                            profile.value.isDeletedContact())) {
                      Navigator.pop(context);
                      Navigator.push(context, MaterialPageRoute(builder: (con)=>ImageViewView(imageName: getName(profile.value),imageUrl: profile.value.image,)));
                      /*Get.back();
                      Get.toNamed(Routes.imageView, arguments: {
                        'imageName': getName(profile.value),
                        'imageUrl': profile.value.image.checkNull()
                      });*/
                    }
                  },
                  child: Stack(
                    fit: StackFit.expand,
                    children: [
                      ClipRRect(
                          borderRadius: const BorderRadius.only(
                              topLeft: Radius.circular(20),
                              topRight: Radius.circular(20)),
                          child: ImageNetwork(
                            url: profile.value.image.toString(),
                            width: MediaQuery.of(context).size.width * 0.7,
                            height: 250,
                            clipOval: false,
                            errorWidget: profile.value.isGroupProfile!
                                ? Image.asset(
                              groupImg,
                              package: package,
                              height: 250,
                              width: MediaQuery.of(context).size.width *
                                  0.72,
                              fit: BoxFit.cover,
                            )
                                : ProfileTextImage(
                              text: getName(profile.value),
                              fontSize: 75,
                              radius: 0,
                            ),
                            isGroup: profile.value.isGroupProfile.checkNull(),
                            blocked: profile.value.isBlockedMe.checkNull() ||
                                profile.value.isAdminBlocked.checkNull(),
                            unknown:
                            (!profile.value.isItSavedContact.checkNull() ||
                                profile.value.isDeletedContact()),
                          )),
                      Padding(
                        padding: const EdgeInsets.symmetric(
                            vertical: 10.0, horizontal: 20),
                        child: Text(
                          profile.value.isGroupProfile!
                              ? profile.value.name.checkNull()
                              : MirrorflyUikit.instance.isTrialLicenceKey
                              ? profile.value.mobileNumber.checkNull()
                              : profile.value.nickName.checkNull(),
                          style: const TextStyle(color: Colors.white),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              SizedBox(
                height: 50,
                child: Row(
                  // mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Expanded(
                      child: InkWell(
                        onTap: chatTap,
                        child: SvgPicture.asset(
                          quickMessage,
                          package: package,
                          fit: BoxFit.contain,
                          width: 30,
                          height: 30,
                        ),
                      ),
                    ),
                    !profile.value.isGroupProfile.checkNull()
                        ? Expanded(
                      child: InkWell(
                        onTap: callTap,
                        child: SvgPicture.asset(
                          quickCall,
                          package: package,
                          fit: BoxFit.contain,
                        ),
                      ),
                    )
                        : const SizedBox.shrink(),
                    !profile.value.isGroupProfile.checkNull()
                        ? Expanded(
                      child: InkWell(
                        onTap: videoTap,
                        child: SvgPicture.asset(
                          quickVideo,
                          package: package,
                          fit: BoxFit.contain,
                        ),
                      ),
                    )
                        : const SizedBox.shrink(),
                    Expanded(
                      child: InkWell(
                        onTap: infoTap,
                        child: SvgPicture.asset(
                          quickInfo,
                          package: package,
                          fit: BoxFit.contain,
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      );
    });
  },
  );
}