Skip to content

Commit 3439f4d

Browse files
committed
feat(local_ads_management): add contentStatus to CreateLocalBannerAdState
- Add ContentStatus enum to track draft or active state of the ad - Include contentStatus in CreateLocalBannerAdState properties - Update copyWith method to support contentStatus - Set default contentStatus to ContentStatus.draft in constructor
1 parent 042dd12 commit 3439f4d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/local_ads_management/bloc/create_local_ads/create_local_banner_ad_state.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class CreateLocalBannerAdState extends Equatable {
2727
this.targetUrl = '',
2828
this.exception,
2929
this.createdLocalBannerAd,
30+
this.contentStatus = ContentStatus.draft,
3031
});
3132

3233
/// The current status of the form submission.
@@ -44,6 +45,9 @@ class CreateLocalBannerAdState extends Equatable {
4445
/// The local banner ad created upon successful submission.
4546
final LocalBannerAd? createdLocalBannerAd;
4647

48+
/// The content status of the ad (draft or active).
49+
final ContentStatus contentStatus;
50+
4751
/// Returns true if the form is valid, false otherwise.
4852
bool get isFormValid => imageUrl.isNotEmpty && targetUrl.isNotEmpty;
4953

@@ -54,13 +58,15 @@ class CreateLocalBannerAdState extends Equatable {
5458
String? targetUrl,
5559
HttpException? exception,
5660
LocalBannerAd? createdLocalBannerAd,
61+
ContentStatus? contentStatus,
5762
}) {
5863
return CreateLocalBannerAdState(
5964
status: status ?? this.status,
6065
imageUrl: imageUrl ?? this.imageUrl,
6166
targetUrl: targetUrl ?? this.targetUrl,
6267
exception: exception ?? this.exception,
6368
createdLocalBannerAd: createdLocalBannerAd ?? this.createdLocalBannerAd,
69+
contentStatus: contentStatus ?? this.contentStatus,
6470
);
6571
}
6672

@@ -71,5 +77,6 @@ class CreateLocalBannerAdState extends Equatable {
7177
targetUrl,
7278
exception,
7379
createdLocalBannerAd,
80+
contentStatus,
7481
];
7582
}

0 commit comments

Comments
 (0)