feat(platform): enable Flutter web support and update generated platform#26
feat(platform): enable Flutter web support and update generated platform#26ashi2004 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
📝 WalkthroughWalkthroughThis PR adds Flutter web, Android, and Linux platform targets to the project. It updates the Flutter revision hash in metadata and introduces platform-specific build configurations (Gradle for Android, CMake for Linux) alongside new platform runner implementations and web assets. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🧹 Nitpick comments (3)
android/build.gradle.kts (1)
11-17: Consider merging the duplicatedsubprojects {}blocks.Both blocks are valid, but combining them reduces noise and keeps project-level configuration easier to scan.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@android/build.gradle.kts` around lines 11 - 17, Merge the duplicated subprojects { } blocks into one to centralize configuration: inside a single subprojects block set val newSubprojectBuildDir = newBuildDir.dir(project.name) and assign project.layout.buildDirectory.value(newSubprojectBuildDir), then call project.evaluationDependsOn(":app"); this keeps newSubprojectBuildDir/newBuildDir and the evaluation dependency together for clarity.linux/runner/my_application.cc (1)
84-100: Consider removing commented-out code.Lines 86 and 95 contain commented-out variable declarations that are unused. While harmless, removing them would improve code cleanliness.
♻️ Suggested cleanup
// Implements GApplication::startup. static void my_application_startup(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); - // Perform any actions required at application startup. G_APPLICATION_CLASS(my_application_parent_class)->startup(application); } // Implements GApplication::shutdown. static void my_application_shutdown(GApplication* application) { - //MyApplication* self = MY_APPLICATION(object); - // Perform any actions required at application shutdown. G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@linux/runner/my_application.cc` around lines 84 - 100, Remove the unused commented-out local variable declarations in the startup and shutdown functions to clean up the code: delete the commented lines containing "MyApplication* self = MY_APPLICATION(object);" (found in my_application_startup and my_application_shutdown) so the functions only contain their implementation and the calls to G_APPLICATION_CLASS(...)->startup(application) / ->shutdown(application).linux/CMakeLists.txt (1)
10-10: Replace the scaffold APPLICATION_ID with a project-specific reverse-DNS identifier.The current value
com.example.doc_pilot_new_app_gradel_fixis a placeholder intended only for examples. Using it in a real application can cause conflicts with other locally built sample apps and prevents proper system integration. GTK/GApplication-based Linux apps require globally unique APPLICATION_IDs for correct D-Bus behavior, desktop integration, and system-wide components like notifications and GSettings. Replace it with a reverse-DNS identifier based on your project's actual namespace (e.g.,org.myorg.DocPilot).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@linux/CMakeLists.txt` at line 10, Replace the placeholder APPLICATION_ID value set(...) in the CMakeLists.txt by changing the set(APPLICATION_ID "com.example.doc_pilot_new_app_gradel_fix") entry to a project-specific reverse-DNS identifier (e.g., org.myorg.DocPilot); update the APPLICATION_ID constant to your app's real namespace so GTK/GApplication D-Bus, desktop integration and GSettings use a globally-unique ID.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@android/app/build.gradle.kts`:
- Around line 23-24: The current applicationId is a placeholder
("com.example.doc_pilot_new_app_gradel_fix") and must be replaced before
release; update the applicationId property in build.gradle.kts to your real
package identifier (e.g., com.yourcompany.yourapp) and, if you need per-flavor
IDs, implement a gradle property–driven approach by reading a project property
(e.g., project.findProperty("APP_ID") or buildConfigField/manifestPlaceholders)
and using it to set applicationId per flavor; ensure the new ID matches your
AndroidManifest and package naming conventions.
- Around line 34-37: The release buildType is incorrectly using
signingConfigs.getByName("debug"); replace this by defining and using a
dedicated release signing config in the signingConfigs block (e.g., create or
reference "release") and wire that into the release buildType instead of the
debug keystore; additionally, make the build fail fast if the release signing
config or required keystore properties are missing (throw/gradleException or
require check) so CI cannot produce a signed release with debug keys. Ensure you
update references to signingConfig = signingConfigs.getByName("debug") and the
signingConfigs block to include the new "release" entry and validation logic.
In `@android/settings.gradle.kts`:
- Around line 4-7: Add an explicit existence check for the local.properties file
before attempting to open it: verify that the File returned by
file("local.properties") exists (and is readable), and if not throw/require with
a clear message (e.g., "local.properties not found; run flutter pub get or
create local.properties") instead of calling inputStream() directly. Update the
block that calls file("local.properties").inputStream().use {
properties.load(it) } to first check existence, then load properties and
continue to read flutterSdkPath as before, keeping the require(flutterSdkPath !=
null) check.
- Around line 21-22: The Android Gradle Plugin declaration
id("com.android.application") version "8.7.0" in settings.gradle.kts is
incompatible with the project's Gradle wrapper (8.5); fix by either downgrading
the AGP version in that settings line to a Gradle-8.5-compatible AGP (e.g.,
change the version on id("com.android.application") from "8.7.0" to a supported
8.5-compatible AGP), or upgrade the Gradle wrapper to >=8.9 by updating the
distributionUrl in gradle/wrapper/gradle-wrapper.properties (ensure the wrapper
is committed and run ./gradlew wrapper to regenerate if needed) so AGP 8.7.0 is
supported.
In `@linux/CMakeLists.txt`:
- Around line 124-128: The current conditional guarding the AOT library install
uses CMAKE_BUILD_TYPE and incorrectly runs for multi-config generators; replace
the if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") ... install(FILES "${AOT_LIBRARY}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ... endif() block
with a configuration-aware install invocation that specifies configurations
explicitly (e.g. use install(FILES "${AOT_LIBRARY}" DESTINATION
"${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime CONFIGURATIONS Profile Release))
so the AOT_LIBRARY is only installed for the intended configurations at install
time.
In `@linux/runner/my_application.cc`:
- Around line 43-48: The window title is a hardcoded placeholder with a typo
("doc_pilot_new_app_gradel_fix"); update the calls to
gtk_header_bar_set_title(header_bar, ...) and gtk_window_set_title(window, ...)
to use the correct application name (e.g., "Doc Pilot" or fix
"gradel"→"gradle"), or better yet replace the literal with a shared
constant/identifier (APP_NAME) used across the app so both header_bar and window
use the same correct title.
In `@web/index.html`:
- Line 21: The HTML metadata still contains placeholder values and a typo in the
app identifier (e.g., the <meta name="description" content="A new Flutter
project."> entry and the app id that contains "gradel"); update the <meta
name="description"> content to a meaningful app description, fix the app
identifier typo (replace "gradel" with the correct identifier), and review other
related <meta> and <title> entries (lines referenced around 21, 26, 32) to
replace generic placeholders with the real app title, description, and correct
identifier before shipping.
In `@web/manifest.json`:
- Around line 2-3: Replace scaffold placeholder values in the web manifest by
updating the "name", "short_name", and "description" fields to product-facing
metadata (clear app name, concise launcher label, and user-friendly description)
and correct the "gradel" typo to "gradle"; specifically edit the "name",
"short_name", and "description" entries in manifest.json (and the duplicate
occurrences noted) so they reflect the real product name and description shown
in install prompts and app launchers.
---
Nitpick comments:
In `@android/build.gradle.kts`:
- Around line 11-17: Merge the duplicated subprojects { } blocks into one to
centralize configuration: inside a single subprojects block set val
newSubprojectBuildDir = newBuildDir.dir(project.name) and assign
project.layout.buildDirectory.value(newSubprojectBuildDir), then call
project.evaluationDependsOn(":app"); this keeps
newSubprojectBuildDir/newBuildDir and the evaluation dependency together for
clarity.
In `@linux/CMakeLists.txt`:
- Line 10: Replace the placeholder APPLICATION_ID value set(...) in the
CMakeLists.txt by changing the set(APPLICATION_ID
"com.example.doc_pilot_new_app_gradel_fix") entry to a project-specific
reverse-DNS identifier (e.g., org.myorg.DocPilot); update the APPLICATION_ID
constant to your app's real namespace so GTK/GApplication D-Bus, desktop
integration and GSettings use a globally-unique ID.
In `@linux/runner/my_application.cc`:
- Around line 84-100: Remove the unused commented-out local variable
declarations in the startup and shutdown functions to clean up the code: delete
the commented lines containing "MyApplication* self = MY_APPLICATION(object);"
(found in my_application_startup and my_application_shutdown) so the functions
only contain their implementation and the calls to
G_APPLICATION_CLASS(...)->startup(application) / ->shutdown(application).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ef56bec9-2125-4789-aeba-2704e9cd1c89
⛔ Files ignored due to path filters (6)
pubspec.lockis excluded by!**/*.lockweb/favicon.pngis excluded by!**/*.pngweb/icons/Icon-192.pngis excluded by!**/*.pngweb/icons/Icon-512.pngis excluded by!**/*.pngweb/icons/Icon-maskable-192.pngis excluded by!**/*.pngweb/icons/Icon-maskable-512.pngis excluded by!**/*.png
📒 Files selected for processing (16)
.metadataandroid/app/build.gradle.ktsandroid/build.gradle.ktsandroid/settings.gradle.ktslinux/.gitignorelinux/CMakeLists.txtlinux/flutter/CMakeLists.txtlinux/flutter/generated_plugin_registrant.cclinux/flutter/generated_plugin_registrant.hlinux/flutter/generated_plugins.cmakelinux/runner/CMakeLists.txtlinux/runner/main.cclinux/runner/my_application.cclinux/runner/my_application.hweb/index.htmlweb/manifest.json
|
Hi @ashi2004 I have reviewed your PR. Nice initiative! But we are not looking for large PRs right now. Also flutter web support is not required right now as project is in nascent stage. @SharkyBytes said that he is avoiding bulk setup related PRs. |
|
Thanks for the detailed review and feedback @dhruvi-16-me ! |
|
I agree @SharkyBytes. If you think this is the right step we can definitely go for it. Sounds right to me. |
Closes: #25
Description
Add Flutter web support (Chrome) for a faster development feedback loop and include generated platform/build updates.
Changes Made
How to Test Locally
git checkout -b feat/flutter-web-supportflutter run -d chromeImpact
Checklist
Summary by CodeRabbit
Release Notes
New Features
Build Updates