Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to Semantic Versioning.

## [Unreleased]

### Changed
- **BREAKING refactor(enums)**: remove demo enums from production code
- **refactor**(remote_configs): remove unused ad platform identifiers
- **fix(tests)**: remove demo enums from tests


## [1.6.0] - 2025-12-31

### Added
Expand Down
9 changes: 0 additions & 9 deletions lib/src/enums/ad_platform_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,4 @@
enum AdPlatformType {
/// Google AdMob platform.
admob,

/// Represents a placeholder ad platform for demonstration purposes.
///
/// When this type is selected, it indicates that ads should be handled
/// by a demo-specific ad provider, which displays placeholder ads ,
/// without initializing external ad SDKs. This is
/// primarily used in the `demo` environment to avoid actual ad network
/// calls and `MissingPluginException` on unsupported platforms (e.g., web).
demo,
}
4 changes: 0 additions & 4 deletions lib/src/enums/analytics_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,4 @@ enum AnalyticsProvider {
/// Mixpanel Analytics.
@JsonValue('mixpanel')
mixpanel,

/// A demo provider that logs events to the console for development.
@JsonValue('demo')
demo,
}
5 changes: 0 additions & 5 deletions lib/src/fixtures/remote_configs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ final remoteConfigsFixturesData = <RemoteConfig>[
bannerAdId: 'ca-app-pub-3940256099942544/6300978111',
interstitialAdId: 'ca-app-pub-3940256099942544/1033173712',
),
AdPlatformType.demo: AdPlatformIdentifiers(
nativeAdId: '_',
bannerAdId: '_',
interstitialAdId: '_',
),
},
feedAdConfiguration: FeedAdConfiguration(
enabled: true,
Expand Down
5 changes: 1 addition & 4 deletions lib/src/models/config/ad_config.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/src/models/config/analytics_config.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions test/src/enums/ad_platform_type_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ void main() {
group('AdPlatformType', () {
test('has correct string values', () {
expect(AdPlatformType.admob.name, 'admob');
expect(AdPlatformType.demo.name, 'demo');
});

test('can be created from string values', () {
expect(AdPlatformType.values.byName('admob'), AdPlatformType.admob);
expect(AdPlatformType.values.byName('demo'), AdPlatformType.demo);
});

test('has correct toString representation', () {
expect(AdPlatformType.admob.toString(), 'AdPlatformType.admob');
expect(AdPlatformType.demo.toString(), 'AdPlatformType.demo');
});
});
}
7 changes: 1 addition & 6 deletions test/src/enums/analytics_provider_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ void main() {
test('has correct values', () {
expect(
AnalyticsProvider.values,
containsAll([
AnalyticsProvider.firebase,
AnalyticsProvider.mixpanel,
AnalyticsProvider.demo,
]),
containsAll([AnalyticsProvider.firebase, AnalyticsProvider.mixpanel]),
);
});

test('has correct string names', () {
expect(AnalyticsProvider.firebase.name, 'firebase');
expect(AnalyticsProvider.mixpanel.name, 'mixpanel');
expect(AnalyticsProvider.demo.name, 'demo');
});

test('can be created from string names', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ void main() {
group('Equatable', () {
test('should equate two identical instances', () {
const instance1 = AdClickedPayload(
adProvider: AdPlatformType.demo,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
adPlacement: 'bottom',
);
const instance2 = AdClickedPayload(
adProvider: AdPlatformType.demo,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
adPlacement: 'bottom',
);
Expand All @@ -38,8 +38,8 @@ void main() {
test('should not equate instances with different properties', () {
const instance1 = payload;
const instance2 = AdClickedPayload(
adProvider: AdPlatformType.demo,
adType: AdType.native,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
adPlacement: 'feed',
);
expect(instance1, isNot(equals(instance2)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ void main() {
group('Equatable', () {
test('should equate two identical instances', () {
const instance1 = AdImpressionPayload(
adProvider: AdPlatformType.demo,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
adPlacement: 'bottom',
);
const instance2 = AdImpressionPayload(
adProvider: AdPlatformType.demo,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
adPlacement: 'bottom',
);
Expand All @@ -38,8 +38,8 @@ void main() {
test('should not equate instances with different properties', () {
const instance1 = payload;
const instance2 = AdImpressionPayload(
adProvider: AdPlatformType.demo,
adType: AdType.native,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
adPlacement: 'feed',
);
expect(instance1, isNot(equals(instance2)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ void main() {
group('Equatable', () {
test('should equate two identical instances', () {
const instance1 = AdLoadFailedPayload(
adProvider: AdPlatformType.demo,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
errorCode: 404,
);
const instance2 = AdLoadFailedPayload(
adProvider: AdPlatformType.demo,
adProvider: AdPlatformType.admob,
adType: AdType.banner,
errorCode: 404,
);
Expand All @@ -38,7 +38,7 @@ void main() {
test('should not equate instances with different properties', () {
const instance1 = payload;
const instance2 = AdLoadFailedPayload(
adProvider: AdPlatformType.demo,
adProvider: AdPlatformType.admob,
adType: AdType.interstitial,
errorCode: 2,
);
Expand Down
4 changes: 0 additions & 4 deletions test/src/models/config/analytics_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ void main() {
test('should not equate instances with different properties', () {
final config1 = analyticsConfigFixture.copyWith();
final config2 = analyticsConfigFixture.copyWith(enabled: false);
final config3 = analyticsConfigFixture.copyWith(
activeProvider: AnalyticsProvider.demo,
);
expect(config1, isNot(equals(config2)));
expect(config1, isNot(equals(config3)));
});

test('props list should contain all relevant fields', () {
Expand Down
1 change: 0 additions & 1 deletion test/src/models/config/remote_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ void main() {
final newFeatures = remoteConfigFixture.features.copyWith(
analytics: remoteConfigFixture.features.analytics.copyWith(
enabled: false,
activeProvider: AnalyticsProvider.demo,
),
);

Expand Down
Loading