Skip to content
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

Compilation error in rive_common-0.4.15 on Flutter 3.27.1 / Dart 3.6.0 #453

Open
denisnadey opened this issue Feb 10, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@denisnadey
Copy link

Description

After updating to Flutter 3.27.1 and Dart 3.6.0, I encountered a compilation error when trying to build my Flutter project with rive_common-0.4.15. The error message indicates that _YGValue must be marked as base, final, or sealed because it extends Struct.

flutter pub-cache/hosted/pub.dev/rive_common-0.4.15/lib/src/layout_engine_ffi.dart:174:7: Error: The type '_YGValue' must be 'base', 'final' or 'sealed' because the supertype 'Struct' is 'base'.

This issue appears to be related to recent changes in Dart's handling of FFI structs.

Steps To Reproduce

  1. Create a Flutter project with rive_common-0.4.15.
  2. Run flutter build or flutter run.
  3. Observe the compilation error in layout_engine_ffi.dart.

Expected behavior

The project should compile successfully without errors.

Workaround

I was able to resolve the issue locally by modifying _YGValue in layout_engine_ffi.dart and marking it as final:

final class _YGValue extends Struct {

After applying this change, the project compiled successfully without errors. However, this is just a temporary fix, and an official update in the package would be appreciated.

Device & Versions

  • Device: MacBook M3 Pro
  • OS: macOS 15.3
  • Flutter Version:
    Flutter 3.27.1 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 17025dd882 (8 weeks ago) • 2024-12-17 03:23:09 +0900
    Engine • revision cb4b5fff73
    Tools • Dart 3.6.0 • DevTools 2.40.2
    

Additional context

This issue may be due to Dart 3.6 enforcing stricter constraints on FFI structures. It would be helpful if rive_common could update its codebase to be compatible with the latest Dart versions.

Would appreciate guidance on whether this fix should be incorporated officially.

@denisnadey denisnadey added the bug Something isn't working label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant