fix: apply dart fix --apply

This commit is contained in:
2023-08-28 09:00:59 +00:00
committed by hugo
parent e74346b655
commit cc41b7b589
36 changed files with 127 additions and 127 deletions
@@ -22,11 +22,11 @@ import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_me
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
class CloudMessagingRepositoryImpl extends CloudMessagingRepository {
final CloudMessagingRemoteDataSource _notificationRemoteDataSource;
CloudMessagingRepositoryImpl({
required CloudMessagingRemoteDataSource notificationRemoteDataSource,
}) : _notificationRemoteDataSource = notificationRemoteDataSource;
final CloudMessagingRemoteDataSource _notificationRemoteDataSource;
@override
FutureOrResult<String?> getToken() => Result.tryCatchAsync(
@@ -18,11 +18,11 @@ import 'package:wyatt_architecture/wyatt_architecture.dart';
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_messaging_repository.dart';
class GetCloudMessagingTokenUseCase extends AsyncUseCase<void, String?> {
final CloudMessagingRepository _notificationRepository;
GetCloudMessagingTokenUseCase({
required CloudMessagingRepository notificationRepository,
}) : _notificationRepository = notificationRepository;
final CloudMessagingRepository _notificationRepository;
@override
FutureOrResult<String?> execute(void params) =>
@@ -18,11 +18,11 @@ import 'package:wyatt_architecture/wyatt_architecture.dart';
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_messaging_repository.dart';
class InitCloudmessagingUseCase extends AsyncUseCase<NoParam, void> {
final CloudMessagingRepository _notificationRepository;
InitCloudmessagingUseCase({
required CloudMessagingRepository notificationRepository,
}) : _notificationRepository = notificationRepository;
final CloudMessagingRepository _notificationRepository;
@override
FutureOrResult<void> execute(NoParam? params) =>
_notificationRepository.init();
@@ -25,11 +25,11 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
class ListenNotificationUseCase
extends StreamUseCase<NoParam, RemoteNotification> {
final CloudMessagingRepository _notificationRepository;
ListenNotificationUseCase({
required CloudMessagingRepository notificationRepository,
}) : _notificationRepository = notificationRepository;
final CloudMessagingRepository _notificationRepository;
@override
FutureOrResult<Stream<RemoteNotification>> execute(NoParam? params) async {
Stream<RemoteNotification>? notificationStream;
@@ -18,11 +18,11 @@ import 'package:wyatt_architecture/wyatt_architecture.dart';
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_messaging_repository.dart';
class RequestCloudMessagingPermissionUseCase extends AsyncUseCase<void, void> {
final CloudMessagingRepository _notificationRepository;
RequestCloudMessagingPermissionUseCase({
required CloudMessagingRepository notificationRepository,
}) : _notificationRepository = notificationRepository;
final CloudMessagingRepository _notificationRepository;
@override
FutureOrResult<void> execute(void params) =>
@@ -20,11 +20,11 @@ import 'package:wyatt_architecture/wyatt_architecture.dart';
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_messaging_repository.dart';
class SubscribeToNotificationTopicUseCase extends AsyncUseCase<String, void> {
final CloudMessagingRepository _notificationRepository;
SubscribeToNotificationTopicUseCase({
required CloudMessagingRepository notificationRepository,
}) : _notificationRepository = notificationRepository;
final CloudMessagingRepository _notificationRepository;
@override
FutureOr<void> onStart(String? params) {
@@ -21,11 +21,11 @@ import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_me
class UnsubscribeFromNotificationTopicUseCase
extends AsyncUseCase<String, void> {
final CloudMessagingRepository _notificationRepository;
UnsubscribeFromNotificationTopicUseCase({
required CloudMessagingRepository notificationRepository,
}) : _notificationRepository = notificationRepository;
final CloudMessagingRepository _notificationRepository;
@override
FutureOr<void> onStart(String? params) {
@@ -30,11 +30,6 @@ part 'cloud_messaging_state.dart';
typedef OnNotification = void Function(RemoteNotification);
class CloudMessagingCubit extends Cubit<CloudmessagingState> {
final ListenNotificationUseCase _listenNotification;
final SubscribeToNotificationTopicUseCase? _subscribe;
final UnsubscribeFromNotificationTopicUseCase? _unsubscribe;
final OnNotification? handleNotification;
CloudMessagingCubit({
required ListenNotificationUseCase listenNotification,
SubscribeToNotificationTopicUseCase? subscribe,
@@ -44,6 +39,11 @@ class CloudMessagingCubit extends Cubit<CloudmessagingState> {
_subscribe = subscribe,
_unsubscribe = unsubscribe,
super(const CloudmessagingState());
final ListenNotificationUseCase _listenNotification;
final SubscribeToNotificationTopicUseCase? _subscribe;
final UnsubscribeFromNotificationTopicUseCase? _unsubscribe;
final OnNotification? handleNotification;
Future<void> listenNotification() async {
final notificaitons = await _listenNotification.execute(const NoParam());
@@ -17,9 +17,9 @@
part of 'cloud_messaging_cubit.dart';
class CloudmessagingState extends Equatable {
final RemoteNotification? remoteNotification;
const CloudmessagingState([this.remoteNotification]);
final RemoteNotification? remoteNotification;
@override
List<Object?> get props => [remoteNotification];