-
Notifications
You must be signed in to change notification settings - Fork 7
fix: update eval reason serialization #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
suthar26
commented
Jan 21, 2026
- update serialization to return a proper map
- add tests for the eval reason testing
- add eval reason to the example app to test it with anon user, targeted user and not targeted user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the eval reason serialization in the DevCycle Flutter SDK by ensuring platform channel data is properly converted to maps before deserialization. The changes address type compatibility issues between native platforms (iOS/Android) and Flutter's Dart code.
Changes:
- Updated Android plugin to serialize EvalReason objects to proper Map format using a new
evalReasonToMaphelper method - Modified Dart code to explicitly convert platform channel maps to
Map<String, dynamic>before deserialization - Added comprehensive test coverage for eval reason serialization/deserialization on both Dart and Kotlin sides
- Updated Android build configuration (AGP 8.7.0, Kotlin 2.1.0, Gradle 8.9, compileSdk 35)
- Enhanced example app to display EvalReason information for testing
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/dvc_variable.dart | Added explicit Map conversion for eval field from platform channel |
| test/variable_test.dart | Added comprehensive tests for eval reason handling with various scenarios |
| test/eval_reason_test.dart | New test file with dedicated DevCycleEvalReason deserialization tests |
| android/src/main/kotlin/.../DevCycleFlutterClientSdkPlugin.kt | Added evalReasonToMap method to properly serialize EvalReason objects |
| android/src/test/kotlin/.../DevCycleFlutterClientSdkPluginTest.kt | New unit tests for EvalReason serialization (contains critical bugs) |
| example/lib/main.dart | Added UI components to display and test EvalReason information |
| example/android/settings.gradle | Updated Android Gradle Plugin to 8.7.0 and Kotlin to 2.1.0 |
| example/android/gradle/wrapper/gradle-wrapper.properties | Updated Gradle wrapper to version 8.9 |
| example/android/app/build.gradle | Updated compileSdk and targetSdk to 35, dependency versions updated |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...c/test/kotlin/com/devcycle/devcycle_flutter_client_sdk/DevCycleFlutterClientSdkPluginTest.kt
Outdated
Show resolved
Hide resolved
...c/test/kotlin/com/devcycle/devcycle_flutter_client_sdk/DevCycleFlutterClientSdkPluginTest.kt
Outdated
Show resolved
Hide resolved
...c/test/kotlin/com/devcycle/devcycle_flutter_client_sdk/DevCycleFlutterClientSdkPluginTest.kt
Outdated
Show resolved
Hide resolved
...c/test/kotlin/com/devcycle/devcycle_flutter_client_sdk/DevCycleFlutterClientSdkPluginTest.kt
Outdated
Show resolved
Hide resolved
...c/test/kotlin/com/devcycle/devcycle_flutter_client_sdk/DevCycleFlutterClientSdkPluginTest.kt
Outdated
Show resolved
Hide resolved
...c/test/kotlin/com/devcycle/devcycle_flutter_client_sdk/DevCycleFlutterClientSdkPluginTest.kt
Outdated
Show resolved
Hide resolved
| eval: map['eval'] != null | ||
| ? DevCycleEvalReason.fromCodec(map['eval']) | ||
| ? DevCycleEvalReason.fromCodec( | ||
| Map<String, dynamic>.from(map['eval'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good choice with the dynamic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.