Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 69f289f

Browse files
committed
Add interfaces to support InAppPurchaseAddition
1 parent 3d6e5fe commit 69f289f

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

packages/in_app_purchase/in_app_purchase_platform_interface/lib/in_app_purchase_platform_interface.dart

+2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
export 'src/in_app_purchase_addition.dart';
6+
export 'src/in_app_purchase_addition_provider.dart';
57
export 'src/in_app_purchase_platform.dart';
68
export 'src/types/types.dart';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// ignore: avoid_classes_with_only_static_members
6+
/// The interface that platform implementations must implement when they want to
7+
/// provide platform specific in_app_purchase features.
8+
abstract class InAppPurchaseAddition {
9+
/// The instance containing the platform specific in_app_purchase features.
10+
static InAppPurchaseAddition? instance;
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
import 'package:in_app_purchase_platform_interface/src/in_app_purchase_addition.dart';
6+
7+
/// The [InAppPurchaseAdditionProvider] is responsible for providing
8+
/// a platform specific [InAppPurchaseAddition].
9+
///
10+
/// [InAppPurchaseAddition] implementation contain platform specific
11+
/// features that are not available from the platform idiomatic
12+
/// [InAppPurchasePlatform] API.
13+
abstract class InAppPurchaseAdditionProvider {
14+
/// Provides a platform specific implementation of the [InAppPurchaseAddition]
15+
/// class.
16+
T getPlatformAddition<T extends InAppPurchaseAddition>();
17+
}

0 commit comments

Comments
 (0)