Skip to content

Commit

Permalink
feat: examples/alice_objectbox
Browse files Browse the repository at this point in the history
  • Loading branch information
techouse committed Jun 27, 2024
1 parent ef8bb74 commit 49c017d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class CachedAliceHttpRequest implements AliceHttpRequest {

String get dbHeaders => jsonEncode(headers);

set dbHeaders(String value) => headers = jsonDecode(value);
set dbHeaders(String value) =>
headers = jsonDecode(value) as Map<String, dynamic>;

@override
@Transient()
Expand Down Expand Up @@ -67,7 +68,8 @@ class CachedAliceHttpRequest implements AliceHttpRequest {

String get dbQueryParameters => jsonEncode(queryParameters);

set dbQueryParameters(String value) => queryParameters = jsonDecode(value);
set dbQueryParameters(String value) =>
queryParameters = jsonDecode(value) as Map<String, dynamic>;

@override
@Transient()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ class CachedAliceHttpResponse implements AliceHttpResponse {

String? get dbHeaders => jsonEncode(headers);

set dbHeaders(String? value) =>
headers = value != null ? jsonDecode(value) : null;
set dbHeaders(String? value) => headers = value != null
? (jsonDecode(value) as Map<String, dynamic>?)?.map(
(key, value) => MapEntry(key, value.toString()),
)
: null;

factory CachedAliceHttpResponse.fromAliceHttpResponse(
AliceHttpResponse response,
Expand Down

0 comments on commit 49c017d

Please sign in to comment.