diff --git a/lib/src/Evaluator/condition_evaluator.dart b/lib/src/Evaluator/condition_evaluator.dart index 67d27e4..0e9bf68 100644 --- a/lib/src/Evaluator/condition_evaluator.dart +++ b/lib/src/Evaluator/condition_evaluator.dart @@ -223,7 +223,8 @@ class GBConditionEvaluator { for (var key in conditionValue.keys) { // If evalOperatorCondition(key, attributeValue, value) // is false, return false - if (!evalOperatorCondition(key, attributeValue, conditionValue[key])) { + if (!evalOperatorCondition( + key, attributeValue, conditionValue[key])) { return false; } } @@ -284,7 +285,8 @@ class GBConditionEvaluator { if (operator == "\$exists") { if (conditionValue.toString() == 'false' && attributeValue == null) { return true; - } else if (conditionValue.toString() == 'true' && attributeValue != null) { + } else if (conditionValue.toString() == 'true' && + attributeValue != null) { return true; } } diff --git a/lib/src/Evaluator/feature_evaluator.dart b/lib/src/Evaluator/feature_evaluator.dart index b5e6b76..f1b87cb 100644 --- a/lib/src/Evaluator/feature_evaluator.dart +++ b/lib/src/Evaluator/feature_evaluator.dart @@ -27,7 +27,8 @@ class GBFeatureEvaluator { if (rule.condition != null) { final attr = context.attributes ?? {}; - if (!GBConditionEvaluator().evaluateCondition(attr, rule.condition!)) { + if (!GBConditionEvaluator() + .evaluateCondition(attr, rule.condition!)) { continue; } } @@ -83,7 +84,8 @@ class GBFeatureEvaluator { } // Return (value = defaultValue or null, source = defaultValue) return _prepareResult( - value: targetFeature.defaultValue, source: GBFeatureSource.defaultValue); + value: targetFeature.defaultValue, + source: GBFeatureSource.defaultValue); } /// This is a helper method to create a FeatureResult object. diff --git a/lib/src/Model/features.dart b/lib/src/Model/features.dart index f14f9ff..4378b49 100644 --- a/lib/src/Model/features.dart +++ b/lib/src/Model/features.dart @@ -18,7 +18,8 @@ class GBFeature { /// The default value (should use null if not specified) dynamic defaultValue; - factory GBFeature.fromJson(Map value) => _$GBFeatureFromJson(value); + factory GBFeature.fromJson(Map value) => + _$GBFeatureFromJson(value); } /// Rule object consists of various definitions to apply to calculate feature value diff --git a/lib/src/Utils/extension.dart b/lib/src/Utils/extension.dart index f7c904d..852b592 100644 --- a/lib/src/Utils/extension.dart +++ b/lib/src/Utils/extension.dart @@ -46,9 +46,11 @@ extension StringComparison on String { bool operator >(String other) => calculateWeight() > other.calculateWeight(); - bool operator >=(String other) => calculateWeight() >= other.calculateWeight(); + bool operator >=(String other) => + calculateWeight() >= other.calculateWeight(); - bool operator <=(String other) => calculateWeight() <= other.calculateWeight(); + bool operator <=(String other) => + calculateWeight() <= other.calculateWeight(); int calculateWeight() { final List data = codeUnits; diff --git a/lib/src/Utils/gb_utils.dart b/lib/src/Utils/gb_utils.dart index 73ae916..09228fd 100644 --- a/lib/src/Utils/gb_utils.dart +++ b/lib/src/Utils/gb_utils.dart @@ -58,7 +58,8 @@ class GBUtils { ///This converts and experiment's coverage and variation weights into an array /// of bucket ranges. - List getBucketRanges(int numVariations, double coverage, List weights) { + List getBucketRanges( + int numVariations, double coverage, List weights) { List bucketRange; // Clamp the value of coverage to between 0 and 1 inclusive. @@ -71,7 +72,8 @@ class GBUtils { } // Default to equal weights if the sum is not equal 1 (or close enough when // rounding errors are factored in): - final weightsSum = targetWeights.fold(0, (previousValue, element) => previousValue + element); + final weightsSum = targetWeights.fold( + 0, (previousValue, element) => previousValue + element); if (weightsSum < 0.99 || weightsSum > 1.01) { targetWeights = getEqualWeights(numVariations); } @@ -109,7 +111,8 @@ class GBUtils { final end = namespace[2]; if (start != null && end != null) { - return GBNameSpace(title, double.parse(start.toString()), double.parse(end.toString())); + return GBNameSpace(title, double.parse(start.toString()), + double.parse(end.toString())); } } diff --git a/pubspec.yaml b/pubspec.yaml index 901cfd8..3becba9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: growthbook_sdk_flutter -description: GrowthBook SDK for flutter. +description: An open-source feature flagging and experimentation platform that makes it simple to alter features and execute A/B testing. version: 1.1.0+2 homepage: https://github.com/alippo-com/GrowthBook-SDK-Flutter diff --git a/test/common_test/gb_condition_test.dart b/test/common_test/gb_condition_test.dart index a571406..179e8b7 100644 --- a/test/common_test/gb_condition_test.dart +++ b/test/common_test/gb_condition_test.dart @@ -19,7 +19,8 @@ void main() { if (item is List) { final localItem = item; final evaluator = GBConditionEvaluator(); - final result = evaluator.evaluateCondition(localItem[2], localItem[1]); + final result = + evaluator.evaluateCondition(localItem[2], localItem[1]); final status = localItem[0].toString() + "\nExpected Result - " + localItem[3].toString() +