CCExtractor / Flood_Mobile

GSoC 21' @CCExtractor. A modern mobile UI for various torrent clients with a Node.js backend and Flutter frontend.
MIT License
100 stars 124 forks source link

Bloc Migration, Improved Testing, and Code Refactoring #242

Closed amitamrutiya closed 1 year ago

amitamrutiya commented 1 year ago

Fixes #215

Describe the changes you have made in this PR -

This pull request includes several changes aimed at improving the codebase and enhancing the overall functionality of the application. The following modifications have been made:

  1. Added required dependencies for bloc migration: Ensured that all necessary dependencies, such as bloc, flutter_bloc, equatable, and bloc_test, are included to support the bloc state management library and its related functionality.

  2. Implemented bloc state management throughout the app: Removed all provider files and replaced them with bloc state management. This transition improves the overall architecture and promotes a more efficient and maintainable codebase.

  3. Made changes in file architecture: Adjusted the file architecture to enhance code structure and organization. As part of this restructuring, the component directory was removed, and small widgets were moved inside their parent screens. This change improves code readability and scalability.

  4. Changed theme to themeIndex: Renamed the theme variable to themeIndex for better clarity and separation from other indexes. This change improves code comprehension and maintainability.

  5. Improved error logging in API files: Enhanced error logging within the API files to provide more informative and actionable error messages. This improvement aids in the debugging and troubleshooting process, making issue resolution more efficient.

  6. Implemented additional routes and formatted files accordingly: Introduced new routes to enhance the application's navigation capabilities. Additionally, code formatting adjustments were made to ensure consistency and readability throughout the project. These changes improve the user experience and facilitate easier navigation within the app.

  7. Remove Unnecessary Files : In our app codebase, I have removed unnecessary files, such as the playground directory, that were not being used in any other places.

  8. Implemented unit testing for all blocs: Added comprehensive unit tests for all blocs in the application using the bloc_test package. These tests verify the correctness and reliability of the blocs, ensuring the stability of the application's logic.

  9. Implemented new widget testing: Due to the bloc migration, all of the widget tests were failing. This pull request addresses those failures and introduces new widget tests, such as settings screen widget tests and onboard screen widget tests. These tests validate the functionality and behaviour of the UI components, enhancing the overall quality of the application.

I know some of the changes made in this pull request may not be directly related to the bloc migration, they contribute to improving the codebase's readability, maintainability, scalability, and accessibility.