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
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
Add interfaces to support InAppPurchaseAddition
  • Loading branch information
mvanbeusekom committed Apr 22, 2021
commit d86ac5589c675332ef896c2429c1c1f5ac83d36d
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

export 'src/in_app_purchase_addition.dart';
export 'src/in_app_purchase_addition_provider.dart';
export 'src/in_app_purchase_platform.dart';
export 'src/types/types.dart';
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.
Copy link
Contributor

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:

class InAppPurchaseSomeStoreAddition extends InAppPurchaseAddition {
    void someMethod() {}
}

class InAppPurchaseSomeStorePluginWeb {
    static void registerWith() {
         InAppPurchaseAddition = InAppPurchaseSomePlatformAddition();
     }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

static InAppPurchaseAddition? instance;
}
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>();
}