Skip to content

Commit

Permalink
feat: Support transient identities and traits
Browse files Browse the repository at this point in the history
  • Loading branch information
khvn26 committed Oct 11, 2024
1 parent d206633 commit c190db7
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 65 deletions.
22 changes: 10 additions & 12 deletions lib/src/model/feature.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions lib/src/model/flag.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 9 additions & 10 deletions lib/src/model/flags_and_traits.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/src/model/identity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ part 'identity.g.dart';
/// Personalized user
@JsonSerializable()
class Identity {
@JsonKey(includeIfNull: false)
final bool? transient;
final String identifier;

const Identity({
this.transient,
required this.identifier,
});

Expand Down
25 changes: 17 additions & 8 deletions lib/src/model/identity.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/src/model/trait.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ part 'trait.g.dart';
@JsonSerializable()
class Trait {
final int? id;
@JsonKey(includeIfNull: false)
final bool? transient;
@JsonKey(name: 'trait_key')
final String key;
@JsonKey(name: 'trait_value', fromJson: _fromJson, toJson: _toJson)
final dynamic value;

Trait({
this.id,
this.transient,
required this.key,
required this.value,
});
Expand Down
45 changes: 27 additions & 18 deletions lib/src/model/trait.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: >-
Core Package of Flutter Client SDK for https://www.flagsmith.com/, Flagsmith is 100% Open
Source. Host yourself or let us take care of the hosting.
version: 3.0.0
version: 3.1.0
homepage: https://github.com/Flagsmith/flagsmith-flutter-core
repository: https://github.com/Flagsmith/flagsmith-flutter-core
issue_tracker: https://github.com/Flagsmith/flagsmith-flutter-core/issues
Expand All @@ -14,13 +14,13 @@ environment:
dependencies:
crypto: ^3.0.1
encrypt: ^5.0.1
rxdart: ^0.27.5
rxdart: ^0.28.0
json_annotation: ^4.0.1
collection: ^1.15.0
dev_dependencies:
flutter_lints: ^1.0.0
test: ">=1.16.0 <=1.17.12"
http_mock_adapter: ^0.3.2
flutter_lints: ^5.0.0
test: ^1.25.8
http_mock_adapter: ^0.6.1
mockito: ^5.0.15
json_serializable: ^4.1.3
json_serializable: ^6.8.0
build_runner: ^2.1.2

0 comments on commit c190db7

Please sign in to comment.