showNotificationDialog static method

dynamic showNotificationDialog(
  1. BuildContext context,
  2. RemoteNotification notification
)

Implementation

static showNotificationDialog(
    BuildContext context, RemoteNotification notification) {
  showDialog(
      context: context,
      barrierDismissible: false,
      builder: (dialogContext) => AlertDialog(
            title: Text(notification.title!),
            content: SizedBox(
                height: 300,
                width: double.infinity,
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.start,
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    const Row(
                      children: [
                        CircleAvatar(
                          radius: 22,
                          backgroundColor: Color.fromARGB(255, 13, 52, 84),
                          child: TextRF(
                            "S",
                            color: Colors.white,
                          ),
                        ),
                        SizedBox(
                          width: 10,
                        ),
                        Column(
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            TextRF("Sutharshan"),
                            TextRF(
                              "3 min away",
                              size: 14,
                            )
                          ],
                        ),
                      ],
                    ),
                    const SizedBox(
                      height: 30,
                    ),
                    const TextRF("Pickup From"),
                    const TextRF(
                      "Gulshan-1",
                      size: 16,
                    ),
                    const Spacer(),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceAround,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: [
                        ElevatedButton(
                          style: ButtonStyle(
                            backgroundColor:
                                WidgetStateProperty.all<Color>(Colors.green),
                            shape: WidgetStateProperty.all<
                                RoundedRectangleBorder>(
                              RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(0),
                              ),
                            ),
                          ),
                          child: const TextRF(
                            'ACCEPT',
                            color: Colors.white,
                          ),
                          onPressed: () {
                            // SelectVahileControllerRF()
                            //     .updateCurrentLocation();
                            // Navigator.of(dialogContext).pop();
                          },
                        ),
                        ElevatedButton(
                          style: ButtonStyle(
                            backgroundColor:
                                WidgetStateProperty.all<Color>(Colors.red),
                            shape: WidgetStateProperty.all<
                                RoundedRectangleBorder>(
                              RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(0),
                              ),
                            ),
                          ),
                          child: const TextRF(
                            'REJECT',
                            color: Colors.white,
                          ),
                          onPressed: () {
                            Navigator.of(dialogContext).pop();
                          },
                        ),
                      ],
                    )
                  ],
                )),
          ));
}