Skip to content

Conversation

@suthar26
Copy link
Contributor

  • 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

@suthar26 suthar26 requested a review from a team as a code owner January 21, 2026 14:18
Copilot AI review requested due to automatic review settings January 21, 2026 14:18
Copy link

Copilot AI left a 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 evalReasonToMap helper 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.

eval: map['eval'] != null
? DevCycleEvalReason.fromCodec(map['eval'])
? DevCycleEvalReason.fromCodec(
Map<String, dynamic>.from(map['eval']))
Copy link
Contributor

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

Copilot AI review requested due to automatic review settings January 21, 2026 15:05
Copy link

Copilot AI left a 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.

@suthar26 suthar26 merged commit 731fd3e into main Jan 21, 2026
4 checks passed
@suthar26 suthar26 deleted the parthsuthar/fix-eval-reason-serialization branch January 21, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants