From 558a9abecc898c8bcaf9f4ff9d8f8a612c2051a5 Mon Sep 17 00:00:00 2001
From: CustomIcon <custom.icon@vk.com>
Date: Sat, 20 Apr 2024 16:59:36 +0000
Subject: [PATCH] Added AppViews

---
 apps/__init__.py                     |   5 +
 apps/apps.py                         | 358 +++++++++++++++++++++++++++
 apps/plugins/__init__.py             |  13 +
 apps/plugins/dhiraagu/__init__.py    |   5 +
 apps/plugins/dhiraagu/app.py         |  18 ++
 apps/plugins/medianet/__init__.py    |   5 +
 apps/plugins/medianet/app.py         |  18 ++
 apps/plugins/mwsc/__init__.py        |   5 +
 apps/plugins/mwsc/app.py             |  18 ++
 apps/plugins/ooredoo/__init__.py     |   5 +
 apps/plugins/ooredoo/app.py          |  18 ++
 apps/plugins/stelco/__init__.py      |   5 +
 apps/plugins/stelco/app.py           |  18 ++
 main.py                              |   1 +
 modules/__init__.py                  |   2 +-
 modules/home.py                      |  83 +++----
 modules/settings/functions/config.py |  15 +-
 modules/settings/settings.py         |  14 +-
 utils/views.py                       |  20 +-
 wrappers/__init__.py                 |   5 +
 wrappers/dhiraagu.py                 |  42 ++++
 21 files changed, 602 insertions(+), 71 deletions(-)
 create mode 100644 apps/__init__.py
 create mode 100644 apps/apps.py
 create mode 100644 apps/plugins/__init__.py
 create mode 100644 apps/plugins/dhiraagu/__init__.py
 create mode 100644 apps/plugins/dhiraagu/app.py
 create mode 100644 apps/plugins/medianet/__init__.py
 create mode 100644 apps/plugins/medianet/app.py
 create mode 100644 apps/plugins/mwsc/__init__.py
 create mode 100644 apps/plugins/mwsc/app.py
 create mode 100644 apps/plugins/ooredoo/__init__.py
 create mode 100644 apps/plugins/ooredoo/app.py
 create mode 100644 apps/plugins/stelco/__init__.py
 create mode 100644 apps/plugins/stelco/app.py
 create mode 100644 wrappers/__init__.py
 create mode 100644 wrappers/dhiraagu.py

