'Type mismatch: inferred type is String? but String was expected error in projects after flutter upgrade

I updated my Flutter version to 3.0.0 and then any project I run it gives me this error

e: C:\src\.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-4.2.0\android\src\main\kotlin\io\agora\agora_rtc_engine\AgoraRtcEnginePlugin.kt: (146, 18): Type mismatch: inferred type is String? but String was expected
e: C:\src\.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-4.2.0\android\src\main\kotlin\io\agora\agora_rtc_engine\AgoraSurfaceViewFactory.kt: (15, 1): Class 'AgoraSurfaceViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: C:\src\.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-4.2.0\android\src\main\kotlin\io\agora\agora_rtc_engine\AgoraSurfaceViewFactory.kt: (20, 3): 'create' overrides nothing

e: C:\src\.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-4.2.0\android\src\main\kotlin\io\agora\agora_rtc_engine\AgoraTextureViewFactory.kt: (15, 1): Class 'AgoraTextureViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: C:\src\.pub-cache\hosted\pub.dartlang.org\agora_rtc_engine-4.2.0\android\src\main\kotlin\io\agora\agora_rtc_engine\AgoraTextureViewFactory.kt: (20, 3): 'create' overrides nothing
2

What I've tried

1- Delete pub.cache (this gives me another error besides the first one)

2- Delete my flutter folder and download it again (nothing happened same error again)

Note: it gives me this error even when I am trying to run another project that doesn't contain agora

this is my flutter doctor log:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.0, on Microsoft Windows [Version 10.0.19044.1706], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.4)
[√] Android Studio (version 4.2)
[√] VS Code (version 1.67.1)
[√] Connected device (4 available)
[√] HTTP Host Availability

any help will be appreciated and if you don't understand my question please let me know



Solution 1:[1]

the reason is that agora doesn't support flutter 3.0 so the solution is

flutter downgrade 

to the last compatible version which is 2.10.5

thanks @Merlin Attila Fejzuli

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abdelrahman M. Elmarakby