Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Refactoring and UI Improvements #4

Merged
merged 9 commits into from
Jul 25, 2024

Conversation

Rax-x
Copy link
Contributor

@Rax-x Rax-x commented Jul 25, 2024

This pull request introduces significant changes to improve code structure and user experience:

Code Refactoring:
Extracted hash-related utilities into a dedicated Hasher class for better organization.
Refactored HomeScreen for improved maintainability and readability.
Renamed HashCracker to HashBruterforcer for better accuracy.

New Features:
Added HashAlgorithmSelector widget to provide a user-friendly way to choose hash algorithms.
Implemented ResultCard widget for displaying hash cracking results.
Introduced showSnackBar function for displaying in-app notifications.

UI Enhancements:
Converted HomeScreen to a HookWidget for better state management.

none added 9 commits July 24, 2024 16:32
- Fix navigation issue to AboutUsScreen
- Reintroduce navigateTo() util function
Now showSnackBar() and showErrorSnackBar() are wrapper functions of _showSnackBar().
- Turn buildCard() function into a ResultCard widget
- Replace all occurrences of buildCard() with the new widget
- Fix issues with storage permissions
- ResultCard widget now doesn't show copy button if it's in error mode
- Replace buildCard() with ResultCard widget
- Other minor refactors
- Convert HomeState into a sealed class, with each UI state now is rapresented by a subclass of HomeState
	- idle state: HomeStateIdle
	- loading state: HomeStateLoading
	- success state: HomeStateSuccess
	- error state: HomeStateError

Thanks to this change:
	- The HashBruteforcingResult isn't exposed to HomeScreen
	- _renderCrackingResult() is renamed to _renderBasedOnState() which internally uses a switch
	  statement who simplfies the conditionally rendering of widgets based on the current state.
@giovanni-iannaccone giovanni-iannaccone merged commit dd6d9ad into giovanni-iannaccone:main Jul 25, 2024
@Rax-x Rax-x deleted the code-refactor branch July 25, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants