Undefined name 'platformViewRegistry'
Version of the agora_rtc_engine
6.5.x 6.3.x
Platforms affected
- [ ] Android
- [ ] iOS
- [ ] macOS
- [ ] Windows
- [x] Web
Steps to reproduce
https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/pull/2273
Expected results
no error
Actual results
from @arthurbcd
The ui.platformViewRegistry (currently deprecated) will be removed on the next flutter stable release. Which throws: Error: Undefined name 'platformViewRegistry'. The solution is to use dart:ui_web instead of dart:ui, both available in flutter.
Code sample
Code sample
[Paste your code here]
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
[Paste your output here]
by @arthurbcd https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/pull/2273
revert in https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/pull/2290
HI. I got that issue on flutter web 3.32.0 I hope it will be fixed soon
Same here, some plugins used it (flutter_super_html_viewer) and it doesnt work anymore on the web :
html_content_viewer_widget_web.dart:261:8: Error: Undefined name 'platformViewRegistry'.
ui.platformViewRegistry
^^^^^^^^^^^^^^^^^^^^
I think i found a solution. Simply change import dart:ui as ui; to import 'dart:ui_web' as ui; in /lib/src/impl/platform/web/global_video_view_controller_platform_web.dart
Not sure why this does not cause any problems before.
working on PR
As mentioned in #2290
This has been fixed before, but sadly, since the separation of dart:ui and dart:ui_web was introduced in flutter 3.13.0, this fix won't meet the bottom requirement 3.0.0.
For users on ^3.32.0, following the fix in 77b68ae358973d47b49e15ac06ab9ae60cba05b4 and saving it locally should work.
@maple135790 Thank you very much for your summary. We will schedule an upgrade for compatibility versions and fix this issue in the near future.
As mentioned in #2290
This has been fixed before, but sadly, since the separation of
dart:uianddart:ui_webwas introduced in flutter 3.13.0, this fix won't meet the bottom requirement 3.0.0.For users on ^3.32.0, following the fix in 77b68ae and saving it locally should work.
Hi @elihaialgoaitech @tototo23 , If you need to work with the latest Flutter version, we recommend forking a private repository and cherry-picking the fix commit as a temporary solution. We will notify you once we complete the compatibility upgrade in our main repository.
Hello, we've had this problem for a long time, on every build we have to change dart:ui_web manually. When do you have a plan to change it in your main repository??
"we recommend forking a private repository and cherry-picking the fix commit as a temporary solution"
Which one? From where?
This issue needs to be fixed on Agora's side ASAP. I'm not going to pay for a service that requires a patchy workaround to use.