Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
652e5d1
Draft implementation of platform interface
mvanbeusekom Apr 2, 2021
bcb9d38
Added finishPurchase and restorePurchase definitions
mvanbeusekom Apr 7, 2021
23230c9
Fix formatting and analysis warnings
mvanbeusekom Apr 7, 2021
8f17a42
Added missing license header
mvanbeusekom Apr 7, 2021
164700d
Fix analysis warnings
mvanbeusekom Apr 7, 2021
af8a388
Fix typo
mvanbeusekom Apr 7, 2021
a7693bd
Remove NoopInAppPurchase implementation
mvanbeusekom Apr 7, 2021
b80a3c6
Apply feedback from PR
mvanbeusekom Apr 8, 2021
12943f4
Removed obsolete PurchaseException
mvanbeusekom Apr 9, 2021
7ec5de6
Updated documentation per feedback
mvanbeusekom Apr 14, 2021
3ceef85
Fixed formatting
mvanbeusekom Apr 14, 2021
efc6120
Allow nullable instance
mvanbeusekom Apr 14, 2021
e7f6216
Updated readme to reflect setInstance method
mvanbeusekom Apr 14, 2021
24d305b
Removed platform specific comments
mvanbeusekom Apr 21, 2021
d86ac55
Add interfaces to support InAppPurchaseAddition
mvanbeusekom Apr 21, 2021
9eb358f
Document the addition functionality in README
mvanbeusekom Apr 22, 2021
33d1118
Added example code and documentation
mvanbeusekom Apr 22, 2021
a7cea45
Reference the platform_interface
mvanbeusekom Apr 22, 2021
06dd755
Initial iOS specific implementation
mvanbeusekom Apr 26, 2021
21eb28d
Added StoreKit wrapper tests
mvanbeusekom Apr 26, 2021
0cfc84d
Added unit-tests
mvanbeusekom Apr 28, 2021
fa22504
Merged with master
mvanbeusekom Apr 28, 2021
2f115b9
Clean up code
mvanbeusekom Apr 28, 2021
d4e9165
Added initial version of README.md
mvanbeusekom Apr 28, 2021
61dc0be
Fixed typo
mvanbeusekom Apr 28, 2021
a33f312
Added support for iOS specific features
mvanbeusekom Apr 28, 2021
415ac5e
Add missing license headers
mvanbeusekom Apr 28, 2021
70e89cd
Added feedback from PR
mvanbeusekom Apr 29, 2021
99fde90
Merge remote-tracking branch 'upstream/master' into iap_federated_ios…
mvanbeusekom Apr 29, 2021
0474545
Unblock tree by solving lint error
mvanbeusekom Apr 30, 2021
4f723de
Merge remote-tracking branch 'upstream/master' into iap_federated_ios…
mvanbeusekom May 5, 2021
125c490
Implement registerPlatform method for iOS implementation
mvanbeusekom May 5, 2021
67a491f
Added TODO comment to add example
mvanbeusekom May 5, 2021
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
Remove NoopInAppPurchase implementation
  • Loading branch information
mvanbeusekom committed Apr 22, 2021
commit a7693bd9ade48245e05ad61ee99b31a6b77e6feb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'dart:async';

import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'noop_in_app_purchase.dart';
import 'types/types.dart';

/// The interface that implementations of in_app_purchase must implement.
Expand All @@ -22,10 +21,18 @@ abstract class InAppPurchasePlatform extends PlatformInterface {

static final Object _token = Object();

static InAppPurchasePlatform _instance = NoopInAppPurchase();
static InAppPurchasePlatform? _instance;

/// The default instance of [InAppPurchasePlatform] to use.
static InAppPurchasePlatform get instance => _instance;
static InAppPurchasePlatform get instance {
final InAppPurchasePlatform? platform = _instance;
if (platform == null) {
throw UnimplementedError(
'No platform specific implementation set. Please make sure you set the `instance` with a valid platform specific implementation of the `InAppPurchasePlatform` class.');
}

return platform;
}

/// Platform-specific plugins should set this with their own platform-specific
/// class that extends [InAppPurchasePlatform] when they register themselves.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@

import 'package:flutter_test/flutter_test.dart';
import 'package:in_app_purchase_platform_interface/in_app_purchase_platform_interface.dart';
import 'package:in_app_purchase_platform_interface/src/noop_in_app_purchase.dart';
import 'package:mockito/mockito.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();

group('$InAppPurchasePlatform', () {
test('$NoopInAppPurchase is the default instance', () {
expect(InAppPurchasePlatform.instance, isA<NoopInAppPurchase>());
test('default instance is null and throws unimplemented exception', () {
expect(() => InAppPurchasePlatform.instance, throwsUnimplementedError);
});

test('Cannot be implemented with `implements`', () {
Expand Down