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

♻️ Alerts need an abstraction #1111

Open
4 tasks
matt-goldman-ssw opened this issue Oct 23, 2024 · 0 comments
Open
4 tasks

♻️ Alerts need an abstraction #1111

matt-goldman-ssw opened this issue Oct 23, 2024 · 0 comments

Comments

@matt-goldman-ssw
Copy link
Contributor

Cc: @zacharykeeping @AntPolkanov

Hi

Pain

I've noticed we're depending directly on App.Current.MainPage.DisplayAlert. There's an argument that we should use custom dialogs, but that aside, we need an abstraction for using system dialogs (e.g. IAlertService).

Using IAlertService an in ViewModels instead of directly calling App.Current.MainPage.DisplayAlert promotes testability, separation of concerns, and better adherence to MVVM principles. It decouples the UI framework from the business logic, making it easier to mock alerts in unit tests and maintain cross-platform flexibility.

What code could be improved?

https://github.com/search?q=repo%3ASSWConsulting%2FSSW.Rewards.Mobile%20App.Current.MainPage.DisplayAlert&type=code

Tasks

  • Create the abstraction
  • Replace all instances of App.Current.MainPage.DisplayAlert with calls to the service

Acceptance Criteria

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant