-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[interactive_media_ads] Creates and adds the interactive_media_ads plugin
#6060
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
Merged
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
78ae502
initial flutter create
bparrishMines 6847016
add repo required stuff
bparrishMines b49ae74
fix pubspecs and add licenses
bparrishMines c1067a6
remove analysis options
bparrishMines 3f7f6bb
fix analyze warnings
bparrishMines b29653d
add podfile for example
bparrishMines c0cff54
add base platform interface classes
bparrishMines 0801f4c
fix analyze warning
bparrishMines c980a80
more impls
bparrishMines d2bde70
use verify token
bparrishMines e54e56a
add app facing interface
bparrishMines e4bdf45
implementation of addisplaycontainer
bparrishMines bab7c98
connect app facing to platform interface
bparrishMines 645753a
stuff
bparrishMines 3c60012
add documentation
bparrishMines 972c0ed
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 45e3fba
cleanup some dart
bparrishMines 16b0a7d
add first interface test
bparrishMines 6c1b1ad
test platform ad display container
bparrishMines e9f92db
ads manager delegate tests
bparrishMines 9c8ee61
add app facing tests
bparrishMines 8ae248a
finish tests
bparrishMines b6e2014
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 89d10a9
fix lint errors
bparrishMines 7a82249
formatting
bparrishMines 764d97b
fix more lints
bparrishMines c38bf50
update readme about development
bparrishMines 04eadac
update podspec
bparrishMines 4fa492e
try fix podspec again
bparrishMines 37c3fe3
formatting
bparrishMines aef9c3d
fix more lints
bparrishMines 1aa0455
try getting integration tests running
bparrishMines ef693a8
try gradle 8
bparrishMines 7574d7c
maybe fix
bparrishMines 52083c0
try fixing integration test runner
bparrishMines 45f57b0
remove espresso
bparrishMines 321ba99
change package name
bparrishMines c4ceda3
change dartintegrationteset location
bparrishMines c80733d
bump gradle for legacy project
bparrishMines ca7eb6a
for kotlin
bparrishMines d2e6974
add the dot
bparrishMines bdf655f
fix gradle
bparrishMines 0ebe298
try fix gradle
bparrishMines 6d135cd
lower versions for compilation
bparrishMines 8d31250
fix import
bparrishMines 7384eff
fix package name
bparrishMines 78b4067
add wake lock permission
bparrishMines 8d44136
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 4691fb0
add file
bparrishMines 0870a5a
try remaking plugin
bparrishMines 8e0c675
replace old with new
bparrishMines e5575bd
fix package name
bparrishMines e782cc3
formatting
bparrishMines 39dcf50
try to add integration test
bparrishMines 7ea9beb
add licenses
bparrishMines c90e582
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 78fe3b6
add test implementation runner
bparrishMines e191fd5
change file location
bparrishMines c790f46
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines a8785ef
fix integration test
bparrishMines 5e6c9e7
fix integration tests again
bparrishMines 350c216
try close system dialog
bparrishMines 68c854e
add to int test too i guess
bparrishMines ec017ba
try doing nothing in int test
bparrishMines 1fbd152
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 1e8a3c3
add launch android test
bparrishMines 4222ea2
use with text and not key
bparrishMines 9d8a55a
add a print
bparrishMines 93bc180
add print
bparrishMines 886bf26
add pragmas
bparrishMines ac4714c
fwoaie
bparrishMines 43e2023
undo
bparrishMines 331b163
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 6fc8d04
add kotlin to androidtest maybe
bparrishMines 9de555f
undo
bparrishMines 7fc6b5a
remove int test
bparrishMines ff73a65
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines f764bfb
update dart and flutter versions
bparrishMines 50e2f20
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 93e62fc
PR comments
bparrishMines 378b539
change platform to base
bparrishMines 3579326
update platform classes with base
bparrishMines 8c45df5
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 630ecba
remove todos
bparrishMines dfbb53d
make methods required
bparrishMines 25fc282
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines 476a4bc
since methods are required no tests are needed
bparrishMines 1fef696
Merge branch 'main' of github.com:flutter/packages into ima
bparrishMines File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add base platform interface classes
- Loading branch information
commit c0cff54c467a2f43f142ea2926a37896b5c35744
There are no files selected for viewing
Empty file.
73 changes: 73 additions & 0 deletions
73
...ages/interactive_media_ads/lib/src/platform_interface/interactive_media_ads_platform.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | ||
|
|
||
| import 'platform_ad_display_container.dart'; | ||
| import 'platform_ads_loader.dart'; | ||
| import 'platform_ads_manager.dart'; | ||
| import 'platform_ads_manager_delegate.dart'; | ||
|
|
||
| /// Interface for a platform implementation of the Interactive Media Ads SDKs. | ||
| abstract class InteractiveMediaAdsPlatform extends PlatformInterface { | ||
| /// Creates a new [InteractiveMediaAdsPlatform]. | ||
| InteractiveMediaAdsPlatform() : super(token: _token); | ||
|
|
||
| static final Object _token = Object(); | ||
|
|
||
| static InteractiveMediaAdsPlatform? _instance; | ||
|
|
||
| /// The instance of [InteractiveMediaAdsPlatform] to use. | ||
| static InteractiveMediaAdsPlatform? get instance => _instance; | ||
|
|
||
| /// Platform-specific plugins should set this with their own platform-specific | ||
| /// class that extends [InteractiveMediaAdsPlatform] when they register | ||
| /// themselves. | ||
| static set instance(InteractiveMediaAdsPlatform? instance) { | ||
| if (instance == null) { | ||
| throw AssertionError( | ||
| 'Platform interfaces can only be set to a non-null instance', | ||
bparrishMines marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ); | ||
| } | ||
|
|
||
| PlatformInterface.verify(instance, _token); | ||
| _instance = instance; | ||
| } | ||
|
|
||
| /// Creates a new [PlatformAdsManager]. | ||
| PlatformAdsManager createPlatformAdsManager( | ||
| PlatformAdsManagerCreationParams params, | ||
| ) { | ||
| throw UnimplementedError( | ||
| 'createPlatformAdsManager is not implemented on the current platform.', | ||
| ); | ||
| } | ||
|
|
||
| /// 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.', | ||
| ); | ||
| } | ||
| } | ||
80 changes: 80 additions & 0 deletions
80
packages/interactive_media_ads/lib/src/platform_interface/platform_ad_display_container.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | ||
|
|
||
| import 'interactive_media_ads_platform.dart'; | ||
|
|
||
| /// Object specifying creation parameters for creating a | ||
| /// [PlatformAdDisplayContainer]. | ||
| /// | ||
| /// Platform specific implementations can add additional fields by extending | ||
| /// this class. | ||
| /// | ||
| /// This example demonstrates how to extend the | ||
| /// [PlatformAdDisplayContainerCreationParams] to provide additional platform | ||
| /// specific parameters. | ||
| /// | ||
| /// When extending [PlatformAdDisplayContainerCreationParams] additional | ||
| /// parameters should always accept `null` or have a default value to prevent | ||
| /// breaking changes. | ||
| /// | ||
| /// ```dart | ||
| /// class AndroidPlatformAdDisplayContainerCreationParams | ||
| /// extends PlatformAdDisplayContainerCreationParams { | ||
| /// AndroidPlatformAdDisplayContainerCreationParams._( | ||
| /// PlatformAdDisplayContainerCreationParams params, { | ||
| /// this.uri, | ||
| /// }) : super(); | ||
| /// | ||
| /// factory AndroidAdDisplayContainerCreationParams.fromPlatformAdDisplayContainerCreationParams( | ||
| /// PlatformAdDisplayContainerCreationParams params, { | ||
| /// Uri? uri, | ||
| /// }) { | ||
| /// return AndroidAdDisplayContainerCreationParams._(params, uri: uri); | ||
| /// } | ||
| /// | ||
| /// final Uri? uri; | ||
| /// } | ||
| /// ``` | ||
| @immutable | ||
| class PlatformAdDisplayContainerCreationParams { | ||
| /// Used by the platform implementation to create a new [PlatformAdDisplayContainer]. | ||
| const PlatformAdDisplayContainerCreationParams(); | ||
| } | ||
|
|
||
| /// Interface for a platform implementation of a `AdDisplayContainer`. | ||
| abstract class PlatformAdDisplayContainer extends PlatformInterface { | ||
| /// Creates a new [PlatformAdDisplayContainer] | ||
| factory PlatformAdDisplayContainer( | ||
| PlatformAdDisplayContainerCreationParams params, | ||
| ) { | ||
| assert( | ||
| InteractiveMediaAdsPlatform.instance != null, | ||
| 'A platform implementation for `interactive_media_ads` has not been set. ' | ||
| 'Please ensure that an implementation of `InteractiveMediaAdsPlatform` ' | ||
| 'has been set to `InteractiveMediaAdsPlatform.instance` before use. For ' | ||
| 'unit testing, `InteractiveMediaAdsPlatform.instance` can be set with ' | ||
| 'your own test implementation.', | ||
| ); | ||
| final PlatformAdDisplayContainer implementation = | ||
| InteractiveMediaAdsPlatform.instance! | ||
| .createPlatformAdDisplayContainer(params); | ||
| PlatformInterface.verify(implementation, _token); | ||
| return implementation; | ||
| } | ||
|
|
||
| /// Used by the platform implementation to create a new [PlatformAdDisplayContainer]. | ||
| /// | ||
| /// Should only be used by platform implementations because they can't extend | ||
| /// a class that only contains a factory constructor. | ||
| @protected | ||
| PlatformAdDisplayContainer.implementation(this.params) : super(token: _token); | ||
|
|
||
| static final Object _token = Object(); | ||
|
|
||
| /// The parameters used to initialize the [PlatformAdDisplayContainer]. | ||
| final PlatformAdDisplayContainerCreationParams params; | ||
| } |
78 changes: 78 additions & 0 deletions
78
packages/interactive_media_ads/lib/src/platform_interface/platform_ads_loader.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | ||
|
|
||
| import 'interactive_media_ads_platform.dart'; | ||
|
|
||
| /// Object specifying creation parameters for creating a [PlatformAdsLoader]. | ||
| /// | ||
| /// Platform specific implementations can add additional fields by extending | ||
| /// this class. | ||
| /// | ||
| /// This example demonstrates how to extend the | ||
| /// [PlatformAdsLoaderCreationParams] to provide additional platform specific | ||
| /// parameters. | ||
| /// | ||
| /// When extending [PlatformAdsLoaderCreationParams] additional parameters | ||
| /// should always accept `null` or have a default value to prevent breaking | ||
| /// changes. | ||
| /// | ||
| /// ```dart | ||
| /// class AndroidPlatformAdsLoaderCreationParams | ||
| /// extends PlatformAdsLoaderCreationParams { | ||
| /// AndroidPlatformAdsLoaderCreationParams._( | ||
| /// PlatformAdsLoaderCreationParams params, { | ||
| /// this.uri, | ||
| /// }) : super(); | ||
| /// | ||
| /// factory AndroidAdsLoaderCreationParams.fromPlatformAdsLoaderCreationParams( | ||
| /// PlatformAdsLoaderCreationParams params, { | ||
| /// Uri? uri, | ||
| /// }) { | ||
| /// return AndroidAdsLoaderCreationParams._(params, uri: uri); | ||
| /// } | ||
| /// | ||
| /// final Uri? uri; | ||
| /// } | ||
| /// ``` | ||
| @immutable | ||
| class PlatformAdsLoaderCreationParams { | ||
| /// Used by the platform implementation to create a new [PlatformAdsLoader]. | ||
| const PlatformAdsLoaderCreationParams(); | ||
| } | ||
|
|
||
| /// Interface for a platform implementation of a `AdsLoader`. | ||
| abstract class PlatformAdsLoader extends PlatformInterface { | ||
| /// Creates a new [PlatformAdsLoader] | ||
| factory PlatformAdsLoader( | ||
| PlatformAdsLoaderCreationParams params, | ||
| ) { | ||
| assert( | ||
| InteractiveMediaAdsPlatform.instance != null, | ||
| 'A platform implementation for `interactive_media_ads` has not been set. ' | ||
| 'Please ensure that an implementation of `InteractiveMediaAdsPlatform` ' | ||
| 'has been set to `InteractiveMediaAdsPlatform.instance` before use. For ' | ||
| 'unit testing, `InteractiveMediaAdsPlatform.instance` can be set with ' | ||
| 'your own test implementation.', | ||
| ); | ||
| final PlatformAdsLoader implementation = | ||
| InteractiveMediaAdsPlatform.instance!.createPlatformAdsLoader(params); | ||
| PlatformInterface.verify(implementation, _token); | ||
| return implementation; | ||
| } | ||
|
|
||
| /// Used by the platform implementation to create a new [PlatformAdsLoader]. | ||
| /// | ||
| /// Should only be used by platform implementations because they can't extend | ||
| /// a class that only contains a factory constructor. | ||
| @protected | ||
| PlatformAdsLoader.implementation(this.params) : super(token: _token); | ||
|
|
||
| static final Object _token = Object(); | ||
|
|
||
| /// The parameters used to initialize the [PlatformAdsLoader]. | ||
| final PlatformAdsLoaderCreationParams params; | ||
| } |
79 changes: 79 additions & 0 deletions
79
packages/interactive_media_ads/lib/src/platform_interface/platform_ads_manager.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | ||
|
|
||
| import 'interactive_media_ads_platform.dart'; | ||
|
|
||
| /// Object specifying creation parameters for creating a [PlatformAdsManager]. | ||
| /// | ||
| /// Platform specific implementations can add additional fields by extending | ||
| /// this class. | ||
| /// | ||
| /// This example demonstrates how to extend the | ||
| /// [PlatformAdsManagerCreationParams] to provide additional platform specific | ||
| /// parameters. | ||
| /// | ||
| /// When extending [PlatformAdsManagerCreationParams] additional parameters | ||
| /// should always accept `null` or have a default value to prevent breaking | ||
| /// changes. | ||
| /// | ||
| /// ```dart | ||
| /// class AndroidPlatformAdsManagerCreationParams | ||
| /// extends PlatformAdsManagerCreationParams { | ||
| /// AndroidPlatformAdsManagerCreationParams._( | ||
| /// PlatformAdsManagerCreationParams params, { | ||
| /// this.uri, | ||
| /// }) : super(); | ||
| /// | ||
| /// factory AndroidAdsManagerCreationParams.fromPlatformAdsManagerCreationParams( | ||
| /// PlatformAdsManagerCreationParams params, { | ||
| /// Uri? uri, | ||
| /// }) { | ||
| /// return AndroidAdsManagerCreationParams._(params, uri: uri); | ||
| /// } | ||
| /// | ||
| /// final Uri? uri; | ||
| /// } | ||
| /// ``` | ||
| @immutable | ||
| class PlatformAdsManagerCreationParams { | ||
| /// Used by the platform implementation to create a new [PlatformAdsManager]. | ||
| const PlatformAdsManagerCreationParams(); | ||
| } | ||
|
|
||
| /// Interface for a platform implementation of a `AdsManager`. | ||
| abstract class PlatformAdsManager extends PlatformInterface { | ||
| /// Creates a new [PlatformAdsManager] | ||
| factory PlatformAdsManager( | ||
| PlatformAdsManagerCreationParams params, | ||
| ) { | ||
| assert( | ||
| InteractiveMediaAdsPlatform.instance != null, | ||
| 'A platform implementation for `interactive_media_ads` has not been set. ' | ||
| 'Please ensure that an implementation of `InteractiveMediaAdsPlatform` ' | ||
| 'has been set to `InteractiveMediaAdsPlatform.instance` before use. For ' | ||
| 'unit testing, `InteractiveMediaAdsPlatform.instance` can be set with ' | ||
| 'your own test implementation.', | ||
| ); | ||
| final PlatformAdsManager implementation = InteractiveMediaAdsPlatform | ||
| .instance! | ||
| .createPlatformAdsManager(params); | ||
| PlatformInterface.verify(implementation, _token); | ||
| return implementation; | ||
| } | ||
|
|
||
| /// Used by the platform implementation to create a new [PlatformAdsManager]. | ||
| /// | ||
| /// Should only be used by platform implementations because they can't extend | ||
| /// a class that only contains a factory constructor. | ||
| @protected | ||
| PlatformAdsManager.implementation(this.params) : super(token: _token); | ||
|
|
||
| static final Object _token = Object(); | ||
|
|
||
| /// The parameters used to initialize the [PlatformAdsManager]. | ||
| final PlatformAdsManagerCreationParams params; | ||
| } |
81 changes: 81 additions & 0 deletions
81
packages/interactive_media_ads/lib/src/platform_interface/platform_ads_manager_delegate.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/foundation.dart'; | ||
| import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | ||
|
|
||
| import 'interactive_media_ads_platform.dart'; | ||
|
|
||
| /// Object specifying creation parameters for creating a | ||
| /// [PlatformAdsManagerDelegate]. | ||
| /// | ||
| /// Platform specific implementations can add additional fields by extending | ||
| /// this class. | ||
| /// | ||
| /// This example demonstrates how to extend the | ||
| /// [PlatformAdsManagerDelegateCreationParams] to provide additional platform | ||
| /// specific parameters. | ||
| /// | ||
| /// When extending [PlatformAdsManagerDelegateCreationParams] additional | ||
| /// parameters should always accept `null` or have a default value to prevent | ||
| /// breaking changes. | ||
| /// | ||
| /// ```dart | ||
| /// class AndroidPlatformAdsManagerDelegateCreationParams | ||
| /// extends PlatformAdsManagerDelegateCreationParams { | ||
| /// AndroidPlatformAdsManagerDelegateCreationParams._( | ||
| /// PlatformAdsManagerDelegateCreationParams params, { | ||
| /// this.uri, | ||
| /// }) : super(); | ||
| /// | ||
| /// factory AndroidAdsManagerDelegateCreationParams.fromPlatformAdsManagerDelegateCreationParams( | ||
| /// PlatformAdsManagerDelegateCreationParams params, { | ||
| /// Uri? uri, | ||
| /// }) { | ||
| /// return AndroidAdsManagerDelegateCreationParams._(params, uri: uri); | ||
| /// } | ||
| /// | ||
| /// final Uri? uri; | ||
| /// } | ||
| /// ``` | ||
| @immutable | ||
| class PlatformAdsManagerDelegateCreationParams { | ||
| /// Used by the platform implementation to create a new [PlatformAdsManagerDelegate]. | ||
| const PlatformAdsManagerDelegateCreationParams(); | ||
| } | ||
|
|
||
| /// Interface for a platform implementation of a `AdsManagerDelegate`. | ||
| abstract class PlatformAdsManagerDelegate extends PlatformInterface { | ||
| /// Creates a new [PlatformAdsManagerDelegate] | ||
| factory PlatformAdsManagerDelegate( | ||
| PlatformAdsManagerDelegateCreationParams params, | ||
| ) { | ||
| assert( | ||
| InteractiveMediaAdsPlatform.instance != null, | ||
| 'A platform implementation for `interactive_media_ads` has not been set. ' | ||
| 'Please ensure that an implementation of `InteractiveMediaAdsPlatform` ' | ||
| 'has been set to `InteractiveMediaAdsPlatform.instance` before use. For ' | ||
| 'unit testing, `InteractiveMediaAdsPlatform.instance` can be set with ' | ||
| 'your own test implementation.', | ||
| ); | ||
| final PlatformAdsManagerDelegate implementation = | ||
| InteractiveMediaAdsPlatform.instance! | ||
| .createPlatformAdsManagerDelegate(params); | ||
| PlatformInterface.verify(implementation, _token); | ||
| return implementation; | ||
| } | ||
|
|
||
| /// Used by the platform implementation to create a new | ||
| /// [PlatformAdsManagerDelegate]. | ||
| /// | ||
| /// Should only be used by platform implementations because they can't extend | ||
| /// a class that only contains a factory constructor. | ||
| @protected | ||
| PlatformAdsManagerDelegate.implementation(this.params) : super(token: _token); | ||
|
|
||
| static final Object _token = Object(); | ||
|
|
||
| /// The parameters used to initialize the [PlatformAdsManagerDelegate]. | ||
| final PlatformAdsManagerDelegateCreationParams params; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is new, maybe we should just use
base, per flutter/flutter#127396There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reimplemented
InteractiveMediaAdsPlatformand the platform interface classes with base. So I could no longer usemockitoand I had to write a stub for all the classes. Seetest/test_stubs.dart. Writing stubs for everything takes more time than using mockito, but now we no longer have to test "can't implements" and "can extend" for the platform interface classes. And I think adding new methods to the stubs should be quick moving forward.