Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
78ae502
initial flutter create
bparrishMines Feb 5, 2024
6847016
add repo required stuff
bparrishMines Feb 5, 2024
b49ae74
fix pubspecs and add licenses
bparrishMines Feb 5, 2024
c1067a6
remove analysis options
bparrishMines Feb 5, 2024
3f7f6bb
fix analyze warnings
bparrishMines Feb 5, 2024
b29653d
add podfile for example
bparrishMines Feb 5, 2024
c0cff54
add base platform interface classes
bparrishMines Feb 5, 2024
0801f4c
fix analyze warning
bparrishMines Feb 5, 2024
c980a80
more impls
bparrishMines Feb 5, 2024
d2bde70
use verify token
bparrishMines Feb 5, 2024
e54e56a
add app facing interface
bparrishMines Feb 5, 2024
e4bdf45
implementation of addisplaycontainer
bparrishMines Feb 6, 2024
bab7c98
connect app facing to platform interface
bparrishMines Feb 6, 2024
645753a
stuff
bparrishMines Feb 6, 2024
3c60012
add documentation
bparrishMines Feb 7, 2024
972c0ed
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 7, 2024
45e3fba
cleanup some dart
bparrishMines Feb 7, 2024
16b0a7d
add first interface test
bparrishMines Feb 8, 2024
6c1b1ad
test platform ad display container
bparrishMines Feb 8, 2024
e9f92db
ads manager delegate tests
bparrishMines Feb 8, 2024
9c8ee61
add app facing tests
bparrishMines Feb 8, 2024
8ae248a
finish tests
bparrishMines Feb 8, 2024
b6e2014
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 8, 2024
89d10a9
fix lint errors
bparrishMines Feb 8, 2024
7a82249
formatting
bparrishMines Feb 8, 2024
764d97b
fix more lints
bparrishMines Feb 8, 2024
c38bf50
update readme about development
bparrishMines Feb 8, 2024
04eadac
update podspec
bparrishMines Feb 8, 2024
4fa492e
try fix podspec again
bparrishMines Feb 8, 2024
37c3fe3
formatting
bparrishMines Feb 8, 2024
aef9c3d
fix more lints
bparrishMines Feb 8, 2024
1aa0455
try getting integration tests running
bparrishMines Feb 8, 2024
ef693a8
try gradle 8
bparrishMines Feb 8, 2024
7574d7c
maybe fix
bparrishMines Feb 8, 2024
52083c0
try fixing integration test runner
bparrishMines Feb 8, 2024
45f57b0
remove espresso
bparrishMines Feb 8, 2024
321ba99
change package name
bparrishMines Feb 9, 2024
c4ceda3
change dartintegrationteset location
bparrishMines Feb 9, 2024
c80733d
bump gradle for legacy project
bparrishMines Feb 9, 2024
ca7eb6a
for kotlin
bparrishMines Feb 9, 2024
d2e6974
add the dot
bparrishMines Feb 9, 2024
bdf655f
fix gradle
bparrishMines Feb 9, 2024
0ebe298
try fix gradle
bparrishMines Feb 9, 2024
6d135cd
lower versions for compilation
bparrishMines Feb 9, 2024
8d31250
fix import
bparrishMines Feb 9, 2024
7384eff
fix package name
bparrishMines Feb 10, 2024
78b4067
add wake lock permission
bparrishMines Feb 12, 2024
8d44136
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 12, 2024
4691fb0
add file
bparrishMines Feb 12, 2024
0870a5a
try remaking plugin
bparrishMines Feb 12, 2024
8e0c675
replace old with new
bparrishMines Feb 12, 2024
e5575bd
fix package name
bparrishMines Feb 12, 2024
e782cc3
formatting
bparrishMines Feb 12, 2024
39dcf50
try to add integration test
bparrishMines Feb 12, 2024
7ea9beb
add licenses
bparrishMines Feb 12, 2024
c90e582
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 12, 2024
78fe3b6
add test implementation runner
bparrishMines Feb 13, 2024
e191fd5
change file location
bparrishMines Feb 13, 2024
c790f46
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 13, 2024
a8785ef
fix integration test
bparrishMines Feb 13, 2024
5e6c9e7
fix integration tests again
bparrishMines Feb 13, 2024
350c216
try close system dialog
bparrishMines Feb 13, 2024
68c854e
add to int test too i guess
bparrishMines Feb 13, 2024
ec017ba
try doing nothing in int test
bparrishMines Feb 13, 2024
1fbd152
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 13, 2024
1e8a3c3
add launch android test
bparrishMines Feb 13, 2024
4222ea2
use with text and not key
bparrishMines Feb 13, 2024
9d8a55a
add a print
bparrishMines Feb 13, 2024
93bc180
add print
bparrishMines Feb 14, 2024
886bf26
add pragmas
bparrishMines Feb 14, 2024
ac4714c
fwoaie
bparrishMines Feb 14, 2024
43e2023
undo
bparrishMines Feb 14, 2024
331b163
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 14, 2024
6fc8d04
add kotlin to androidtest maybe
bparrishMines Feb 14, 2024
9de555f
undo
bparrishMines Feb 14, 2024
7fc6b5a
remove int test
bparrishMines Feb 14, 2024
ff73a65
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Feb 18, 2024
f764bfb
update dart and flutter versions
bparrishMines Feb 18, 2024
50e2f20
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Mar 6, 2024
93e62fc
PR comments
bparrishMines Mar 17, 2024
378b539
change platform to base
bparrishMines Mar 20, 2024
3579326
update platform classes with base
bparrishMines Mar 20, 2024
8c45df5
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Mar 20, 2024
630ecba
remove todos
bparrishMines Mar 20, 2024
dfbb53d
make methods required
bparrishMines Mar 26, 2024
25fc282
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Mar 26, 2024
476a4bc
since methods are required no tests are needed
bparrishMines Mar 27, 2024
1fef696
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines Mar 27, 2024
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
Prev Previous commit
Next Next commit
make methods required
  • Loading branch information
