flagr 1.1.8+3

  • Readme
  • Changelog
  • Installing
  • 43

Flagr Client for Dart #

Flagr is a feature flagging, A/B testing and dynamic configuration microservice. The base path for all the APIs is "/api/v1".

version license likes sdk-version

MIT codecov build check

Requirements #

Dart 1.20.0 or later OR Flutter 0.0.20 or later

Installation & Usage #

dependencies:
  flagr: ^1.1.8

Getting Started #

Please follow the installation procedure and then run the following:

import 'package:flagr/api.dart';


var api_instance = new ConstraintApi();
var flagID = 789; // int | numeric ID of the flag
var segmentID = 789; // int | numeric ID of the segment
var body = new CreateConstraintRequest(); // CreateConstraintRequest | create a constraint

try {
    var result = api_instance.createConstraint(flagID, segmentID, body);
    print(result);
} catch (e) {
    print("Exception when calling ConstraintApi->createConstraint: $e\n");
}

Documentation for API Endpoints #

All URIs are relative to http://localhost/api/v1

ClassMethodHTTP requestDescription
ConstraintApicreateConstraintpost /flags/{flagID}/segments/{segmentID}/constraints
ConstraintApideleteConstraintdelete /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
ConstraintApifindConstraintsget /flags/{flagID}/segments/{segmentID}/constraints
ConstraintApiputConstraintput /flags/{flagID}/segments/{segmentID}/constraints/{constraintID}
DistributionApifindDistributionsget /flags/{flagID}/segments/{segmentID}/distributions
DistributionApiputDistributionsput /flags/{flagID}/segments/{segmentID}/distributions
EvaluationApipostEvaluationpost /evaluation
EvaluationApipostEvaluationBatchpost /evaluation/batch
ExportApigetExportEvalCacheJSONget /export/eval_cache/json
ExportApigetExportSqliteget /export/sqlite
FlagApicreateFlagpost /flags
FlagApideleteFlagdelete /flags/{flagID}
FlagApifindFlagsget /flags
FlagApigetFlagget /flags/{flagID}
FlagApigetFlagEntityTypesget /flags/entity_types
FlagApigetFlagSnapshotsget /flags/{flagID}/snapshots
FlagApiputFlagput /flags/{flagID}
FlagApisetFlagEnabledput /flags/{flagID}/enabled
HealthApigetHealthget /health
SegmentApicreateSegmentpost /flags/{flagID}/segments
SegmentApideleteSegmentdelete /flags/{flagID}/segments/{segmentID}
SegmentApifindSegmentsget /flags/{flagID}/segments
SegmentApiputSegmentput /flags/{flagID}/segments/{segmentID}
SegmentApiputSegmentsReorderput /flags/{flagID}/segments/reorder
VariantApicreateVariantpost /flags/{flagID}/variants
VariantApideleteVariantdelete /flags/{flagID}/variants/{variantID}
VariantApifindVariantsget /flags/{flagID}/variants
VariantApiputVariantput /flags/{flagID}/variants/{variantID}

Documentation For Models #

Documentation For Authorization #

All endpoints do not require authorization.

Author #

Minsu Lee ( amond@amond.net )

1.1.8+3 #

  • export

1.1.8+2 #

  • flagr 1.1.8

1.1.8+1 #

  • flagr 1.1.8

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flagr: ^1.1.8+3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flagr/flagr.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
6
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
43
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web

Because:

  • package:flagr/flagr.dart that imports:
  • package:flagr/api.dart that imports:
  • package:flagr/api/variant_api.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:flagr/flagr.dart that imports:
  • package:flagr/api.dart that imports:
  • package:flagr/api/variant_api.dart that imports:
  • dart:io

Health suggestions

Fix lib/serializers.dart. (-25 points)

Analysis of lib/serializers.dart reported 78 hints, including:

line 6 col 8: Unused import: 'package:built_value/json_object.dart'.

line 8 col 8: Unused import: 'package:time_machine/time_machine.dart'.

line 38 col 17: Avoid const keyword.

line 69 col 37: Avoid const keyword.

line 69 col 44: Avoid const keyword.

Fix lib/api.dart. (-6.31 points)

Analysis of lib/api.dart reported 13 hints, including:

line 35 col 29: Unnecessary new keyword.

line 40 col 18: Unnecessary new keyword.

line 54 col 13: Do not pass null as an argument where a closure is expected.

line 61 col 13: Do not pass null as an argument where a closure is expected.

line 68 col 13: Do not pass null as an argument where a closure is expected.

Fix lib/api/flag_api.dart. (-3.93 points)

Analysis of lib/api/flag_api.dart reported 8 hints, including:

line 2 col 8: Unused import: 'dart:io'.

line 12 col 8: Unused import: 'package:flagr/model/error.dart'.

line 164 col 37: Avoid const keyword.

line 164 col 44: Avoid const keyword.

line 271 col 37: Avoid const keyword.

Fix additional 8 files with analysis or formatting issues. (-13.90 points)

Additional issues in the following files:

  • lib/api/distribution_api.dart (6 hints)
  • lib/api/constraint_api.dart (4 hints)
  • lib/api/segment_api.dart (4 hints)
  • lib/api/variant_api.dart (4 hints)
  • lib/api/evaluation_api.dart (3 hints)
  • lib/api/export_api.dart (3 hints)
  • lib/api/health_api.dart (3 hints)
  • lib/auth/auth.dart (1 hint)

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flagr.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
built_collection ^4.3.2 4.3.2
built_value ^7.1.0 7.1.0
dio ^3.0.9 3.0.9
meta ^1.1.8 1.2.2 1.3.0-nullsafety
time_machine ^0.9.12 0.9.12
Transitive dependencies
charcode 1.1.3
collection 1.14.13 1.15.0-nullsafety
fixnum 0.10.11
http_parser 3.1.4
matcher 0.12.8
path 1.7.0
quiver 2.1.3
resource 2.1.7
source_span 1.7.0
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0 1.3.0-nullsafety
Dev dependencies
build_runner ^1.7.1
build_test ^1.0.0
built_value_generator ^7.1.0
mock_web_server ^4.1.1
pedantic ^1.9.0
test ^1.14.6
test_coverage ^0.4.1