Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions splitio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 1.2.0-rc.1 (Jan 28, 2026)

# 1.1.0 (Jan 16, 2026)
- Added Web support via the `splitio_web` package, the Web implementation of `splitio` based on the Split Browser SDK `1.6.0`.

Expand Down
4 changes: 4 additions & 0 deletions splitio/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

linter:
rules:
- public_member_api_docs
2 changes: 2 additions & 0 deletions splitio/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: avoid_print

import 'package:flutter/material.dart';
import 'package:splitio/splitio.dart';

Expand Down
3 changes: 3 additions & 0 deletions splitio/lib/split_client.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:splitio_platform_interface/splitio_platform_interface.dart';

/// Abstract class representing a Split client.
abstract class SplitClient {
/// Performs an evaluation for the [featureFlagName] feature flag.
///
Expand Down Expand Up @@ -187,11 +188,13 @@ abstract class SplitClient {
Future<SplitClient> whenTimeout();
}

/// Default implementation of the Split client.
class DefaultSplitClient implements SplitClient {
final SplitioPlatform _platform;
final String _matchingKey;
final String? _bucketingKey;

/// Creates a new instance of the Split client.
DefaultSplitClient(this._platform, this._matchingKey, this._bucketingKey);

@override
Expand Down
12 changes: 12 additions & 0 deletions splitio/lib/splitio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export 'package:splitio_platform_interface/split_rollout_cache_configuration.dar
export 'package:splitio_platform_interface/split_fallback_treatment.dart';
export 'package:splitio_platform_interface/split_fallback_treatments_configuration.dart';

/// Callback function type for client readiness events.
typedef ClientReadinessCallback = void Function(SplitClient splitClient);

/// Main class for interacting with the Split Flutter SDK.
class Splitio {
final String _sdkKey;

Expand Down Expand Up @@ -114,12 +116,14 @@ class Splitio {
return client;
}

/// Gets the list of all feature flag names.
Future<List<String>> splitNames() async {
List<String> splitNames = await _platform.splitNames();

return splitNames;
}

/// Gets the list of all feature flag views.
Future<List<SplitView>> splits() async {
return _platform.splits();
}
Expand All @@ -130,14 +134,22 @@ class Splitio {
return _platform.impressionsStream();
}

/// Gets a specific feature flag view.
///
/// Returns null if the provided feature flag name is not found.
Future<SplitView?> split(String splitName) async {
return _platform.split(splitName: splitName);
}

/// Gets the user consent status.
Future<UserConsent> getUserConsent() async {
return _platform.getUserConsent();
}

/// Sets the user consent status.
///
/// [enabled] is a boolean that enables (`UserConsent.granted`)
/// or disables (`UserConsent.declined`) data collection.
Future<void> setUserConsent(bool enabled) async {
return _platform.setUserConsent(enabled);
}
Expand Down
14 changes: 5 additions & 9 deletions splitio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: splitio
description: Official plugin for split.io, the platform for controlled rollouts, which serves features to your users via feature flags to manage your complete customer experience.
version: 1.1.0
version: 1.2.0-rc.1
homepage: https://split.io/
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio/

Expand All @@ -21,14 +21,10 @@ flutter:
dependencies:
flutter:
sdk: flutter
splitio_android: # ^1.0.0
path: ../splitio_android
splitio_ios: # ^1.0.0
path: ../splitio_ios
splitio_web: # ^1.0.0
path: ../splitio_web
splitio_platform_interface: # ^2.0.0
path: ../splitio_platform_interface
splitio_android: ^1.1.0-rc.1
splitio_ios: ^1.1.0-rc.1
splitio_web: ^1.1.0-rc.1
splitio_platform_interface: ^2.1.0-rc.1
dev_dependencies:
flutter_test:
sdk: flutter
Expand Down
2 changes: 2 additions & 0 deletions splitio_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 1.1.0-rc.1 (Jan 28, 2026)

# 1.0.0 (Aug 14, 2025)
- Updated Android SDK to `5.3.1`.

Expand Down
4 changes: 4 additions & 0 deletions splitio_android/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

linter:
rules:
- public_member_api_docs
5 changes: 2 additions & 3 deletions splitio_android/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: splitio_android
description: The official Android implementation of splitio Flutter plugin.
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio_android
version: 1.0.0
version: 1.1.0-rc.1

environment:
sdk: ">=2.16.2 <4.0.0"
Expand All @@ -19,8 +19,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
splitio_platform_interface: # ^2.0.0
path: ../splitio_platform_interface
splitio_platform_interface: ^2.1.0-rc.1

dev_dependencies:
flutter_test:
Expand Down
2 changes: 2 additions & 0 deletions splitio_ios/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 1.1.0-rc.1 (Jan 28, 2026)

# 1.0.0 (Aug 14, 2025)
- iOS SDK to `3.3.2`

Expand Down
4 changes: 4 additions & 0 deletions splitio_ios/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

linter:
rules:
- public_member_api_docs
5 changes: 2 additions & 3 deletions splitio_ios/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: splitio_ios
description: The official iOS implementation of splitio Flutter plugin.
repository: https://github.com/splitio/flutter-sdk-plugin/tree/main/splitio_ios
version: 1.0.0
version: 1.1.0-rc.1

environment:
sdk: ">=2.16.2 <4.0.0"
Expand All @@ -18,8 +18,7 @@ flutter:
dependencies:
flutter:
sdk: flutter
splitio_platform_interface: # ^2.0.0
path: ../splitio_platform_interface
splitio_platform_interface: ^2.1.0-rc.1

dev_dependencies:
flutter_test:
Expand Down
2 changes: 2 additions & 0 deletions splitio_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 2.1.0-rc.1 (Jan 28, 2026)

# 2.0.0 (Aug 14, 2025)

# 2.0.0-rc.1 (Aug 14, 2025)
Expand Down
4 changes: 4 additions & 0 deletions splitio_platform_interface/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options

linter:
rules:
- public_member_api_docs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';

import 'package:splitio_platform_interface/method_call_handler.dart';

/// Handler for Split SDK events
class SplitEventMethodCallHandler implements MethodCallHandler {
static const String _eventClientReady = 'clientReady';
static const String _eventClientReadyFromCache = 'clientReadyFromCache';
Expand All @@ -24,6 +25,7 @@ class SplitEventMethodCallHandler implements MethodCallHandler {
_eventClientTimeout: false,
};

/// Creates a new instance of the Split event method call handler.
SplitEventMethodCallHandler(this._matchingKey, this._bucketingKey);

@override
Expand All @@ -48,26 +50,32 @@ class SplitEventMethodCallHandler implements MethodCallHandler {
}
}

/// Returns Future that is completed when the SDK client is ready.
Future<void> onReady() {
return _onEvent(_eventClientReady);
}

/// Returns Future that is completed when the SDK client is ready from cache.
Future<void> onReadyFromCache() {
return _onEvent(_eventClientReadyFromCache);
}

/// Returns Stream that emits when the SDK client is updated.
Stream<void> onUpdated() {
return _updateStreamCompleter.stream;
}

/// Returns Future that is completed when the SDK client times out.
Future<void> onTimeout() {
return _onEvent(_eventClientTimeout);
}

/// Cleans up resources.
void destroy() {
_updateStreamCompleter.close();
}

/// Returns Future that is completed when the specified SDK event occurs.
Future<void> _onEvent(String sdkEvent) {
if (_triggeredClientEvents.containsKey(sdkEvent) &&
_triggeredClientEvents[sdkEvent] == true) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:splitio_platform_interface/method_call_handler.dart';
import 'package:splitio_platform_interface/split_impression.dart';

/// Handles impressions method calls.
class ImpressionsMethodCallHandler extends StreamMethodCallHandler<Impression> {
final _streamController = StreamController<Impression>();

Expand Down
4 changes: 4 additions & 0 deletions splitio_platform_interface/lib/method_call_handler.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/// Abstract class for handling method calls.
abstract class MethodCallHandler {
/// Handles a method call with the given method name and arguments.
Future<void> handle(String methodName, dynamic methodArguments);
}

/// Abstract class for handling stream method calls.
abstract class StreamMethodCallHandler<T> extends MethodCallHandler {
/// Returns a stream of the given type.
Stream<T> stream();
}
4 changes: 4 additions & 0 deletions splitio_platform_interface/lib/method_channel_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const String _controlTreatment = 'control';
const SplitResult _controlResult = SplitResult(_controlTreatment, null);
const MethodChannel _methodChannel = MethodChannel('splitio');

/// Method channel platform implementation.
class MethodChannelPlatform extends SplitioPlatform {
/// Returns the method channel.
MethodChannel get methodChannel => _methodChannel;

final Map<String, SplitEventMethodCallHandler> _handlers = {};
Expand All @@ -15,6 +17,8 @@ class MethodChannelPlatform extends SplitioPlatform {
ImpressionsMethodCallHandler();

@visibleForTesting

/// Handles method calls from the platform.
Future<void> handle(MethodCall call) async {
_impressionsMethodCallHandler.handle(call.method, call.arguments);
for (MethodCallHandler handler in _handlers.values) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/// Certificate pinning configuration.
class CertificatePinningConfiguration {

final Map<String, List<String>> _pins = {};

/// Returns the pins.
Map<String, List<String>> get pins => _pins;

/// Adds a pin for the given host.
CertificatePinningConfiguration addPin(String host, String pin) {
pin = pin.trim();
if (pin.isEmpty) {
Expand All @@ -17,4 +19,4 @@ class CertificatePinningConfiguration {
_pins[host]?.add(pin);
return this;
}
}
}
37 changes: 36 additions & 1 deletion splitio_platform_interface/lib/split_configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import 'package:splitio_platform_interface/split_fallback_treatments_configurati
import 'package:splitio_platform_interface/split_sync_config.dart';
import 'package:splitio_platform_interface/split_rollout_cache_configuration.dart';

/// Split configuration.
class SplitConfiguration {
/// The configuration map.
final Map<String, dynamic> configurationMap = {};

/// Initializes the Split configuration.
Expand Down Expand Up @@ -211,16 +213,49 @@ class SplitConfiguration {
}
}

/// Impressions mode.
enum ImpressionsMode {
/// Debug impressions mode.
debug,

/// Optimized impressions mode.
optimized,

/// None impressions mode.
none,
}

/// User consent.
enum UserConsent {
/// The user grants consent for tracking events and impressions. The SDK sends them to Split cloud.
granted,

/// The user declines consent for tracking events and impressions. The SDK does not send them to Split cloud.
declined,

/// The user neither grants nor declines consent for tracking events and impressions. The SDK tracks them in its
/// internal storage, and eventually either sends them or not if the consent status is updated to 'GRANTED' or
/// 'DECLINED' respectively. The status can be updated at any time with the `UserConsent.setStatus` factory method.
unknown,
}

enum SplitLogLevel { verbose, debug, info, warning, error, none }
/// Split log level.
enum SplitLogLevel {
/// Verbose log level.
verbose,

/// Debug log level.
debug,

/// Info log level.
info,

/// Warning log level.
warning,

/// Error log level.
error,

/// None log level.
none
}
5 changes: 5 additions & 0 deletions splitio_platform_interface/lib/split_evaluation_options.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
import 'dart:collection';

/// Options for evaluation.
class EvaluationOptions {
final Map<String, dynamic> _properties;

/// Impression properties.
Map<String, dynamic> get properties => UnmodifiableMapView(_properties);

/// Creates a new EvaluationOptions instance.
const EvaluationOptions.empty() : _properties = const {};

/// Creates a new EvaluationOptions instance.
factory EvaluationOptions([Map<String, dynamic> properties = const {}]) {
return EvaluationOptions._(
Map.unmodifiable(Map<String, dynamic>.from(properties)));
}

/// Converts the EvaluationOptions to a JSON map.
Map<String, dynamic> toJson() => {
'properties': _properties,
};
Expand Down
Loading