Skip to content

Refactoring Home module#491

Merged
Eldar2021 merged 3 commits intomainfrom
el/refactoring-home-module
Mar 12, 2026
Merged

Refactoring Home module#491
Eldar2021 merged 3 commits intomainfrom
el/refactoring-home-module

Conversation

@Eldar2021
Copy link
Copy Markdown
Owner

@Eldar2021 Eldar2021 commented Mar 11, 2026

Description

Related Issue

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor (improving code structure, no functional changes)
  • 📝 Documentation (changes to documentation only)
  • 🗑️ Chore (routine tasks, dependency updates, build configs)

How Has This Been Tested?

  • Manual Testing (Please describe the steps)
  • Unit Tests
  • CI Tests (All tests passed)

@Eldar2021 Eldar2021 self-assigned this Mar 11, 2026
@Eldar2021 Eldar2021 added A2-technical PR introduces technical changes B1-medium Elevates a release containing this PR to "medium priority" labels Mar 11, 2026
@Eldar2021 Eldar2021 added the C0-breaksnothing PR does not introduce any breaking changes label Mar 11, 2026
@Eldar2021 Eldar2021 linked an issue Mar 11, 2026 that may be closed by this pull request
@Eldar2021 Eldar2021 marked this pull request as ready for review March 11, 2026 16:25
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the Home module by breaking down complex UI components and their associated logic into smaller, more manageable, and reusable widgets. This enhances code organization, readability, and maintainability, making the HomeView cleaner and easier to understand. The changes primarily focus on improving the structure of the Home module without altering its core functionality.

Highlights

  • Modularization of Home View: Extracted several large widget blocks from home_view.dart into new, dedicated and reusable widgets: HomeStoriesWidget, HomeShareTile, HomeStaticsWidget, and HomeFabWidget.
  • Improved Initialization Logic: Refactored the initState method in home_view.dart by moving tracking and service initialization into a separate private method for better organization.
  • Component Encapsulation: Refactored list item rendering in show_hatim_widget.dart and show_invitation_widget.dart into dedicated stateless widgets (_HatimListItem and _InvitationListItem) for improved encapsulation and readability.
  • Module Exports Update: Updated module exports in home.dart to include the newly created widgets, ensuring they are properly exposed within the module.
Changelog
  • app/lib/modules/home/home.dart
    • Reordered existing exports for consistency.
    • Added exports for new widgets: home_fab_widget.dart, home_share_tile.dart, home_statics_widget.dart, and home_stories_widget.dart.
  • app/lib/modules/home/view/home_view.dart
    • Removed several unused imports (go_router, mq_home_repository, constants, core, mq_app_ui).
    • Extracted tracking and service initialization from initState into a new _initTrackingAndServices method.
    • Replaced inline BlocBuilder and ListTile widgets with HomeStoriesWidget, HomeShareTile, HomeStaticsWidget, and HomeFabWidget.
    • Removed the _onJoinToHatim method.
  • app/lib/modules/home/widgets/home_fab_widget.dart
    • Added a new widget to encapsulate the floating action button logic for joining Hatim.
  • app/lib/modules/home/widgets/home_share_tile.dart
    • Added a new widget to encapsulate the app sharing functionality.
  • app/lib/modules/home/widgets/home_statics_widget.dart
    • Added a new widget to encapsulate the display of user statistics.
  • app/lib/modules/home/widgets/home_stories_widget.dart
    • Added a new widget to encapsulate the display of MQ stories.
  • app/lib/modules/home/widgets/pray_time_widget.dart
    • Reordered parameters in the AppAlert.showUpdateLocation call.
  • app/lib/modules/home/widgets/show_hatim_widget.dart
    • Refactored the display of individual Hatim items into a new _HatimListItem widget.
  • app/lib/modules/home/widgets/show_invitation_widget.dart
    • Refactored the display and logic of individual invitation items into a new _InvitationListItem widget, including a helper for creator names.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a significant and beneficial refactoring of the Home module. By extracting various UI components from HomeView into their own dedicated widgets (HomeStoriesWidget, HomeShareTile, HomeStaticsWidget, HomeFabWidget), the code is now much cleaner, more modular, and easier to maintain. Similar refactorings in ShowHatimWidget and ShowInvitationWidget also improve code structure. My review includes one suggestion to align with the project's linting rules regarding directive ordering.

@Eldar2021 Eldar2021 marked this pull request as draft March 12, 2026 03:46
@Eldar2021 Eldar2021 marked this pull request as ready for review March 12, 2026 03:50
@Eldar2021 Eldar2021 merged commit 9e758fc into main Mar 12, 2026
12 checks passed
@Eldar2021 Eldar2021 deleted the el/refactoring-home-module branch March 12, 2026 04:06
@github-project-automation github-project-automation bot moved this to Done in MyQuran Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A2-technical PR introduces technical changes B1-medium Elevates a release containing this PR to "medium priority" C0-breaksnothing PR does not introduce any breaking changes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Refactored Home module

1 participant