Skip to content

Commit

Permalink
Refactor to BridgeInstantiable
Browse files Browse the repository at this point in the history
  • Loading branch information
super-bryan committed Jan 23, 2024
1 parent 4e9dcf8 commit 28c6ecd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
7 changes: 3 additions & 4 deletions lib/src/public/Experiment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import 'package:superwallkit_flutter/src/public/Variant.dart';
/// they are in a holdout group.
///
/// To learn more, read [our docs](https://docs.superwall.com/docs/home#how-it-work
class Experiment {
final BridgeId bridgeId;

Experiment({required this.bridgeId});
class Experiment extends BridgeIdInstantiable {
static const BridgeClass bridgeClass = "ExperimentBridge";
Experiment({BridgeId? bridgeId}): super(bridgeClass: bridgeClass, bridgeId: bridgeId);

Future<String> get id async {
final id = await bridgeId.communicator.invokeBridgeMethod('getId');
Expand Down
7 changes: 3 additions & 4 deletions lib/src/public/PaywallInfo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import 'package:superwallkit_flutter/src/public/Product.dart';
import 'package:superwallkit_flutter/src/public/Survey.dart';

/// Contains information about a paywall.
class PaywallInfo {
final BridgeId bridgeId;

PaywallInfo({required this.bridgeId});
class PaywallInfo extends BridgeIdInstantiable {
static const BridgeClass bridgeClass = "PaywallInfoBridge";
PaywallInfo({BridgeId? bridgeId}): super(bridgeClass: bridgeClass, bridgeId: bridgeId);

/// The identifier set for this paywall in the Superwall dashboard.
Future<String> get identifier async {
Expand Down
1 change: 0 additions & 1 deletion lib/src/public/SubscriptionStatus.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/services.dart';
import 'package:superwallkit_flutter/src/private/BridgingCreator.dart';

/// An enum representing the subscription status of the user.
Expand Down

0 comments on commit 28c6ecd

Please sign in to comment.