Skip to content

Commit

Permalink
feat: update dependencies to latest versions
Browse files Browse the repository at this point in the history
  • Loading branch information
salahamassi committed Jul 27, 2024
1 parent e9c9645 commit 46e80c7
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 269 deletions.
4 changes: 2 additions & 2 deletions lib/core/cache/secure_storage_cache_driver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SecureStorageCacheDriver extends CacheDriver {
bool has(String key) => _cache.containsKey(key);

@override
Future<bool> flush() async {
Future<bool> removeAll() async {
try {
await _storage.deleteAll();
return true;
Expand All @@ -61,7 +61,7 @@ class SecureStorageCacheDriver extends CacheDriver {
}

@override
Future<bool> forget(String key) async {
Future<bool> remove(String key) async {
try {
await _storage.delete(key: key);
return true;
Expand Down
14 changes: 4 additions & 10 deletions lib/features/auth/auth_service_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ class AuthServiceProvider extends ServiceProvider with ResponseDecoding {
}

@override
T? responseConvert<T>(Map<String, dynamic> json) {
switch (T) {
case User:
return User.fromJson(json) as T;
case UserMeta:
return UserMeta.fromJson(json) as T;
default:
return null;
}
}
Map<Type, JsonFactory> get factories => {
User: User.fromJson,
UserMeta: UserMeta.fromJson,
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:bond_core/bond_core.dart';
import 'package:timeago/timeago.dart' as time_ago;

import 'badge_unread_notification.dart';
import 'header_title_image.dart';
Expand Down Expand Up @@ -51,7 +50,7 @@ class NotificationItem extends StatelessWidget {

/// Time Ago
Text(
time_ago.format(createAt, locale: 'ar'),
createAt.toIso8601String(),
style: context.textTheme.bodySmall,
)
],
Expand Down
11 changes: 3 additions & 8 deletions lib/features/post/post_service_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ class PostServiceProvider extends ServiceProvider with ResponseDecoding {
}

@override
T? responseConvert<T>(Map<String, dynamic> json) {
switch (T) {
case Post:
return Post.fromJson(json) as T;
default:
return null;
}
}
Map<Type, JsonFactory> get factories => {
Post: Post.fromJson,
};
}
16 changes: 6 additions & 10 deletions lib/providers/notifications_service_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:get_it/get_it.dart';
import 'package:bond_core/bond_core.dart';

import '../config/notification.dart';
import 'package:bond/config/notification.dart';

class NotificationsServiceProvider extends ServiceProvider with ResponseDecoding {
class NotificationsServiceProvider extends ServiceProvider
with ResponseDecoding {
@override
Future<void> register(GetIt it) async {
for (final provider in NotificationConfig.providers.entries) {
Expand Down Expand Up @@ -78,12 +79,7 @@ class NotificationsServiceProvider extends ServiceProvider with ResponseDecoding
}

@override
T? responseConvert<T>(Map<String, dynamic> json) {
switch (T) {
case ServerNotificationModel:
return ServerNotificationModel.fromJson(json) as T;
default:
return null;
}
}
Map<Type, JsonFactory> get factories => {
ServerNotificationModel: ServerNotificationModel.fromJson,
};
}
Loading

0 comments on commit 46e80c7

Please sign in to comment.