bparrishMines committed Mar 26, 2024
commit dfbb53d3fa5bff6566a33a46a92f0b8dc8f7621c
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,15 @@ abstract base class InteractiveMediaAdsPlatform {
/// Creates a new [PlatformAdsLoader].
PlatformAdsLoader createPlatformAdsLoader(
PlatformAdsLoaderCreationParams params,
) {
throw UnimplementedError(
'createPlatformAdsLoader is not implemented on the current platform.',
);
}
);

/// Creates a new [PlatformAdsManagerDelegate].
PlatformAdsManagerDelegate createPlatformAdsManagerDelegate(
PlatformAdsManagerDelegateCreationParams params,
) {
throw UnimplementedError(
'createPlatformAdsManagerDelegate is not implemented on the current platform.',
);
}
);

/// Creates a new [PlatformAdDisplayContainer].
PlatformAdDisplayContainer createPlatformAdDisplayContainer(
PlatformAdDisplayContainerCreationParams params,
) {
throw UnimplementedError(
'createPlatformAdDisplayContainer is not implemented on the current platform.',
);
}
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,10 @@ abstract base class PlatformAdsLoader {
final PlatformAdsLoaderCreationParams params;

/// Signal to the SDK that the content has completed.
Future<void> contentComplete() {
throw UnimplementedError(
'`contentComplete` is not implemented on the current platform',
);
}
Future<void> contentComplete();

/// Requests ads from a server.
Future<void> requestAds(AdsRequest request) {
throw UnimplementedError(
'`requestAds` is not implemented on the current platform',
);
}
Future<void> requestAds(AdsRequest request);
}

/// Data when ads are successfully loaded from the ad server through an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@ void main() {

testWidgets('constructor parameters are correctly passed to creation params',
(WidgetTester tester) async {
InteractiveMediaAdsPlatform.instance = TestInteractiveMediaAdsPlatform(
onCreatePlatformAdDisplayContainer: (
PlatformAdDisplayContainerCreationParams params,
) {
return TestPlatformAdDisplayContainer(
params,
onBuild: (_) => Container(),
);
},
);
InteractiveMediaAdsPlatform.instance =
TestInteractiveMediaAdsPlatform(onCreatePlatformAdDisplayContainer: (
PlatformAdDisplayContainerCreationParams params,
) {
return TestPlatformAdDisplayContainer(
params,
onBuild: (_) => Container(),
);
}, onCreatePlatformAdsLoader: (PlatformAdsLoaderCreationParams params) {
throw UnimplementedError();
}, onCreatePlatformAdsManagerDelegate: (
PlatformAdsManagerDelegateCreationParams params,
) {
throw UnimplementedError();
});

final AdDisplayContainer adDisplayContainer = AdDisplayContainer(
key: GlobalKey(),
Expand Down
2 changes: 2 additions & 0 deletions packages/interactive_media_ads/test/ads_loader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ void main() {
onAdsLoadError: (AdsLoadErrorData data) {},
),
onContentComplete: expectAsync0(() async {}),
onRequestAds: (AdsRequest request) async {},
);

final AdsLoader loader = AdsLoader.fromPlatform(adsLoader);
Expand All @@ -32,6 +33,7 @@ void main() {
onAdsLoadError: (AdsLoadErrorData data) {},
),
onRequestAds: expectAsync1((AdsRequest request) async {}),
onContentComplete: () async {},
);

final AdsLoader loader = AdsLoader.fromPlatform(adsLoader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ void main() {
(PlatformAdsManagerDelegateCreationParams params) {
return TestPlatformAdsManagerDelegate(params);
},
onCreatePlatformAdsLoader: (PlatformAdsLoaderCreationParams params) {
throw UnimplementedError();
},
onCreatePlatformAdDisplayContainer:
(PlatformAdDisplayContainerCreationParams params) {
throw UnimplementedError();
},
);

void onAdEvent(AdEvent event) {}
Expand Down
12 changes: 11 additions & 1 deletion packages/interactive_media_ads/test/ads_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ void main() {
AdsManager createAdsManager(PlatformAdsManager platformManager) {
InteractiveMediaAdsPlatform.instance = TestInteractiveMediaAdsPlatform(
onCreatePlatformAdsLoader: (PlatformAdsLoaderCreationParams params) {
return TestPlatformAdsLoader(params);
return TestPlatformAdsLoader(params,
onContentComplete: () async {},
onRequestAds: (AdsRequest request) async {});
},
onCreatePlatformAdsManagerDelegate:
(PlatformAdsManagerDelegateCreationParams params) {
throw UnimplementedError();
},
onCreatePlatformAdDisplayContainer:
(PlatformAdDisplayContainerCreationParams params) {
throw UnimplementedError();
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,14 @@ void main() {

final class ExtendsPlatformAdsLoader extends PlatformAdsLoader {
ExtendsPlatformAdsLoader(super.params) : super.implementation();

@override
Future<void> contentComplete() {
throw UnimplementedError();
}

@override
Future<void> requestAds(AdsRequest request) {
throw UnimplementedError();
}
}
33 changes: 15 additions & 18 deletions packages/interactive_media_ads/test/test_stubs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,41 @@ import 'package:interactive_media_ads/src/platform_interface/platform_interface.
final class TestInteractiveMediaAdsPlatform
extends InteractiveMediaAdsPlatform {
TestInteractiveMediaAdsPlatform({
this.onCreatePlatformAdsLoader,
this.onCreatePlatformAdsManagerDelegate,
this.onCreatePlatformAdDisplayContainer,
required this.onCreatePlatformAdsLoader,
required this.onCreatePlatformAdsManagerDelegate,
required this.onCreatePlatformAdDisplayContainer,
});

PlatformAdsLoader Function(PlatformAdsLoaderCreationParams params)?
PlatformAdsLoader Function(PlatformAdsLoaderCreationParams params)
onCreatePlatformAdsLoader;

PlatformAdsManagerDelegate Function(
PlatformAdsManagerDelegateCreationParams params,
)? onCreatePlatformAdsManagerDelegate;
) onCreatePlatformAdsManagerDelegate;

PlatformAdDisplayContainer Function(
PlatformAdDisplayContainerCreationParams params,
)? onCreatePlatformAdDisplayContainer;
) onCreatePlatformAdDisplayContainer;

@override
PlatformAdsLoader createPlatformAdsLoader(
PlatformAdsLoaderCreationParams params,
) {
return onCreatePlatformAdsLoader?.call(params) ??
super.createPlatformAdsLoader(params);
return onCreatePlatformAdsLoader(params);
}

@override
PlatformAdsManagerDelegate createPlatformAdsManagerDelegate(
PlatformAdsManagerDelegateCreationParams params,
) {
return onCreatePlatformAdsManagerDelegate?.call(params) ??
super.createPlatformAdsManagerDelegate(params);
return onCreatePlatformAdsManagerDelegate(params);
}

@override
PlatformAdDisplayContainer createPlatformAdDisplayContainer(
PlatformAdDisplayContainerCreationParams params,
) {
return onCreatePlatformAdDisplayContainer?.call(params) ??
super.createPlatformAdDisplayContainer(params);
return onCreatePlatformAdDisplayContainer(params);
}
}

Expand All @@ -66,22 +63,22 @@ final class TestPlatformAdDisplayContainer extends PlatformAdDisplayContainer {
final class TestPlatformAdsLoader extends PlatformAdsLoader {
TestPlatformAdsLoader(
super.params, {
this.onContentComplete,
this.onRequestAds,
required this.onContentComplete,
required this.onRequestAds,
}) : super.implementation();

Future<void> Function()? onContentComplete;
Future<void> Function() onContentComplete;

Future<void> Function(AdsRequest request)? onRequestAds;
Future<void> Function(AdsRequest request) onRequestAds;

@override
Future<void> contentComplete() async {
return onContentComplete?.call();
return onContentComplete();
}

@override
Future<void> requestAds(AdsRequest request) async {
return onRequestAds?.call(request);
return onRequestAds(request);
}
}

Expand Down