Skip to content

feat(platform): enable Flutter web support and update generated platform#26

Open
ashi2004 wants to merge 1 commit intoAOSSIE-Org:mainfrom
ashi2004:feat/flutter-web-support
Open

feat(platform): enable Flutter web support and update generated platform#26
ashi2004 wants to merge 1 commit intoAOSSIE-Org:mainfrom
ashi2004:feat/flutter-web-support

Conversation

@ashi2004
Copy link
Copy Markdown
Contributor

@ashi2004 ashi2004 commented Mar 21, 2026

Closes: #25

Description
Add Flutter web support (Chrome) for a faster development feedback loop and include generated platform/build updates.

Changes Made

  • Added web scaffolding and assets: index.html, manifest.json, favicon.png, Icon-192.png, Icon-512.png, Icon-maskable-192.png, Icon-maskable-512.png
  • Updated project metadata: .metadata
  • Updated dependency lockfile: pubspec.lock
  • Added/updated generated platform files for Android and Linux: build.gradle.kts, settings.gradle.kts, build.gradle.kts, CMakeLists.txt and other files under linux

How to Test Locally

  • Checkout the branch and run on Chrome:
    git checkout -b feat/flutter-web-support
    flutter run -d chrome
  • Verify core screens and navigation, resize viewport, and inspect with Chrome DevTools.

Impact

  • Speeds up UI/state iteration via browser hot reload and DevTools.
  • Android/iOS remain primary runtime targets; web is intended as a fast feedback/dev layer.

Checklist

  • Builds and runs on Chrome
  • Core screens render and basic flows function on web
  • No regressions on Android/iOS
  • Update docs if needed

Summary by CodeRabbit

Release Notes

  • New Features

    • Linux platform support now available for native desktop application development
    • Web platform support now available for browser deployment with application manifest configuration
    • Android build system updated with enhanced configuration and modern toolchain support
  • Build Updates

    • Flutter SDK version updated across all platform configurations

@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation frontend javascript configuration labels Mar 21, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Metadata & Version
.metadata
Updated Flutter revision hash from 8495dee1... to 35c388af... across top-level version and all platform migration entries (Android, iOS, Linux, macOS, web, Windows).
Android Gradle Configuration
android/app/build.gradle.kts, android/build.gradle.kts, android/settings.gradle.kts
Added Gradle Kotlin DSL build scripts for Android project setup including app namespace, SDK configuration, plugin management, and shared build directory remapping.
Linux CMake Build System
linux/CMakeLists.txt, linux/flutter/CMakeLists.txt, linux/flutter/generated_plugins.cmake, linux/runner/CMakeLists.txt
Added CMake configuration files for Linux platform including Flutter integration, plugin build orchestration, and runner executable build rules.
Linux Runner Implementation
linux/runner/main.cc, linux/runner/my_application.cc, linux/runner/my_application.h, linux/flutter/generated_plugin_registrant.cc, linux/flutter/generated_plugin_registrant.h
Implemented Linux GTK application wrapper with GLib/GTK bindings, plugin registration system, and main entry point for launching the Flutter app on Linux.
Web Platform Assets
web/index.html, web/manifest.json
Added web entrypoint HTML file with Flutter bootstrap integration and web app manifest with app metadata, icons, and launch configuration.
Linux Source Control
linux/.gitignore
Added flutter/ephemeral to ignore list for Linux platform-specific generated files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • DocPilot Start #1: Updates Flutter revision hashes in .metadata file across platform configurations, directly modifying the same entries introduced in this PR's metadata changes.

Poem

🐰 Hops with glee across the platforms wide,
Web, Android, Linux—now side by side!
CMake and Gradle dance in harmony,
Flutter spreads its wings so wild and free!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes: enabling Flutter web support and updating generated platform files for Android and Linux.
Linked Issues check ✅ Passed The PR successfully implements all objectives from issue #25: adds web support (web/index.html, web/manifest.json), updates generated platform files (Android Gradle scripts, Linux CMake files), and enables faster development iteration.
Out of Scope Changes check ✅ Passed All changes are directly related to adding web support and updating platform files as specified in issue #25; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🧹 Nitpick comments (3)
android/build.gradle.kts (1)

11-17: Consider merging the duplicated subprojects {} 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_fix is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f66d62 and e9b8578.

⛔ Files ignored due to path filters (6)
  • pubspec.lock is excluded by !**/*.lock
  • web/favicon.png is excluded by !**/*.png
  • web/icons/Icon-192.png is excluded by !**/*.png
  • web/icons/Icon-512.png is excluded by !**/*.png
  • web/icons/Icon-maskable-192.png is excluded by !**/*.png
  • web/icons/Icon-maskable-512.png is excluded by !**/*.png
📒 Files selected for processing (16)
  • .metadata
  • android/app/build.gradle.kts
  • android/build.gradle.kts
  • android/settings.gradle.kts
  • linux/.gitignore
  • linux/CMakeLists.txt
  • linux/flutter/CMakeLists.txt
  • linux/flutter/generated_plugin_registrant.cc
  • linux/flutter/generated_plugin_registrant.h
  • linux/flutter/generated_plugins.cmake
  • linux/runner/CMakeLists.txt
  • linux/runner/main.cc
  • linux/runner/my_application.cc
  • linux/runner/my_application.h
  • web/index.html
  • web/manifest.json

@dhruvi-16-me
Copy link
Copy Markdown

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.

@SharkyBytes
Copy link
Copy Markdown
Contributor

Thanks for the detailed review and feedback @dhruvi-16-me !
Revisiting this PR from a maintainability and developer-experience perspective..enabling Flutter web support, although a larger change, provides a significant advantage for faster UI iteration and debugging via browser tooling.
While we generally want to avoid large setup-heavy PRs at this stage, this change was also happened for Ell-ena before and for this also I think this is mostly additive and will go well with improving the development workflow without impacting existing Android/iOS targets . Also, making the project ready for more platforms early can help others to work and test things more easily in the future. So I think we can go with this. Sounds right @dhruvi-16-me?

@dhruvi-16-me
Copy link
Copy Markdown

I agree @SharkyBytes. If you think this is the right step we can definitely go for it. Sounds right to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add web target and generated platform updates for Flutter

3 participants