Skip to content

Add notifications screen#1019

Merged
zaelgohary merged 4 commits intodevelopmentfrom
development_add_notifications_screen
May 18, 2025
Merged

Add notifications screen#1019
zaelgohary merged 4 commits intodevelopmentfrom
development_add_notifications_screen

Conversation

@zaelgohary
Copy link
Copy Markdown
Contributor

Changes

  • Add notifications screen

Related Issues

#1012

Tested Scenarios

  • Navigate to notifications from home
  • Navigate to notfications from side drawer
  • Toggle settings

import 'package:shared_preferences/shared_preferences.dart';
import 'package:threebotlogin/helpers/logger.dart';

const String _nodeStatusNotificationEnabledKey =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • The constant is also defined in background_service.dart, consider keeping it in a shared place.

crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
SwitchListTile(
title: const Text('Enable node status notifications'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe we can add info icon or smth like that, shows description of each notification.

_loadNotificationPreference();
}

void _loadNotificationPreference() async {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You may consider adding a loading state while fetching the preferences.

}

Future<void> checkNodeStatus() async {
Future<void> checkNodeStatus(String taskId) async {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As BackgroundFetch.finish(taskId); is called multiple times, it can be added only in finally block.

@zaelgohary zaelgohary marked this pull request as draft May 18, 2025 06:02
@zaelgohary zaelgohary marked this pull request as ready for review May 18, 2025 07:27
@zaelgohary zaelgohary requested a review from AlaaElattar May 18, 2025 07:27
@zaelgohary zaelgohary merged commit 71d750b into development May 18, 2025
2 checks passed
@zaelgohary zaelgohary deleted the development_add_notifications_screen branch May 18, 2025 11:08
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.

2 participants