This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[in_app_purchase] Implementation of platform interface #3781
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
652e5d1
Draft implementation of platform interface
mvanbeusekom bcb9d38
Added finishPurchase and restorePurchase definitions
mvanbeusekom 23230c9
Fix formatting and analysis warnings
mvanbeusekom 8f17a42
Added missing license header
mvanbeusekom 164700d
Fix analysis warnings
mvanbeusekom af8a388
Fix typo
mvanbeusekom a7693bd
Remove NoopInAppPurchase implementation
mvanbeusekom b80a3c6
Apply feedback from PR
mvanbeusekom 12943f4
Removed obsolete PurchaseException
mvanbeusekom 7ec5de6
Updated documentation per feedback
mvanbeusekom 3ceef85
Fixed formatting
mvanbeusekom efc6120
Allow nullable instance
mvanbeusekom e7f6216
Updated readme to reflect setInstance method
mvanbeusekom 24d305b
Removed platform specific comments
mvanbeusekom d86ac55
Add interfaces to support InAppPurchaseAddition
mvanbeusekom 9eb358f
Document the addition functionality in README
mvanbeusekom 33d1118
Added example code and documentation
mvanbeusekom 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 interfaces to support InAppPurchaseAddition
- Loading branch information
commit d86ac5589c675332ef896c2429c1c1f5ac83d36d
There are no files selected for viewing
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
11 changes: 11 additions & 0 deletions
11
.../in_app_purchase/in_app_purchase_platform_interface/lib/src/in_app_purchase_addition.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,11 @@ | ||
| // 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. | ||
|
|
||
| // ignore: avoid_classes_with_only_static_members | ||
| /// The interface that platform implementations must implement when they want to | ||
| /// provide platform specific in_app_purchase features. | ||
| abstract class InAppPurchaseAddition { | ||
| /// The instance containing the platform specific in_app_purchase features. | ||
| static InAppPurchaseAddition? instance; | ||
| } | ||
17 changes: 17 additions & 0 deletions
17
...urchase/in_app_purchase_platform_interface/lib/src/in_app_purchase_addition_provider.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,17 @@ | ||
| // 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:in_app_purchase_platform_interface/src/in_app_purchase_addition.dart'; | ||
|
|
||
| /// The [InAppPurchaseAdditionProvider] is responsible for providing | ||
| /// a platform specific [InAppPurchaseAddition]. | ||
| /// | ||
| /// [InAppPurchaseAddition] implementation contain platform specific | ||
| /// features that are not available from the platform idiomatic | ||
| /// [InAppPurchasePlatform] API. | ||
| abstract class InAppPurchaseAdditionProvider { | ||
| /// Provides a platform specific implementation of the [InAppPurchaseAddition] | ||
| /// class. | ||
| T getPlatformAddition<T extends InAppPurchaseAddition>(); | ||
| } |
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.
Let's add a code example of how a platform can add "Addition".
Something like:
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.
Done