feat: legacy mobile apps created

This commit is contained in:
Achintha Isuru
2025-12-02 23:51:04 -05:00
parent 850441ca64
commit 8e7753b324
1519 changed files with 0 additions and 16 deletions

View File

@@ -0,0 +1,16 @@
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:injectable/injectable.dart';
import 'package:krow/core/application/clients/api/api_client.dart';
import 'package:krow/core/application/clients/api/api_exception.dart';
import 'package:krow/features/clock_manual/data/clock_manual_gql.dart';
@singleton
class NotificationsApiProvider {
final ApiClient _client;
NotificationsApiProvider({required ApiClient client}) : _client = client;
Future<void> trackClientClockin(String positionStaffId) async {
}
}

View File

@@ -0,0 +1,47 @@
import 'package:flutter/foundation.dart';
import 'package:injectable/injectable.dart';
import 'package:krow/features/notificatins/domain/notification_entity.dart';
import '../domain/notification_repository.dart';
import 'notifications_api_provider.dart';
@Singleton(as: NotificationsRepository)
class NotificationsRepositoryImpl implements NotificationsRepository {
final NotificationsApiProvider apiProvider;
NotificationsRepositoryImpl({required this.apiProvider});
@override
Future<List<NotificationEntity>> fetchNotifications() async {
try {
// final response = await apiProvider.fetchNotifications();
// return response;
if (!kDebugMode) {
return [
NotificationEntity(
id: '1',
title: 'Test Notification',
body: 'This is a test notification',
type: NotificationType.general,
dateTime: DateTime.now(),
),
NotificationEntity(
id: '2',
title: 'Invoice Notification',
body: 'This is an invoice notification',
type: NotificationType.invoice,
dateTime: DateTime.now().subtract(Duration(days: 1)),
),
];
} else {
return [];
}
} catch (e) {
debugPrint('Error fetching notifications: $e');
rethrow;
}
}
@override
Future<void> readNotification(String id) async {}
}