Mosquito-Alert / Mosquito-Alert-Mobile-App

http://www.mosquitoalert.com
4 stars 3 forks source link

Notification bell #115

Closed DigitalSeneca closed 6 months ago

DigitalSeneca commented 7 months ago

fixes #43

Description of changes

Screenshot GIF
image notification_bell_2
epou commented 6 months ago

Hey! Does the counter badge "break" visually when the count reaches two digits?

DigitalSeneca commented 6 months ago

@epou

Hey! Does the counter badge "break" visually when the count reaches two digits?

Seems to be working fine visually with 2 digits. Screenshot: image

epou commented 6 months ago

Cool! Can we fetch the data from the API in the main_vc.dart asynchronously and pass the list into the NotificationsPage view? This API call is quite slow and would be nice to be called every X minutes in the background and on each app start to avoid waiting every time the user goes to the notification page.

DigitalSeneca commented 6 months ago

Cool! Can we fetch the data from the API in the main_vc.dart asynchronously and pass the list into the NotificationsPage view? This API call is quite slow and would be nice to be called every X minutes in the background and on each app start to avoid waiting every time the user goes to the notification page.

yes, I'll do that. The minimum amount of time between periodic background tasks is every 15min for Android, is that good or should I do a different interval?

epou commented 6 months ago

I didn't know about the 15min constraint for background tasks... Maybe it's too much. In that case, you can keep it as is.

By the way, I've seen there is a native class for badges in material. It would be worth a try:

epou commented 6 months ago

Looks good to me! I feel curious if this https://api.flutter.dev/flutter/material/Badge-class.html might help in making the code easier, I feel the native library might consider a broad number of case scenarios and less prone to bugs.

Just to be consistent with the linked issue (#43), I'm not sure if this is working or not:

The app logo have also a badge number with the unread notifications

I've found this, which might be helpful: https://stackoverflow.com/questions/61979970/how-to-show-a-notification-badge-on-the-app-icon-using-flutter

DigitalSeneca commented 6 months ago

I'm sorry I didn't address the comment about the badge before requesting a new review. I'll pay more attention next time before asking for a new review to not waste your time

The app logo have also a badge number with the unread notifications

This is not yet implemented, only the badge inside of the app. I've tried it and I could not make it work for now, isAppBadgeSupported() returns true but nothing shows app in the icon

Here's the screenshot after the changes. I've also increased the bell size for it to be similar to the adn image next to it

with unread without unread 10+ view
image image drawing