diff --git a/apps/__init__.py b/apps/__init__.py
new file mode 100644
index 0000000..aa44fbd
--- /dev/null
+++ b/apps/__init__.py
@@ -0,0 +1,5 @@
+from .apps import Apps
+
+__all__ = [
+    "Apps"
+]
\ No newline at end of file
diff --git a/apps/apps.py b/apps/apps.py
new file mode 100644
index 0000000..f0d23e6
--- /dev/null
+++ b/apps/apps.py
@@ -0,0 +1,358 @@
+import flet as ft
+from utils import AppView, Title
+from modules.settings import config
+from modules.home import AppRow
+
+
+def Apps(page: ft.Page):
+    AppRow.controls = []
+    appsContainer = ft.ListView(
+        expand=True,
+    )
+    appList = ft.Container(
+        content=ft.Column(
+            controls=[],
+        ),
+    )
+    appsContainer.controls.append(
+        appList,
+    )
+    if config.getint('apps', 'dhiraagu') == 1:
+        appList.content.controls.append(
+            ft.Card(
+                content=ft.Container(
+                    ink=True,
+                    content=ft.Column(
+                        [
+                            ft.ListTile(
+                                leading=ft.Image(
+                                    border_radius=ft.border_radius.all(10),
+                                    fit=ft.ImageFit.CONTAIN,
+                                    src='https://asset.brandfetch.io/idZJsIaold/id9-VJM_HU.png',
+                                ),
+                                title=ft.Text('Dhiraagu'),
+                                subtitle=ft.Text(
+                                    'An ISP Service.',
+                                ),
+                            ),
+                        ],
+                    ),
+                    padding=10,
+                    on_click=lambda _: page.go('/apps/dhiraagu'),
+                ),
+            ),
+        )
+        AppRow.controls.append(
+            ft.Text('Dhiraagu')
+        )
+        AppRow.controls.append(
+            ft.Container(
+                margin=10,
+                padding=10,
+                bgcolor=ft.colors.with_opacity(0.1, '#000000'),
+                border_radius=10,
+                content=ft.Row(
+                    [
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.ACCOUNT_BOX, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Gift",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.ELECTRIC_BOLT, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Reload",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.DASHBOARD, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Usage",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.RECEIPT, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Bills",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                    ],
+                    alignment=ft.MainAxisAlignment.CENTER,
+                ),
+            )
+        )
+    if config.getint('apps', 'ooredoo') == 1:
+        appList.content.controls.append(
+            ft.Card(
+                content=ft.Container(
+                    ink=True,
+                    content=ft.Column(
+                        [
+                            ft.ListTile(
+                                leading=ft.Image(
+                                    border_radius=ft.border_radius.all(10),
+                                    fit=ft.ImageFit.CONTAIN,
+                                    src='https://asset.brandfetch.io/idR1xFKHLD/idu6J-WQsm.jpeg',
+                                ),
+                                title=ft.Text('Ooredoo'),
+                                subtitle=ft.Text(
+                                    'An ISP Service.',
+                                ),
+                            ),
+                        ],
+                    ),
+                    padding=10,
+                    on_click=lambda _: page.go('/apps/ooredoo'),
+                ),
+            )
+        )
+        AppRow.controls.append(
+            ft.Text('Ooredoo')
+        )
+        AppRow.controls.append(
+            ft.Container(
+                margin=10,
+                padding=10,
+                bgcolor=ft.colors.with_opacity(0.1, '#000000'),
+                border_radius=10,
+                content=ft.Row(
+                    [
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.SETTINGS_PHONE, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Add-ons",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.ELECTRIC_BOLT, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Raastas",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.DASHBOARD, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Balance",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                        ft.Column(
+                            controls=[
+                                ft.Container(
+                                    content=ft.Icon(ft.icons.RECEIPT, color=ft.colors.WHITE),
+                                    margin=10,
+                                    padding=10,
+                                    alignment=ft.alignment.center,
+                                    bgcolor=ft.colors.GREY_700,
+                                    width=60,
+                                    height=60,
+                                    border_radius=10,
+                                    ink=True,
+                                    on_click=None,
+                                ),
+                                ft.Container(
+                                    content=ft.Text("Bills",text_align=ft.TextAlign.CENTER),
+                                    alignment=ft.alignment.center,
+                                    width=80
+                                )
+                            ]
+                        ),
+                    ],
+                    alignment=ft.MainAxisAlignment.CENTER,
+                ),
+            )
+        )
+    if config.getint('apps', 'mwsc') == 1:
+        appList.content.controls.append(
+            ft.Card(
+                content=ft.Container(
+                    ink=True,
+                    content=ft.Column(
+                        [
+                            ft.ListTile(
+                                leading=ft.Image(
+                                    border_radius=ft.border_radius.all(10),
+                                    fit=ft.ImageFit.CONTAIN,
+                                    src='https://asset.brandfetch.io/idOZWUOUm-/idNastd9Bg.jpeg',
+                                ),
+                                title=ft.Text('MWSC'),
+                                subtitle=ft.Text(
+                                    'Water Bills',
+                                ),
+                            ),
+                        ],
+                    ),
+                    padding=10,
+                    on_click=lambda _: page.go('/apps/mwsc'),
+                ),
+            ),
+        )
+    if config.getint('apps', 'stelco') == 1:
+        appList.content.controls.append(
+            ft.Card(
+                content=ft.Container(
+                    ink=True,
+                    content=ft.Column(
+                        [
+                            ft.ListTile(
+                                leading=ft.Image(
+                                    border_radius=ft.border_radius.all(10),
+                                    fit=ft.ImageFit.CONTAIN,
+                                    src='https://www.stelco.com.mv/wp-content/uploads/2022/02/unnamed.png',
+                                ),
+                                title=ft.Text('STELCO'),
+                                subtitle=ft.Text(
+                                    'Electricity Bills',
+                                ),
+                            ),
+                        ],
+                    ),
+                    padding=10,
+                    on_click=lambda _:page.go('/apps/stelco'),
+                ),
+            ),
+        )
+    if config.getint('apps', 'medianet') == 1:
+        appList.content.controls.append(
+            ft.Card(
+                content=ft.Container(
+                    ink=True,
+                    content=ft.Column(
+                        [
+                            ft.ListTile(
+                                leading=ft.Image(
+                                    border_radius=ft.border_radius.all(10),
+                                    fit=ft.ImageFit.CONTAIN,
+                                    src='https://asset.brandfetch.io/idLMZnv5SC/iduyX4keYN.jpeg',
+                                ),
+                                title=ft.Text('Dhiraagu'),
+                                subtitle=ft.Text(
+                                    'Online Television Service',
+                                ),
+                            ),
+                        ],
+                    ),
+                    padding=10,
+                    on_click=lambda _: page.go('/apps/medianet'),
+                ),
+            ),
+        )
+    return AppView(
+        '/apps',
+        [
+            ft.AppBar(
+                leading=ft.IconButton(
+                    ft.icons.ARROW_BACK_IOS_NEW_ROUNDED,
+                    on_click=lambda _: page.go('/'),
+                ),
+                title=ft.Text(Title(str(__file__))),
+                bgcolor=ft.colors.TRANSPARENT,
+            ),
+            appsContainer
+        ],
+    )
diff --git a/apps/plugins/__init__.py b/apps/plugins/__init__.py
new file mode 100644
index 0000000..e56318b
--- /dev/null
+++ b/apps/plugins/__init__.py
@@ -0,0 +1,13 @@
+from .dhiraagu import Dhiraagu
+from .ooredoo import Ooredoo
+from .medianet import Medianet
+from .mwsc import Mwsc
+from .stelco import Stelco
+
+__all__ = [
+    'Dhiraagu',
+    'Ooredoo',
+    'Medianet',
+    'Stelco',
+    'Mwsc'
+]
\ No newline at end of file
diff --git a/apps/plugins/dhiraagu/__init__.py b/apps/plugins/dhiraagu/__init__.py
new file mode 100644
index 0000000..bd443fd
--- /dev/null
+++ b/apps/plugins/dhiraagu/__init__.py
@@ -0,0 +1,5 @@
+from .app import App as Dhiraagu
+
+__all__ = [
+    'Dhiraagu'
+]
\ No newline at end of file
diff --git a/apps/plugins/dhiraagu/app.py b/apps/plugins/dhiraagu/app.py
new file mode 100644
index 0000000..965272e
--- /dev/null
+++ b/apps/plugins/dhiraagu/app.py
@@ -0,0 +1,18 @@
+import flet as ft
+from utils import AppView
+
+
+def App(page: ft.Page):
+    return AppView(
+        '/apps/dhiraagu',
+        [
+            ft.AppBar(
+                leading=ft.IconButton(
+                    ft.icons.ARROW_BACK_IOS_NEW_ROUNDED,
+                    on_click=lambda _: page.go('/apps'),
+                ),
+                title=ft.Text("Dhiraagu"),
+                bgcolor=ft.colors.TRANSPARENT,
+            ),
+        ],
+    )
diff --git a/apps/plugins/medianet/__init__.py b/apps/plugins/medianet/__init__.py
new file mode 100644
index 0000000..fca35af
--- /dev/null
+++ b/apps/plugins/medianet/__init__.py
@@ -0,0 +1,5 @@
+from .app import App as Medianet
+
+__all__ = [
+    "Medianet"
+]
\ No newline at end of file
diff --git a/apps/plugins/medianet/app.py b/apps/plugins/medianet/app.py
new file mode 100644
index 0000000..f84912a
--- /dev/null
+++ b/apps/plugins/medianet/app.py
@@ -0,0 +1,18 @@
+import flet as ft
+from utils import AppView
+
+
+def App(page: ft.Page):
+    return AppView(
+        '/apps/medianet',
+        [
+            ft.AppBar(
+                leading=ft.IconButton(
+                    ft.icons.ARROW_BACK_IOS_NEW_ROUNDED,
+                    on_click=lambda _: page.go('/apps'),
+                ),
+                title=ft.Text("Medianet"),
+                bgcolor=ft.colors.TRANSPARENT,
+            ),
+        ],
+    )
diff --git a/apps/plugins/mwsc/__init__.py b/apps/plugins/mwsc/__init__.py
new file mode 100644
index 0000000..11540dc
--- /dev/null
+++ b/apps/plugins/mwsc/__init__.py
@@ -0,0 +1,5 @@
+from .app import App as Mwsc
+
+__all__ = [
+    'Mwsc'
+]
\ No newline at end of file
diff --git a/apps/plugins/mwsc/app.py b/apps/plugins/mwsc/app.py
new file mode 100644
index 0000000..ceb395c
--- /dev/null
+++ b/apps/plugins/mwsc/app.py
@@ -0,0 +1,18 @@
+import flet as ft
+from utils import AppView
+
+
+def App(page: ft.Page):
+    return AppView(
+        '/apps/mwsc',
+        [
+            ft.AppBar(
+                leading=ft.IconButton(
+                    ft.icons.ARROW_BACK_IOS_NEW_ROUNDED,
+                    on_click=lambda _: page.go('/apps'),
+                ),
+                title=ft.Text("MWSC"),
+                bgcolor=ft.colors.TRANSPARENT,
+            ),
+        ],
+    )
diff --git a/apps/plugins/ooredoo/__init__.py b/apps/plugins/ooredoo/__init__.py
new file mode 100644
index 0000000..561fd88
--- /dev/null
+++ b/apps/plugins/ooredoo/__init__.py
@@ -0,0 +1,5 @@
+from .app import App as Ooredoo
+
+__all__ = [
+    'Ooredoo'
+]
\ No newline at end of file
diff --git a/apps/plugins/ooredoo/app.py b/apps/plugins/ooredoo/app.py
new file mode 100644
index 0000000..caefe57
--- /dev/null
+++ b/apps/plugins/ooredoo/app.py
@@ -0,0 +1,18 @@
+import flet as ft
+from utils import AppView
+
+
+def App(page: ft.Page):
+    return AppView(
+        '/apps/ooredoo',
+        [
+            ft.AppBar(
+                leading=ft.IconButton(
+                    ft.icons.ARROW_BACK_IOS_NEW_ROUNDED,
+                    on_click=lambda _: page.go('/apps'),
+                ),
+                title=ft.Text("Ooredoo"),
+                bgcolor=ft.colors.TRANSPARENT,
+            ),
+        ],
+    )
diff --git a/apps/plugins/stelco/__init__.py b/apps/plugins/stelco/__init__.py
new file mode 100644
index 0000000..0f518c9
--- /dev/null
+++ b/apps/plugins/stelco/__init__.py
@@ -0,0 +1,5 @@
+from .app import App as Stelco
+
+__all__ = [
+    'Stelco'
+]
\ No newline at end of file
diff --git a/apps/plugins/stelco/app.py b/apps/plugins/stelco/app.py
new file mode 100644
index 0000000..ffb1b60
--- /dev/null
+++ b/apps/plugins/stelco/app.py
@@ -0,0 +1,18 @@
+import flet as ft
+from utils import AppView
+
+
+def App(page: ft.Page):
+    return AppView(
+        '/apps/stelco',
+        [
+            ft.AppBar(
+                leading=ft.IconButton(
+                    ft.icons.ARROW_BACK_IOS_NEW_ROUNDED,
+                    on_click=lambda _: page.go('/apps'),
+                ),
+                title=ft.Text("STELCO"),
+                bgcolor=ft.colors.TRANSPARENT,
+            ),
+        ],
+    )
diff --git a/main.py b/main.py
index d44f4e6..3ebd806 100644
--- a/main.py
+++ b/main.py
@@ -2,6 +2,7 @@ import flet as ft
 from utils import views_handler
 from modules.settings.functions import config
 
+
 def main(page: ft.Page):
     page.title = 'BillPay'
     print('Initial route:', page.route)
diff --git a/modules/__init__.py b/modules/__init__.py
index a33f265..366b04a 100644
--- a/modules/__init__.py
+++ b/modules/__init__.py
@@ -2,4 +2,4 @@ from .home import Home
 from .settings import Settings
 
 
-__all__ = ['Home', 'Settings']
+__all__ = ['Home', 'Settings', 'Apps']
diff --git a/modules/home.py b/modules/home.py
index 30f31e2..eea8c9a 100644
--- a/modules/home.py
+++ b/modules/home.py
@@ -13,6 +13,11 @@ def greet(time: datetime):
         return 'Goodevening,'
 
 
+AppRow = ft.ResponsiveRow(
+    alignment=ft.MainAxisAlignment.CENTER,
+)
+
+
 def Home(page: ft.Page):
     contentColumn = ft.Container(
         padding=10,
@@ -21,50 +26,15 @@ def Home(page: ft.Page):
                 ft.Text(
                     greet(datetime.now()),
                     size=50,
-                    weight=ft.FontWeight.W_200,
+                    weight=ft.FontWeight.W_500,
                 ),
                 ft.Text(
                     config.get('general', 'name').split(' ')[0],
                     size=40,
-                    weight=ft.FontWeight.W_200,
+                    weight=ft.FontWeight.W_300,
                 ),
                 ft.Divider(),
-                ft.ResponsiveRow(
-                    [
-                        ft.Container(
-                            content=ft.Text('A'),
-                            margin=10,
-                            padding=10,
-                            bgcolor=ft.colors.with_opacity(0.1, '#000000'),
-                            border_radius=10,
-                        ),
-                        ft.Divider(),
-                        ft.Container(
-                            content=ft.Text('B'),
-                            margin=10,
-                            padding=10,
-                            bgcolor=ft.colors.with_opacity(0.1, '#000000'),
-                            border_radius=10,
-                        ),
-                        ft.Divider(),
-                        ft.Container(
-                            content=ft.Text('C'),
-                            margin=10,
-                            padding=10,
-                            bgcolor=ft.colors.with_opacity(0.1, '#000000'),
-                            border_radius=10,
-                        ),
-                        ft.Divider(),
-                        ft.Container(
-                            content=ft.Text('D'),
-                            margin=10,
-                            padding=10,
-                            bgcolor=ft.colors.with_opacity(0.1, '#000000'),
-                            border_radius=10,
-                        ),
-                    ],
-                    alignment=ft.MainAxisAlignment.CENTER,
-                ),
+                AppRow,
                 ft.Divider(),
                 ft.Container(
                     margin=10,
@@ -74,7 +44,23 @@ def Home(page: ft.Page):
                     content=ft.Row(
                         [
                             ft.Container(
-                                content=ft.Icon(ft.icons.APPS, color=ft.colors.WHITE),
+                                content=ft.Icon(
+                                    ft.icons.APPS, color=ft.colors.WHITE,
+                                ),
+                                margin=10,
+                                padding=10,
+                                alignment=ft.alignment.center,
+                                bgcolor=ft.colors.GREY_700,
+                                width=60,
+                                height=60,
+                                border_radius=10,
+                                ink=True,
+                                on_click=lambda _: page.go('/apps'),
+                            ),
+                            ft.Container(
+                                content=ft.Icon(
+                                    ft.icons.HISTORY, color=ft.colors.WHITE,
+                                ),
                                 margin=10,
                                 padding=10,
                                 alignment=ft.alignment.center,
@@ -85,18 +71,9 @@ def Home(page: ft.Page):
                                 on_click=None,
                             ),
                             ft.Container(
-                                content=ft.Icon(ft.icons.HISTORY, color=ft.colors.WHITE),
-                                margin=10,
-                                padding=10,
-                                alignment=ft.alignment.center,
-                                bgcolor=ft.colors.GREY_700,
-                                width=60,
-                                height=60,
-                                border_radius=10,
-                                on_click=None,
-                            ),
-                            ft.Container(
-                                content=ft.Icon(ft.icons.SETTINGS, color=ft.colors.WHITE),
+                                content=ft.Icon(
+                                    ft.icons.SETTINGS, color=ft.colors.WHITE,
+                                ),
                                 margin=10,
                                 padding=10,
                                 alignment=ft.alignment.center,
@@ -108,7 +85,9 @@ def Home(page: ft.Page):
                                 on_click=lambda _: page.go('/settings'),
                             ),
                             ft.Container(
-                                content=ft.Icon(ft.icons.LIST, color=ft.colors.WHITE),
+                                content=ft.Icon(
+                                    ft.icons.LIST, color=ft.colors.WHITE,
+                                ),
                                 margin=10,
                                 padding=10,
                                 alignment=ft.alignment.center,
diff --git a/modules/settings/functions/config.py b/modules/settings/functions/config.py
index 252b72f..611e937 100644
--- a/modules/settings/functions/config.py
+++ b/modules/settings/functions/config.py
@@ -10,17 +10,18 @@ email =
 theme = dark
 
 [apps]
-dhiraagu = true
-ooredoo = true
-hdc = true
-mwsc = true
-stelco = true
-medianet = true
+dhiraagu = 1
+ooredoo = 1
+hdc = 1
+mwsc = 1
+stelco = 1
+medianet = 1
 
 [dhiraagu]
 phone =
 otp =
-cookie =
+token =
+account =
 
 [ooredoo]
 phone =
diff --git a/modules/settings/settings.py b/modules/settings/settings.py
index acc9e49..096e0de 100644
--- a/modules/settings/settings.py
+++ b/modules/settings/settings.py
@@ -31,7 +31,7 @@ def Settings(page: ft.Page):
                 ft.CupertinoButton(
                     'Close', on_click=lambda _: (
                         setattr(dlg, 'open', False),
-                        page.update()
+                        page.update(),
                     ),
                 ),
             ],
@@ -62,7 +62,7 @@ def Settings(page: ft.Page):
                 ft.CupertinoButton(
                     'Close', on_click=lambda _: (
                         setattr(dlg, 'open', False),
-                        page.update() 
+                        page.update(),
                     ),
                 ),
             ],
@@ -93,7 +93,7 @@ def Settings(page: ft.Page):
                 ft.CupertinoButton(
                     'Close', on_click=lambda _: (
                         setattr(dlg, 'open', False),
-                        page.update()
+                        page.update(),
                     ),
                 ),
             ],
@@ -124,7 +124,7 @@ def Settings(page: ft.Page):
                 ft.CupertinoButton(
                     'Close', on_click=lambda _: (
                         setattr(dlg, 'open', False),
-                        page.update()
+                        page.update(),
                     ),
                 ),
             ],
@@ -267,7 +267,7 @@ def Settings(page: ft.Page):
                             ],
                         ),
                         padding=10,
-                        on_click=lambda _: print('clicked dhiraagu'),
+                        on_click=None,
                     ),
                 ),
                 ft.Card(
@@ -368,10 +368,10 @@ def Settings(page: ft.Page):
     def _on_theme_change(e):
         if page.theme_mode == ft.ThemeMode.LIGHT:
             e.value = False
-            config.save('general', 'theme', 'light')
+            config.save('general', 'theme', 'dark')
         else:
             e.value = True
-            config.save('general', 'theme', 'dark')
+            config.save('general', 'theme', 'light')
         Theme(page).change(
             ft.ThemeMode.DARK if page.theme_mode ==
             ft.ThemeMode.LIGHT else ft.ThemeMode.LIGHT,
diff --git a/utils/views.py b/utils/views.py
index fd36d8b..691b4c3 100644
--- a/utils/views.py
+++ b/utils/views.py
@@ -1,8 +1,20 @@
 from modules import Home, Settings
+from apps import Apps
+from apps.plugins import Ooredoo, Dhiraagu, Medianet, Mwsc, Stelco
 
 
 def views_handler(page):
-    return {
-        '/': Home(page),
-        '/settings': Settings(page),
-    }
+    views = {}
+    # root
+    views['/'] = Home(page)
+
+    # settings
+    views['/settings'] = Settings(page)
+    # apps
+    views['/apps'] = Apps(page)
+    views['/apps/dhiraagu'] = Dhiraagu(page)
+    views['/apps/ooredoo'] = Ooredoo(page)
+    views['/apps/medianet'] = Medianet(page)
+    views['/apps/mwsc'] = Mwsc(page)
+    views['/apps/stelco'] = Stelco(page)
+    return views
diff --git a/wrappers/__init__.py b/wrappers/__init__.py
new file mode 100644
index 0000000..8ecee4d
--- /dev/null
+++ b/wrappers/__init__.py
@@ -0,0 +1,5 @@
+from .dhiraagu import DhiraaguAPI
+
+__all__ = [
+    'DhiraaguAPI'
+]
\ No newline at end of file
diff --git a/wrappers/dhiraagu.py b/wrappers/dhiraagu.py
new file mode 100644
index 0000000..1bf4644
--- /dev/null
+++ b/wrappers/dhiraagu.py
@@ -0,0 +1,42 @@
+import requests
+
+class DhiraaguAPI:
+    def __init__(
+            self,
+            phone: str = None,
+            otp: str = None,
+            token: str = None,
+            account: str = None,
+        ) -> None:
+        self.phone = phone
+        self.otp = otp
+        self.token = token
+        self.account = account
+        self.headers = {
+            'Host': 'app-production.dhiraagu.com.mv',
+            'Content-Type': 'application/json',
+            'Connection': 'keep-alive',
+            'Accept': '*/*',
+            'User-Agent': 'MyDhiraagu/5.0 (mv.com.dhiraagu.app; build:1; iOS 17.5.0) Alamofire/5.6.1',
+            'Accept-Language': 'en-US;q=1.0, dv-MV;q=0.9, ar-MV;q=0.8',
+            # 'Content-Length': '33',
+            # 'Accept-Encoding': 'br;q=1.0, gzip;q=0.9, deflate;q=0.8',
+        }
+        if self.token:
+            self.headers['Authorization'] = f'Bearer {self.token}'
+    
+    def login(self):
+        data = requests.post(
+            'https://app-production.dhiraagu.com.mv/auth',
+            json={
+                'number': self.phone,
+                'otp': self.otp
+            }
+        )
+        return data.json()
+
+    def bills(self):
+        return requests.get(
+            f'https://app-production.dhiraagu.com.mv/io/v1/info/subscribers/{self.account}/liberate/billinfo',
+            headers=self.headers
+        ).json()