I tried to implement your wallpaper apply method, but it fails, even tried cloning the reWall but the same error.
e: D:\projects\amazewall_wallpapers\android\app\src\main\kotlin\com\example\amazewall_wallpapers\MainActivity.kt: (24, 44): Type mismatch: inferred type is MainActivity but FlutterEngine was expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 30s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 31.5s
Exception: Gradle task assembleDebug failed with exit code 1