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

ObjC code should not use "FLT" prefix #9

Open
stuartmorgan opened this issue Jun 10, 2022 · 3 comments
Open

ObjC code should not use "FLT" prefix #9

stuartmorgan opened this issue Jun 10, 2022 · 3 comments

Comments

@stuartmorgan
Copy link

The FLT prefix is the prefix used by code written and published by the Flutter project. Your code should use its own prefix, per Apple's naming conventions, to prevent collisions with Flutter code (which would cause undefined behavior at runtime).

@ollyde
Copy link
Owner

ollyde commented Jun 10, 2022

@stuartmorgan alrighty, where can I remove that?

@stuartmorgan
Copy link
Author

stuartmorgan commented Jun 10, 2022

You'll need to register your own Dart implementation of the platform interface (similar to this one), switch to your own Pigeon definition that doesn't use "FLT" as a prefix, and rename the main ObjC plugin class.

@ollyde
Copy link
Owner

ollyde commented Jun 23, 2022

@stuartmorgan it's holiday in Europe now, so we will be away until mid-august. If you need it changed more urgently because Flutter is finally introducing videos let me know.

auto-submit bot pushed a commit to flutter/packages that referenced this issue Sep 26, 2023
Renames all classes and stand-alone functions to use the `FVP` prefix instead of `FLT`.

Because ollyde/flutter_macos_video_player#9 was never fixed, there are projects in the wild using macOS classes with all of the same names as our classes, but with different implementation/behavior. If we add macOS support to the plugin as-is, developers using that package will end up with two copies of classes with the same name, which has undefined behavior at runtime in Obj-C (and in this case would very likely result in exceptions and/or crashes).

While a third-party should never have published code using the Flutter team's code prefixes, since we wanted to change prefixes anyway we can do so before adding macOS support and just avoid the issue entirely.

Since this involved regenerating Pigeon anyway, this also includes a Pigeon update.

Part of flutter/flutter#102601
HugoOlthof pushed a commit to moneybird/packages that referenced this issue Dec 13, 2023
Renames all classes and stand-alone functions to use the `FVP` prefix instead of `FLT`.

Because ollyde/flutter_macos_video_player#9 was never fixed, there are projects in the wild using macOS classes with all of the same names as our classes, but with different implementation/behavior. If we add macOS support to the plugin as-is, developers using that package will end up with two copies of classes with the same name, which has undefined behavior at runtime in Obj-C (and in this case would very likely result in exceptions and/or crashes).

While a third-party should never have published code using the Flutter team's code prefixes, since we wanted to change prefixes anyway we can do so before adding macOS support and just avoid the issue entirely.

Since this involved regenerating Pigeon anyway, this also includes a Pigeon update.

Part of flutter/flutter#102601
zhouyuanbo pushed a commit to zhouyuanbo/video_player_avfoundation_2.6.1 that referenced this issue May 24, 2024
Renames all classes and stand-alone functions to use the `FVP` prefix instead of `FLT`.

Because ollyde/flutter_macos_video_player#9 was never fixed, there are projects in the wild using macOS classes with all of the same names as our classes, but with different implementation/behavior. If we add macOS support to the plugin as-is, developers using that package will end up with two copies of classes with the same name, which has undefined behavior at runtime in Obj-C (and in this case would very likely result in exceptions and/or crashes).

While a third-party should never have published code using the Flutter team's code prefixes, since we wanted to change prefixes anyway we can do so before adding macOS support and just avoid the issue entirely.

Since this involved regenerating Pigeon anyway, this also includes a Pigeon update.

Part of flutter/flutter#102601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants