Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor/centralize local ad status management #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
fulleni merged 32 commits into main from refactor/centralize-local-ad-status-management
Sep 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f336141
refactor(local_ads_management): remove contentStatus from CreateLocal...
fulleni Sep 24, 2025
183620a
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
b6a372e
refactor(local_ads): remove status change logic in CreateLocalBannerA...
fulleni Sep 24, 2025
ab94ad9
refactor(local_ads_management): remove contentStatus from CreateLocal...
fulleni Sep 24, 2025
a8c5fec
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
645af92
refactor(local_ads_management): remove status change logic from inter...
fulleni Sep 24, 2025
584cacd
refactor(local_ads_management): remove contentStatus from CreateLocal...
fulleni Sep 24, 2025
e78cf1e
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
1d4b1cd
refactor(local_ads_management): remove status change logic from nativ...
fulleni Sep 24, 2025
40a3306
fix(local-ads): remove status toggle from local video ad creation
fulleni Sep 24, 2025
b0b9bb8
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
c79a695
refactor(local_ads_management): remove unused contentStatus from Crea...
fulleni Sep 24, 2025
4b6ff49
refactor(local_ads_management): remove contentStatus from UpdateLocal...
fulleni Sep 24, 2025
93bc5df
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
2b3ed03
fix(local-ads): remove status update functionality from local banner ad
fulleni Sep 24, 2025
d8e5815
fix(local-ads): remove status update functionality from interstitial ad
fulleni Sep 24, 2025
690225b
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
c0eb8b5
refactor(local_ads_management): remove unused contentStatus from Upda...
fulleni Sep 24, 2025
f0531cc
fix(local_ads_management): remove unused status field and logic
fulleni Sep 24, 2025
6f19292
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
224293d
refactor(local_ads_management): remove contentStatus from UpdateLocal...
fulleni Sep 24, 2025
6ad0411
fix(local-ads): prevent status modification during local video ad update
fulleni Sep 24, 2025
c7cc747
refactor(local_ads_management): remove unused event class
fulleni Sep 24, 2025
ab23ba8
refactor(local_ads_management): remove contentStatus from UpdateLocal...
fulleni Sep 24, 2025
dc24608
refactor(local_ads_management): remove content status selection input
fulleni Sep 24, 2025
ba68690
refactor(local_ads_management): remove status selection input
fulleni Sep 24, 2025
3ba7f49
refactor(local_ads_management): remove content status selection input
fulleni Sep 24, 2025
e90ba8d
refactor(local_ads_management): remove status selection input
fulleni Sep 24, 2025
82112ba
refactor(local_ads_management): remove status selection input
fulleni Sep 24, 2025
9956a0a
refactor(local_ads_management): remove content status selection input
fulleni Sep 24, 2025
9cc8006
refactor(local_ads_management): remove status selection input
fulleni Sep 24, 2025
030acc5
refactor(local_ads_management): remove status selection input
fulleni Sep 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class CreateLocalBannerAdBloc
super(const CreateLocalBannerAdState()) {
on<CreateLocalBannerAdImageUrlChanged>(_onImageUrlChanged);
on<CreateLocalBannerAdTargetUrlChanged>(_onTargetUrlChanged);
on<CreateLocalBannerAdStatusChanged>(_onStatusChanged);
on<CreateLocalBannerAdSubmitted>(_onSubmitted);
}

Expand All @@ -38,18 +37,6 @@ class CreateLocalBannerAdBloc
emit(state.copyWith(targetUrl: event.targetUrl));
}

void _onStatusChanged(
CreateLocalBannerAdStatusChanged event,
Emitter<CreateLocalBannerAdState> emit,
) {
emit(
state.copyWith(
contentStatus: event.status,
status: CreateLocalBannerAdStatus.initial,
),
);
}

Future<void> _onSubmitted(
CreateLocalBannerAdSubmitted event,
Emitter<CreateLocalBannerAdState> emit,
Expand All @@ -65,7 +52,7 @@ class CreateLocalBannerAdBloc
targetUrl: state.targetUrl,
createdAt: now,
updatedAt: now,
status: state.contentStatus,
status: ContentStatus.active, // Set status to active on creation
);

await _localAdsRepository.create(item: newLocalBannerAd);
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@ final class CreateLocalBannerAdTargetUrlChanged
List<Object?> get props => [targetUrl];
}

/// {@template create_local_banner_ad_status_changed}
/// Event to notify that the content status of the local banner ad has changed.
/// {@endtemplate}
final class CreateLocalBannerAdStatusChanged extends CreateLocalBannerAdEvent {
/// {@macro create_local_banner_ad_status_changed}
const CreateLocalBannerAdStatusChanged(this.status);

/// The new content status.
final ContentStatus status;

@override
List<Object?> get props => [status];
}

/// {@template create_local_banner_ad_submitted}
/// Event to request submission of the new local banner ad.
/// {@endtemplate}
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CreateLocalBannerAdState extends Equatable {
this.status = CreateLocalBannerAdStatus.initial,
this.imageUrl = '',
this.targetUrl = '',
this.contentStatus = ContentStatus.active,
this.exception,
this.createdLocalBannerAd,
});
Expand All @@ -39,9 +38,6 @@ class CreateLocalBannerAdState extends Equatable {
/// The target URL of the local banner ad.
final String targetUrl;

/// The content status of the local banner ad.
final ContentStatus contentStatus;

/// The exception encountered during form submission, if any.
final HttpException? exception;

Expand All @@ -56,15 +52,13 @@ class CreateLocalBannerAdState extends Equatable {
CreateLocalBannerAdStatus? status,
String? imageUrl,
String? targetUrl,
ContentStatus? contentStatus,
HttpException? exception,
LocalBannerAd? createdLocalBannerAd,
}) {
return CreateLocalBannerAdState(
status: status ?? this.status,
imageUrl: imageUrl ?? this.imageUrl,
targetUrl: targetUrl ?? this.targetUrl,
contentStatus: contentStatus ?? this.contentStatus,
exception: exception ?? this.exception,
createdLocalBannerAd: createdLocalBannerAd ?? this.createdLocalBannerAd,
);
Expand All @@ -75,7 +69,6 @@ class CreateLocalBannerAdState extends Equatable {
status,
imageUrl,
targetUrl,
contentStatus,
exception,
createdLocalBannerAd,
];
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class CreateLocalInterstitialAdBloc
super(const CreateLocalInterstitialAdState()) {
on<CreateLocalInterstitialAdImageUrlChanged>(_onImageUrlChanged);
on<CreateLocalInterstitialAdTargetUrlChanged>(_onTargetUrlChanged);
on<CreateLocalInterstitialAdStatusChanged>(_onStatusChanged);
on<CreateLocalInterstitialAdSubmitted>(_onSubmitted);
}

Expand All @@ -39,18 +38,6 @@ class CreateLocalInterstitialAdBloc
emit(state.copyWith(targetUrl: event.targetUrl));
}

void _onStatusChanged(
CreateLocalInterstitialAdStatusChanged event,
Emitter<CreateLocalInterstitialAdState> emit,
) {
emit(
state.copyWith(
contentStatus: event.status,
status: CreateLocalInterstitialAdStatus.initial,
),
);
}

Future<void> _onSubmitted(
CreateLocalInterstitialAdSubmitted event,
Emitter<CreateLocalInterstitialAdState> emit,
Expand All @@ -66,7 +53,7 @@ class CreateLocalInterstitialAdBloc
targetUrl: state.targetUrl,
createdAt: now,
updatedAt: now,
status: state.contentStatus,
status: ContentStatus.active, // Set status to active on creation
);

await _localAdsRepository.create(item: newLocalInterstitialAd);
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ final class CreateLocalInterstitialAdTargetUrlChanged
List<Object?> get props => [targetUrl];
}

/// {@template create_local_interstitial_ad_status_changed}
/// Event to notify that the content status of the local interstitial ad has changed.
/// {@endtemplate}
final class CreateLocalInterstitialAdStatusChanged
extends CreateLocalInterstitialAdEvent {
/// {@macro create_local_interstitial_ad_status_changed}
const CreateLocalInterstitialAdStatusChanged(this.status);

/// The new content status.
final ContentStatus status;

@override
List<Object?> get props => [status];
}

/// {@template create_local_interstitial_ad_submitted}
/// Event to request submission of the new local interstitial ad.
/// {@endtemplate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CreateLocalInterstitialAdState extends Equatable {
this.status = CreateLocalInterstitialAdStatus.initial,
this.imageUrl = '',
this.targetUrl = '',
this.contentStatus = ContentStatus.active,
this.exception,
this.createdLocalInterstitialAd,
});
Expand All @@ -39,9 +38,6 @@ class CreateLocalInterstitialAdState extends Equatable {
/// The target URL of the local interstitial ad.
final String targetUrl;

/// The content status of the local interstitial ad.
final ContentStatus contentStatus;

/// The exception encountered during form submission, if any.
final HttpException? exception;

Expand All @@ -56,15 +52,13 @@ class CreateLocalInterstitialAdState extends Equatable {
CreateLocalInterstitialAdStatus? status,
String? imageUrl,
String? targetUrl,
ContentStatus? contentStatus,
HttpException? exception,
LocalInterstitialAd? createdLocalInterstitialAd,
}) {
return CreateLocalInterstitialAdState(
status: status ?? this.status,
imageUrl: imageUrl ?? this.imageUrl,
targetUrl: targetUrl ?? this.targetUrl,
contentStatus: contentStatus ?? this.contentStatus,
exception: exception ?? this.exception,
createdLocalInterstitialAd:
createdLocalInterstitialAd ?? this.createdLocalInterstitialAd,
Expand All @@ -76,7 +70,6 @@ class CreateLocalInterstitialAdState extends Equatable {
status,
imageUrl,
targetUrl,
contentStatus,
exception,
createdLocalInterstitialAd,
];
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class CreateLocalNativeAdBloc
on<CreateLocalNativeAdSubtitleChanged>(_onSubtitleChanged);
on<CreateLocalNativeAdImageUrlChanged>(_onImageUrlChanged);
on<CreateLocalNativeAdTargetUrlChanged>(_onTargetUrlChanged);
on<CreateLocalNativeAdStatusChanged>(_onStatusChanged);
on<CreateLocalNativeAdSubmitted>(_onSubmitted);
}

Expand Down Expand Up @@ -54,18 +53,6 @@ class CreateLocalNativeAdBloc
emit(state.copyWith(targetUrl: event.targetUrl));
}

void _onStatusChanged(
CreateLocalNativeAdStatusChanged event,
Emitter<CreateLocalNativeAdState> emit,
) {
emit(
state.copyWith(
contentStatus: event.status,
status: CreateLocalNativeAdStatus.initial,
),
);
}

Future<void> _onSubmitted(
CreateLocalNativeAdSubmitted event,
Emitter<CreateLocalNativeAdState> emit,
Expand All @@ -83,7 +70,7 @@ class CreateLocalNativeAdBloc
targetUrl: state.targetUrl,
createdAt: now,
updatedAt: now,
status: state.contentStatus,
status: ContentStatus.active, // Set status to active on creation
);

await _localAdsRepository.create(item: newLocalNativeAd);
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,6 @@ final class CreateLocalNativeAdTargetUrlChanged
List<Object?> get props => [targetUrl];
}

/// {@template create_local_native_ad_status_changed}
/// Event to notify that the content status of the local native ad has changed.
/// {@endtemplate}
final class CreateLocalNativeAdStatusChanged extends CreateLocalNativeAdEvent {
/// {@macro create_local_native_ad_status_changed}
const CreateLocalNativeAdStatusChanged(this.status);

/// The new content status.
final ContentStatus status;

@override
List<Object?> get props => [status];
}

/// {@template create_local_native_ad_submitted}
/// Event to request submission of the new local native ad.
/// {@endtemplate}
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class CreateLocalNativeAdState extends Equatable {
this.subtitle = '',
this.imageUrl = '',
this.targetUrl = '',
this.contentStatus = ContentStatus.active,
this.exception,
this.createdLocalNativeAd,
});
Expand All @@ -47,9 +46,6 @@ class CreateLocalNativeAdState extends Equatable {
/// The target URL of the local native ad.
final String targetUrl;

/// The content status of the local native ad.
final ContentStatus contentStatus;

/// The exception encountered during form submission, if any.
final HttpException? exception;

Expand All @@ -70,7 +66,6 @@ class CreateLocalNativeAdState extends Equatable {
String? subtitle,
String? imageUrl,
String? targetUrl,
ContentStatus? contentStatus,
HttpException? exception,
LocalNativeAd? createdLocalNativeAd,
}) {
Expand All @@ -80,7 +75,6 @@ class CreateLocalNativeAdState extends Equatable {
subtitle: subtitle ?? this.subtitle,
imageUrl: imageUrl ?? this.imageUrl,
targetUrl: targetUrl ?? this.targetUrl,
contentStatus: contentStatus ?? this.contentStatus,
exception: exception ?? this.exception,
createdLocalNativeAd: createdLocalNativeAd ?? this.createdLocalNativeAd,
);
Expand All @@ -93,7 +87,6 @@ class CreateLocalNativeAdState extends Equatable {
subtitle,
imageUrl,
targetUrl,
contentStatus,
exception,
createdLocalNativeAd,
];
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class CreateLocalVideoAdBloc
super(const CreateLocalVideoAdState()) {
on<CreateLocalVideoAdVideoUrlChanged>(_onVideoUrlChanged);
on<CreateLocalVideoAdTargetUrlChanged>(_onTargetUrlChanged);
on<CreateLocalVideoAdStatusChanged>(_onStatusChanged);
on<CreateLocalVideoAdSubmitted>(_onSubmitted);
}

Expand All @@ -38,18 +37,6 @@ class CreateLocalVideoAdBloc
emit(state.copyWith(targetUrl: event.targetUrl));
}

void _onStatusChanged(
CreateLocalVideoAdStatusChanged event,
Emitter<CreateLocalVideoAdState> emit,
) {
emit(
state.copyWith(
contentStatus: event.status,
status: CreateLocalVideoAdStatus.initial,
),
);
}

Future<void> _onSubmitted(
CreateLocalVideoAdSubmitted event,
Emitter<CreateLocalVideoAdState> emit,
Expand All @@ -65,7 +52,7 @@ class CreateLocalVideoAdBloc
targetUrl: state.targetUrl,
createdAt: now,
updatedAt: now,
status: state.contentStatus,
status: ContentStatus.active, // Set status to active on creation
);

await _localAdsRepository.create(item: newLocalVideoAd);
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,6 @@ final class CreateLocalVideoAdTargetUrlChanged extends CreateLocalVideoAdEvent {
List<Object?> get props => [targetUrl];
}

/// {@template create_local_video_ad_status_changed}
/// Event to notify that the content status of the local video ad has changed.
/// {@endtemplate}
final class CreateLocalVideoAdStatusChanged extends CreateLocalVideoAdEvent {
/// {@macro create_local_video_ad_status_changed}
const CreateLocalVideoAdStatusChanged(this.status);

/// The new content status.
final ContentStatus status;

@override
List<Object?> get props => [status];
}

/// {@template create_local_video_ad_submitted}
/// Event to request submission of the new local video ad.
/// {@endtemplate}
Expand Down
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CreateLocalVideoAdState extends Equatable {
this.status = CreateLocalVideoAdStatus.initial,
this.videoUrl = '',
this.targetUrl = '',
this.contentStatus = ContentStatus.active,
this.exception,
this.createdLocalVideoAd,
});
Expand All @@ -39,9 +38,6 @@ class CreateLocalVideoAdState extends Equatable {
/// The target URL of the local video ad.
final String targetUrl;

/// The content status of the local video ad.
final ContentStatus contentStatus;

/// The exception encountered during form submission, if any.
final HttpException? exception;

Expand All @@ -56,15 +52,13 @@ class CreateLocalVideoAdState extends Equatable {
CreateLocalVideoAdStatus? status,
String? videoUrl,
String? targetUrl,
ContentStatus? contentStatus,
HttpException? exception,
LocalVideoAd? createdLocalVideoAd,
}) {
return CreateLocalVideoAdState(
status: status ?? this.status,
videoUrl: videoUrl ?? this.videoUrl,
targetUrl: targetUrl ?? this.targetUrl,
contentStatus: contentStatus ?? this.contentStatus,
exception: exception ?? this.exception,
createdLocalVideoAd: createdLocalVideoAd ?? this.createdLocalVideoAd,
);
Expand All @@ -75,7 +69,6 @@ class CreateLocalVideoAdState extends Equatable {
status,
videoUrl,
targetUrl,
contentStatus,
exception,
createdLocalVideoAd,
];
Expand Down
Loading
Loading

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /