content: import 'package:flutter/material.dart';
  import 'package:get/get.dart';
  import 'package:quran_app/src/notifications/notification_controller.dart';
  import 'package:quran_app/src/settings/theme/app_theme.dart';
  
  class NotificationPage extends StatelessWidget {
    NotificationPage({Key? key}) : super(key: key);
  
    final notificationC = Get.put(NotificationController());
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text(
            "Notification",
            style: AppTextStyle.bigTitle,
          ),
          centerTitle: true,
          elevation: 1,
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text(
              'App for capturing Firebase Push Notifications',
              textAlign: TextAlign.center,
              style: TextStyle(
                color: Colors.black,
                fontSize: 20,
              ),
            ),
            const SizedBox(height: 16.0),
            Obx(
              () => NotificationBadge(
                  totalNotifications: notificationC.totalNotifications.value),
            ),
            const SizedBox(height: 16.0),
            Obx(() {
              var notificationInfo = notificationC.notificationInfo.value;
              return notificationInfo != null
                  ? Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(
                          'TITLE: ${notificationInfo.dataTitle ?? notificationInfo.title}',
                          style: const TextStyle(
                            fontWeight: FontWeight.bold,
                            fontSize: 16.0,
                          ),
                        ),
                        const SizedBox(height: 8.0),
                        Text(
                          'BODY: ${notificationInfo.dataBody ?? notificationInfo.body}',
                          style: const TextStyle(
                            fontWeight: FontWeight.bold,
                            fontSize: 16.0,
                          ),
                        ),
                      ],
                    )
                  : Container();
            })
          ],
        ),
      );
    }
  }
  
  class NotificationBadge extends StatelessWidget {
    final int totalNotifications;
  
    // ignore: use_key_in_widget_constructors
    const NotificationBadge({required this.totalNotifications});
  
    @override
    Widget build(BuildContext context) {
      return Container(
        width: 40.0,
        height: 40.0,
        decoration: const BoxDecoration(
          color: Colors.red,
          shape: BoxShape.circle,
        ),
        child: Center(
          child: Padding(
            padding: const EdgeInsets.all(8.0),
            child: Text(
              '$totalNotifications',
              style: const TextStyle(color: Colors.white, fontSize: 20),
            ),
          ),
        ),
      );
    }
  }
  