Skip to content

Commit d23ac50

Browse files
committed
feat(local_ads_management): add content status to native ad creation state
- Add ContentStatus enum to track draft or active state of the ad - Update CreateLocalNativeAdState with contentStatus field and default value - Modify copyWith method to include contentStatus parameter - Update props list to include contentStatus for equality checks
1 parent fd9d6fd commit d23ac50

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_native_ad_state.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class CreateLocalNativeAdState extends Equatable {
2929
this.targetUrl = '',
3030
this.exception,
3131
this.createdLocalNativeAd,
32+
this.contentStatus = ContentStatus.draft,
3233
});
3334

3435
/// The current status of the form submission.
@@ -52,6 +53,9 @@ class CreateLocalNativeAdState extends Equatable {
5253
/// The local native ad created upon successful submission.
5354
final LocalNativeAd? createdLocalNativeAd;
5455

56+
/// The content status of the ad (draft or active).
57+
final ContentStatus contentStatus;
58+
5559
/// Returns true if the form is valid, false otherwise.
5660
bool get isFormValid =>
5761
title.isNotEmpty &&
@@ -68,6 +72,7 @@ class CreateLocalNativeAdState extends Equatable {
6872
String? targetUrl,
6973
HttpException? exception,
7074
LocalNativeAd? createdLocalNativeAd,
75+
ContentStatus? contentStatus,
7176
}) {
7277
return CreateLocalNativeAdState(
7378
status: status ?? this.status,
@@ -77,6 +82,7 @@ class CreateLocalNativeAdState extends Equatable {
7782
targetUrl: targetUrl ?? this.targetUrl,
7883
exception: exception ?? this.exception,
7984
createdLocalNativeAd: createdLocalNativeAd ?? this.createdLocalNativeAd,
85+
contentStatus: contentStatus ?? this.contentStatus,
8086
);
8187
}
8288

@@ -89,5 +95,6 @@ class CreateLocalNativeAdState extends Equatable {
8995
targetUrl,
9096
exception,
9197
createdLocalNativeAd,
98+
contentStatus,
9299
];
93100
}

0 commit comments

Comments
 (0)