Skip to content

[#288] Upgrade Flutter version and library versions#291

Open
ducbm051291 wants to merge 13 commits into
developfrom
chore/288-upgrade-flutter-and-deps
Open

[#288] Upgrade Flutter version and library versions#291
ducbm051291 wants to merge 13 commits into
developfrom
chore/288-upgrade-flutter-and-deps

Conversation

@ducbm051291
Copy link
Copy Markdown

@ducbm051291 ducbm051291 commented Apr 23, 2026

What happened 👀

This pull request upgrades the Flutter template to a newer Flutter stable version and aligns the template dependencies and platform tooling with the latest setup used in a company project.

Changes included

  • Upgrade Flutter from 3.38.10 to 3.41.6
  • Update Dart/Flutter package constraints and refresh key library versions in both:
    • sample/
    • bricks/template/__brick__/
  • Replace flutter_config with flutter_dotenv
  • Add tracked placeholder environment files:
    • .env
    • .env.staging
  • Remove no-longer-used .env.sample files
  • Modernize Android build setup:
    • AGP 8.11.1
    • Kotlin 2.2.20
    • Gradle 8.14
    • Java 17
  • Raise iOS deployment target to 13.0
  • Remove old iOS/Android config that was only needed by flutter_config
  • Update CI workflows to use the newer Flutter and Java versions
  • Refresh generated lockfiles and Mason permission bundle
  • Clean up stale ignore rules and template leftovers based on cleanup patterns from a company project.

Insight 📝

Updating the template at the tooling level provides the most long-term value because every newly generated app inherits the latest Flutter runtime, dependency versions, and platform configuration from the start.

This approach was chosen because the latest project already reflects the company’s current Flutter setup, providing a strong reference for what should be brought back into the template. I used that project to align package versions, platform requirements, and build tooling, where the changes were reusable in a generic template.

I also applied cleanup lessons from a company project that removed outdated scaffolding rather than preserving legacy compatibility layers. Following that approach here helped keep the template simpler after the migration from flutter_config to flutter_dotenv.

Notes

  • flutter_dotenv is now used for runtime environment loading instead of the older flutter_config flow.
  • iOS was raised to 13.0 because the newer Flutter toolchain and pod resolution required it.
  • pod install succeeds, but CocoaPods still reports the existing flavored custom-xcconfig warning. This warning is pre-existing in the template structure and does not block installation.

How to test

Run the following from the repository root:

cd sample
fvm flutter pub get
fvm flutter packages pub run build_runner build --delete-conflicting-outputs
fvm flutter analyze
fvm flutter test
fvm flutter build apk --debug --flavor staging

Proof Of Work 📹

CI/CD successfully**

Verification logs

$ mason make template -c mason-config.json -o /tmp/flutter-templates-check-20260423
✓ Generated 149 files.

$ cd /tmp/flutter-templates-check-20260423
$ /Users/david/Documents/flutter-templates/.fvm/flutter_sdk/bin/dart format --set-exit-if-changed .
Formatted 31 files (0 changed) in 0.03 seconds.

$ cd sample
$ fvm flutter analyze
No issues found! (ran in 4.7s)

$ cd sample
$ fvm flutter test
00:00 +4: All tests passed!

$ cd sample
$ fvm flutter build apk --debug --flavor staging
✓ Built build/app/outputs/flutter-apk/app-staging-debug.apk

$ cd sample/ios
$ bundle _2.3.10_ exec pod install
Pod installation complete! There are 6 dependencies from the Podfile and 6 total pods installed.




<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Added Flutter Version Manager (FVM) configuration for pinned SDK versions
  * Introduced environment variable support via `.env` and `.env.staging` files

* **Chores**
  * Updated Flutter SDK to 3.41.6 (main) and 3.38.10 (template/sample)
  * Updated Java runtime from version 11 to 17 and Gradle to 8.14
  * Raised iOS minimum deployment target to 13.0
  * Updated Android compilation SDK to 35 with Java 17 targeting
  * Refreshed all dependencies to newer versions
  * Migrated from `flutter_config` to `flutter_dotenv` for environment management
  * Modernized Android build configuration to plugin-based setup

* **Documentation**
  * Updated README with Flutter 3.41.6 and Dart 3.8+ requirements and setup instructions
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

- Align CI and docs with Flutter 3.38.10; require Dart 3.8+ in pubspecs
- Bump dio, retrofit, freezed, injectable, get_it, and related dev tooling
- Update Mason brick constraints for mason_cli 0.1.x; relax hooks SDK for Mason
- Migrate Dio usage to DioException; fix l10n imports; refresh locks and generated code
@ducbm051291 ducbm051291 self-assigned this Apr 23, 2026
@ducbm051291 ducbm051291 linked an issue Apr 23, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@github-actions[bot] has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c748c957-2cdc-43b0-9bc9-211d8a651866

📥 Commits

Reviewing files that changed from the base of the PR and between 2ce64d9 and 164e1d0.

📒 Files selected for processing (15)
  • bricks/template/__brick__/.env
  • bricks/template/__brick__/.env.staging
  • bricks/template/__brick__/README.md
  • bricks/template/__brick__/android/settings.gradle
  • bricks/template/__brick__/integration_test/utils/test_util.dart
  • bricks/template/__brick__/lib/app/screens/home/home_screen.dart
  • bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart
  • sample/.env
  • sample/.env.staging
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • sample/.gitignore
  • sample/README.md
  • sample/android/settings.gradle
  • sample/integration_test/utils/test_util.dart
  • sample/lib/app/screens/home/home_screen.dart
📝 Walkthrough

Walkthrough

Comprehensive upgrade of Flutter SDK versions and core dependencies across the project, codebase templates, and sample app. Switches environment variable management from flutter_config to flutter_dotenv, modernizes Android build system from legacy buildscript to Gradle plugins, raises iOS minimum deployment target to 13.0, updates Java toolchain to Temurin 17, and migrates Dio error handling to newer API.

Changes

Cohort / File(s) Summary
Flutter Version Manager & .gitignore
.fvmrc, .gitignore, sample/.gitignore, bricks/template/__brick__/.gitignore, bricks/template/__brick__/ios/.gitignore, sample/ios/.gitignore
Introduces .fvmrc pinning Flutter 3.41.6; updates .gitignore entries to target root-level env files, exclude localization artifacts, and add Android/iOS build directories.
Root CI/CD Workflows
.github/workflows/android_deploy_production.yml, .github/workflows/android_deploy_production_to_playstore.yml, .github/workflows/android_deploy_staging.yml, .github/workflows/ios_deploy_staging_to_firebase.yml, .github/workflows/ios_deploy_to_app_store.yml, .github/workflows/ios_deploy_to_testflight.yml, .github/workflows/test.yml
Updates Flutter SDK from 3.10.5 to 3.41.6 across all workflows; upgrades Java from AdoptOpenJDK 11 to Temurin 17; updates flutter-action from v1 to v2 where applicable.
Environment Variable Configuration
bricks/template/__brick__/.env, bricks/template/__brick__/.env.sample, bricks/template/__brick__/.env.staging, sample/.env, sample/.env.sample, sample/.env.staging
Creates environment config files with REST_API_ENDPOINT and SECRET values; removes content from .env.sample in favor of bundled .env files per flavor.
Template Brick Workflows
bricks/template/__brick__/.github/workflows/android_deploy_production.yml, bricks/template/__brick__/.github/workflows/android_deploy_production_to_playstore.yml, bricks/template/__brick__/.github/workflows/android_deploy_staging.yml, bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml, bricks/template/__brick__/.github/workflows/ios_deploy_to_app_store.yml, bricks/template/__brick__/.github/workflows/ios_deploy_to_testflight.yml, bricks/template/__brick__/.github/workflows/test.yml
Updates Flutter SDK to 3.38.10 (or 3.41.6 for iOS staging); updates flutter-action version for iOS workflows.
Android Build System Modernization
bricks/template/__brick__/android/build.gradle, bricks/template/__brick__/android/app/build.gradle, bricks/template/__brick__/android/app/proguard-rules.pro, bricks/template/__brick__/android/settings.gradle, bricks/template/__brick__/android/gradle.properties, bricks/template/__brick__/android/gradle/wrapper/gradle-wrapper.properties, sample/android/build.gradle, sample/android/app/build.gradle, sample/android/app/proguard-rules.pro, sample/android/settings.gradle, sample/android/gradle.properties, sample/android/gradle/wrapper/gradle-wrapper.properties
Migrates from legacy buildscript to modern Gradle plugins configuration; removes custom env/dotenv setup; upgrades Java compilation target to 17; increases JVM heap size to 4g and enables parallel task execution; upgrades Gradle wrapper from 7.5 to 8.14; adopts newer Android DSL properties (compileSdk, targetSdk).
iOS Platform Configuration
bricks/template/__brick__/ios/Flutter/AppFrameworkInfo.plist, bricks/template/__brick__/ios/Flutter/Debug.xcconfig, bricks/template/__brick__/ios/Flutter/Release.xcconfig, bricks/template/__brick__/ios/Podfile, bricks/template/__brick__/ios/Runner.xcodeproj/project.pbxproj, bricks/template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme, bricks/template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme, bricks/template/__brick__/.metadata, sample/ios/Flutter/AppFrameworkInfo.plist, sample/ios/Flutter/Debug.xcconfig, sample/ios/Flutter/Release.xcconfig, sample/ios/Podfile, sample/ios/Runner.xcodeproj/project.pbxproj, sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme, sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme, sample/.metadata
Raises minimum iOS deployment target from 11.0 to 13.0; removes pre-action shell scripts that generated temporary xcconfig files; updates Flutter metadata revision; adds dynamic deployment target enforcement in Podfile.
Dependency Framework Migration
bricks/template/__brick__/lib/env.dart, bricks/template/__brick__/lib/main.dart, bricks/template/__brick__/integration_test/utils/test_util.dart, bricks/template/__brick__/lib/app/screens/home/home_screen.dart, sample/lib/env.dart, sample/lib/main.dart, sample/integration_test/utils/test_util.dart, sample/lib/app/screens/home/home_screen.dart
Switches environment variable loading from flutter_config to flutter_dotenv; implements dynamic .env file selection based on package name; updates localization imports to project-generated l10n/app_localizations.dart.
Dio Error Handling Migration
bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart, bricks/template/__brick__/lib/di/interceptor/app_interceptor.dart, sample/lib/domain/exceptions/network_exceptions.dart, sample/lib/di/interceptor/app_interceptor.dart
Migrates from DioError/DioErrorType to DioException/DioExceptionType; refines error differentiation for socket exceptions vs. other failures; adds explicit handling for badCertificate and connectionError cases.
Riverpod Legacy Import Updates
bricks/template/__brick__/lib/app/screens/home/home_view_model.dart, bricks/template/__brick__/lib/app/screens/home/home_screen.dart, sample/lib/app/screens/home/home_view_model.dart, sample/lib/app/screens/home/home_screen.dart
Updates Riverpod imports from flutter_riverpod to flutter_riverpod/legacy.dart for compatibility.
Pubspec & Dependency Updates
bricks/template/__brick__/pubspec.yaml, sample/pubspec.yaml, bricks/permission_handler/brick.yaml, bricks/permission_handler/__brick__/{{~ _pubspec_dependency.yaml}}, bricks/template/brick.yaml, bricks/template/hooks/pubspec.yaml
Raises Dart SDK minimum from 3.0.0 to 3.8.0; replaces flutter_config with flutter_dotenv; upgrades major/minor versions of core libraries (state management, DI, routing, serialization, utilities); adds .env and .env.staging to Flutter assets while excluding from flutter_gen; updates Mason environment constraints to ^0.1.2.
Widget & Constructor Refactoring
bricks/template/__brick__/lib/app/screens/home/home_view_model.dart, bricks/template/__brick__/lib/domain/models/user.dart, bricks/template/__brick__/lib/data/remote/models/responses/user_response.dart, bricks/template/__brick__/lib/di/module/network_module.dart, sample/lib/app/screens/home/home_view_model.dart, sample/lib/domain/models/user.dart, sample/lib/data/remote/models/responses/user_response.dart, sample/lib/di/module/network_module.dart, bricks/template/__brick__/lib/main.dart, sample/lib/main.dart
Modernizes constructor syntax using super.key and refactors Key? parameters; compresses multi-line constructor and method calls into single-line expressions; updates MaterialApp.router to use routerConfig property; reformats widget argument lists with trailing commas.
Storage & Secure Storage Configuration
bricks/template/__brick__/lib/di/module/storage_module.dart, sample/lib/di/module/storage_module.dart
Removes explicit AndroidOptions(encryptedSharedPreferences: true) from FlutterSecureStorage initialization, using default constructor instead.
Test Infrastructure Updates
bricks/template/__brick__/test/mocks/generate_mocks.dart, bricks/template/__brick__/test/mocks/data/remote/models/responses/user_response_mocks.dart, bricks/template/__brick__/test/data/repositories/credential_repository_test.dart, bricks/template/__brick__/test/domain/usecases/get_users_use_case_test.dart, bricks/template/__brick__/test/app/screens/home/home_view_model_test.dart, sample/test/mocks/generate_mocks.dart, sample/test/mocks/data/remote/models/responses/user_response_mocks.dart, sample/test/data/repositories/credential_repository_test.dart, sample/test/domain/usecases/get_users_use_case_test.dart, sample/test/app/screens/home/home_view_model_test.dart
Removes DioError from mock generation; replaces MockDioError() with concrete DioException(RequestOptions(path: '/users')); updates PackageInfo.setMockInitialValues with correct package name; refactors test invocation formatting and mock setup structure.
Integration Test Formatting
bricks/template/__brick__/integration_test/real_app_test.dart, bricks/template/__brick__/integration_test/screens/home_screen_test.dart, sample/integration_test/real_app_test.dart, sample/integration_test/screens/home_screen_test.dart
Reformats expect and tester.pumpWidget calls from single-line to multi-line invocations with trailing commas; maintains same widget finders and match expectations.
Documentation Updates
README.md, bricks/template/__brick__/README.md, sample/README.md
Documents Flutter 3.41.6 and Dart 3.8+ requirements; adds troubleshooting guidance for Dart version mismatches; updates env setup instructions to reference bundled .env files instead of creating from .env.sample; includes FVM upgrade command sequence.
Permission Handler Bundle & Brick Configuration
bricks/permission_handler/__brick__/lib/utils/wrappers/permission_wrapper.dart, bricks/template/hooks/bundles/permission_handler_bundle.dart, bricks/permission_handler/__brick__/{{~ _Podfile_build_configurations }}
Updates permission_handler dependency from ^10.2.0 to ^12.0.1; reformats permission request callback; updates iOS Podfile build configuration comment examples from PermissionGroup.* to Permission.*; regenerates embedded bundle with updated base64 configuration.
Miscellaneous Logic & Formatting
bricks/template/__brick__/lib/di/provider/dio_provider.dart, bricks/template/__brick__/lib/domain/usecases/get_users_use_case.dart, sample/lib/di/provider/dio_provider.dart, sample/lib/domain/usecases/get_users_use_case.dart, bricks/template/__brick__/lib/utils/wrappers/permission_wrapper.dart, sample/lib/utils/wrappers/permission_wrapper.dart
Reformats interceptor and use-case method calls with multi-line argument structures; maintains identical logic and behavior; adds trailing commas for consistency.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Hops through versions with delight,
Flutter 3.41.6 shines so bright!
Dotenv replaces config with grace,
Java 17 sets a faster pace,
Gradle plugins modernize the way,
Happy whiskers celebrate the update day! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title '[#288] Upgrade Flutter version and library versions' clearly and accurately summarizes the main change: upgrading Flutter and library versions, aligning with the primary objective.
Linked Issues check ✅ Passed The pull request comprehensively addresses the linked issue #288 by upgrading Flutter from 3.38.10 to 3.41.6, updating library versions across sample and template projects, and aligning platform tooling with current conventions.
Out of Scope Changes check ✅ Passed All changes are in scope: Flutter/Dart version upgrades, dependency updates, environment configuration migration (flutter_config to flutter_dotenv), iOS deployment target raises, Android tooling modernization, and CI workflow updates directly support issue #288 objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/288-upgrade-flutter-and-deps

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: 12

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (9)
bricks/template/__brick__/.github/workflows/android_deploy_production.yml (1)

18-28: ⚠️ Potential issue | 🔴 Critical

Same toolchain mismatch as the other Android workflows.

Flutter pin is 3.38.10 (PR target is 3.41.6, .fvmrc also pins 3.41.6) and JDK is still adopt/11 while the template is upgraded to AGP 8.11.1 / Gradle 8.14 which require JDK 17. This workflow will break once the Android modernization lands.

🔧 Proposed fix
       - name: Set up Java JDK
         uses: actions/setup-java@v3
         with:
-          distribution: 'adopt'
-          java-version: '11'
+          distribution: 'temurin'
+          java-version: '17'

       - name: Set up Flutter environment
         uses: subosito/flutter-action@v2
         with:
           channel: 'stable'
-          flutter-version: '3.38.10'
+          flutter-version: '3.41.6'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bricks/template/__brick__/.github/workflows/android_deploy_production.yml`
around lines 18 - 28, The workflow uses actions/setup-java@v3 and
subosito/flutter-action@v2 with mismatched toolchain versions; update the Java
step (actions/setup-java@v3) to use a modern distribution and JDK 17 (e.g.,
distribution: 'temurin', java-version: '17') and update the Flutter step's
flutter-version to match .fvmrc/PR target (flutter-version: '3.41.6') so the
GitHub Action aligns with AGP 8.11.1 / Gradle 8.14 requirements and the
project's FVM pin.
bricks/template/__brick__/.github/workflows/android_deploy_production_to_playstore.yml (1)

18-28: ⚠️ Potential issue | 🔴 Critical

Toolchain not aligned with PR upgrade (Flutter 3.41.6 + Java 17).

PR objectives specify Flutter 3.41.6 and Java 17 for the modernized Android tooling (AGP 8.11.1 requires JDK 17). This workflow still pins flutter-version: '3.38.10' and distribution: 'adopt' / java-version: '11'. Running AGP 8.11.1 builds on JDK 11 will fail, and the Flutter pin is inconsistent with .fvmrc and the other upgraded workflows.

🔧 Proposed fix
       - name: Set up Java JDK
         uses: actions/setup-java@v3
         with:
-          distribution: 'adopt'
-          java-version: '11'
+          distribution: 'temurin'
+          java-version: '17'

       - name: Set up Flutter environment
         uses: subosito/flutter-action@v2
         with:
           channel: 'stable'
-          flutter-version: '3.38.10'
+          flutter-version: '3.41.6'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@bricks/template/__brick__/.github/workflows/android_deploy_production_to_playstore.yml`
around lines 18 - 28, Update the workflow steps that set up Java and Flutter to
match the PR toolchain: in the "Set up Java JDK" step (uses:
actions/setup-java@v3) change the with keys so distribution is the JDK17
provider (e.g., 'temurin') and java-version is '17'; in the "Set up Flutter
environment" step (uses: subosito/flutter-action@v2) update the flutter-version
field to '3.41.6' to match .fvmrc and other workflows.
bricks/template/__brick__/.github/workflows/android_deploy_staging.yml (1)

18-28: ⚠️ Potential issue | 🔴 Critical

Flutter and JDK pins not upgraded as described.

The AI summary for this file indicates a bump to Flutter 3.41.6 and Temurin JDK 17, but the code still shows flutter-version: '3.38.10' and adopt JDK 11. With AGP 8.11.1 (per PR), JDK 11 will fail the build, and the Flutter version diverges from .fvmrc (3.41.6).

🔧 Proposed fix
       - name: Set up Java JDK
         uses: actions/setup-java@v3
         with:
-          distribution: 'adopt'
-          java-version: '11'
+          distribution: 'temurin'
+          java-version: '17'

       - name: Set up Flutter environment
         uses: subosito/flutter-action@v2
         with:
           channel: 'stable'
-          flutter-version: '3.38.10'
+          flutter-version: '3.41.6'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bricks/template/__brick__/.github/workflows/android_deploy_staging.yml`
around lines 18 - 28, The workflow is still pinning Java and Flutter to old
versions: update the actions setup blocks so actions/setup-java@v3 uses Temurin
(distribution: 'temurin') and java-version: '17' to match AGP 8.11.1, and update
the subosito/flutter-action@v2 block to set flutter-version: '3.41.6' to match
.fvmrc; change the distribution and java-version values in the existing
setup-java step (currently 'adopt' and '11') and change the flutter-version
value (currently '3.38.10') accordingly.
sample/.github/workflows/ios_deploy_to_app_store.yml (1)

35-39: ⚠️ Potential issue | 🟠 Major

Update Flutter version pin across all deployment and test workflows.

The ios_deploy_to_app_store.yml still uses Flutter 3.38.10, but this is part of a broader issue: all seven workflows in the repository maintain this stale pin (test.yml, ios_deploy_to_testflight.yml, ios_deploy_staging_to_firebase.yml, android_deploy_staging.yml, android_deploy_production_to_playstore.yml, and android_deploy_production.yml). Production App Store, TestFlight, Firebase, and Play Store builds would all diverge from the intended 3.41.6 upgrade target.

🔧 Proposed fix

Update flutter-version: '3.38.10' to flutter-version: '3.41.6' in:

  • sample/.github/workflows/ios_deploy_to_app_store.yml (line 39)
  • sample/.github/workflows/ios_deploy_to_testflight.yml (line 39)
  • sample/.github/workflows/ios_deploy_staging_to_firebase.yml (line 38)
  • sample/.github/workflows/android_deploy_production_to_playstore.yml (line 28)
  • sample/.github/workflows/android_deploy_production.yml (line 28)
  • sample/.github/workflows/android_deploy_staging.yml (line 28)
  • sample/.github/workflows/test.yml (line 25)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/.github/workflows/ios_deploy_to_app_store.yml` around lines 35 - 39,
The workflow step named "Set up Flutter environment" using
subosito/flutter-action@v2 pins flutter-version: '3.38.10' and must be updated
to '3.41.6'; change the flutter-version value in that step across all seven
workflows (ios_deploy_to_app_store.yml, ios_deploy_to_testflight.yml,
ios_deploy_staging_to_firebase.yml, android_deploy_production_to_playstore.yml,
android_deploy_production.yml, android_deploy_staging.yml, and test.yml) so the
Set up Flutter environment step consistently uses flutter-version: '3.41.6'.
sample/.github/workflows/test.yml (1)

21-25: ⚠️ Potential issue | 🟠 Major

Update sample CI to use Flutter 3.41.6.

Sample tests still pin Flutter 3.38.10 while the root config and PR target is 3.41.6. This means sample tests won't validate against the target SDK version. Update the pin to match:

      with:
        channel: 'stable'
-       flutter-version: '3.38.10'
+       flutter-version: '3.41.6'

Note: The template brick (bricks/template/__brick__/.github/workflows/test.yml) has the same version pin and should also be updated.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/.github/workflows/test.yml` around lines 21 - 25, Replace the pinned
Flutter version '3.38.10' with '3.41.6' in the GitHub Actions step named "Set up
Flutter environment" (the step that uses subosito/flutter-action@v2 and sets
flutter-version), and apply the same change to the template workflow's test.yml
so the sample CI and the template both target Flutter 3.41.6.
sample/.github/workflows/android_deploy_staging.yml (1)

18-28: ⚠️ Potential issue | 🔴 Critical

Use Java 17 and Flutter 3.41.6 for the Android staging build.

With the Android tooling upgrade, JDK 11 is incompatible: AGP 8.11.1 requires JDK 17 minimum, and this workflow still pins the older Flutter 3.38.10 SDK.

🔧 Proposed fix
       - name: Set up Java JDK
         uses: actions/setup-java@v3
         with:
-          distribution: 'adopt'
-          java-version: '11'
+          distribution: 'temurin'
+          java-version: '17'

       - name: Set up Flutter environment
         uses: subosito/flutter-action@v2
         with:
           channel: 'stable'
-          flutter-version: '3.38.10'
+          flutter-version: '3.41.6'

The temurin distribution is the recommended successor to the deprecated adopt builds and aligns with the AGP 8.11.1 and Flutter 3.41.6 requirements.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/.github/workflows/android_deploy_staging.yml` around lines 18 - 28,
Update the GitHub Actions steps that configure Java and Flutter: in the "Set up
Java JDK" step (uses: actions/setup-java@v3) change the distribution from
'adopt' to 'temurin' and set java-version to '17'; in the "Set up Flutter
environment" step (uses: subosito/flutter-action@v2) update flutter-version to
'3.41.6' so the workflow uses JDK 17 and Flutter 3.41.6 required by AGP 8.11.1.
sample/.github/workflows/android_deploy_production_to_playstore.yml (1)

18-28: ⚠️ Potential issue | 🟠 Major

Align sample and template Android workflows with upgraded toolchain.

Sample and template Android workflows still use Java 11 with adopt distribution and Flutter 3.38.10, while root workflows target Java 17 with temurin and Flutter 3.41.6. With AGP 8.x, Java 17 is required; generated apps may fail CI with the outdated configuration. Android's AGP 8.11 release notes require JDK 17: https://developer.android.com/build/releases/agp-8-11-0-release-notes

Update all Android deployment workflows:

  • sample/.github/workflows/android_deploy_production_to_playstore.yml
  • sample/.github/workflows/android_deploy_production.yml
  • sample/.github/workflows/android_deploy_staging.yml
  • bricks/template/__brick__/.github/workflows/android_deploy_production_to_playstore.yml
  • bricks/template/__brick__/.github/workflows/android_deploy_production.yml
  • bricks/template/__brick__/.github/workflows/android_deploy_staging.yml

Change distribution: 'adopt' to distribution: 'temurin', java-version: '11' to java-version: '17', and flutter-version: '3.38.10' to flutter-version: '3.41.6'.

Also align Flutter versions in sample and template iOS workflows (ios_deploy_to_app_store.yml, ios_deploy_to_testflight.yml, ios_deploy_staging_to_firebase.yml, test.yml) from 3.38.10 to 3.41.6 for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/.github/workflows/android_deploy_production_to_playstore.yml` around
lines 18 - 28, Update the Android workflow toolchain settings to match the root
workflows: in the YAML jobs that call actions/setup-java@v3 and
subosito/flutter-action@v2 (look for the keys distribution, java-version, and
flutter-version) change distribution: 'adopt' to distribution: 'temurin',
java-version: '11' to java-version: '17', and flutter-version: '3.38.10' to
flutter-version: '3.41.6' in the listed Android workflow files
(sample/.github/workflows/android_deploy_production_to_playstore.yml,
sample/.github/workflows/android_deploy_production.yml,
sample/.github/workflows/android_deploy_staging.yml and the three files under
bricks/template/__brick__/.github/workflows); also update flutter-version from
3.38.10 to 3.41.6 in the iOS workflow files (ios_deploy_to_app_store.yml,
ios_deploy_to_testflight.yml, ios_deploy_staging_to_firebase.yml, test.yml) for
consistency.
sample/.github/workflows/android_deploy_production.yml (1)

18-28: ⚠️ Potential issue | 🟠 Major

Update the sample production workflow to Java 17 and Flutter 3.41.6.

The sample workflow at sample/.github/workflows/android_deploy_production.yml still uses Java 11 and Flutter 3.38.10, while the sample Android project's build.gradle.kts explicitly requires Java 17 (sourceCompatibility JavaVersion.VERSION_17, targetCompatibility JavaVersion.VERSION_17). This mismatch will cause compilation failures. The root production workflow has already been updated to Java 17 (temurin) and Flutter 3.41.6; the sample should match.

Proposed fix
       - name: Set up Java JDK
         uses: actions/setup-java@v3
         with:
-          distribution: 'adopt'
-          java-version: '11'
+          distribution: 'temurin'
+          java-version: '17'

       - name: Set up Flutter environment
         uses: subosito/flutter-action@v2
         with:
           channel: 'stable'
-          flutter-version: '3.38.10'
+          flutter-version: '3.41.6'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/.github/workflows/android_deploy_production.yml` around lines 18 - 28,
The workflow uses the "Set up Java JDK" and "Set up Flutter environment" steps
with Java 11 and Flutter 3.38.10 which mismatch the sample project's Java 17
requirement; update the "Set up Java JDK" step (actions/setup-java@v3) to use
distribution 'temurin' and java-version '17', and update the "Set up Flutter
environment" step (subosito/flutter-action@v2) to flutter-version '3.41.6' (keep
channel 'stable' if desired) so the CI matches the project's
sourceCompatibility/targetCompatibility JavaVersion.VERSION_17.
bricks/template/__brick__/pubspec.yaml (1)

85-102: ⚠️ Potential issue | 🟠 Major

Make the .env tracking contract explicit for generated apps.

Declaring .env and .env.staging as bundled Flutter assets and shipping them tracked in the template will cause every generated project to start out with committed env files. That's fine while they hold placeholders, but the common failure mode is a developer later adding a real SECRET/API key into the same tracked file and pushing it. A few things worth doing so the template doesn't normalize that:

  • Ensure the template README (or {{~ README.md }}) clearly states: the tracked .env* files are intentionally sample values only, and real secrets must be provided via a developer-local untracked file or CI secret injection.
  • Consider shipping .env.example / .env.staging.example as the tracked assets and .gitignore-ing .env/.env.staging, with a first-run instruction to copy-and-fill. This matches standard flutter_dotenv guidance and avoids the foot-gun.
  • If you keep the current approach, double-check that nothing sensitive is ever written to these files by subsequent bricks/hooks.

Not blocking the upgrade, but worth nailing down before downstream teams start using 3.41.6.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bricks/template/__brick__/pubspec.yaml` around lines 85 - 102, The template
currently lists .env and .env.staging as tracked assets in pubspec.yaml (assets:
- .env - .env.staging) and also excludes them under flutter_gen; update the
template to ship example files instead and ensure generated apps do not commit
real secrets: replace the tracked .env/.env.staging entries with
.env.example/.env.staging.example in the assets block, add .env and .env.staging
to the template .gitignore, adjust flutter_gen.assets.exclude to exclude .env
and .env.staging (or remove them if you switch to examples), and update the
template README ({{~ README.md }}) to instruct developers to copy .env.example
-> .env and never commit real secrets; verify the hooks/bricks that may write to
.env (if any) in this repo so they only write sample values or prompt for
untracked local files.
🧹 Nitpick comments (10)
bricks/template/__brick__/.github/workflows/test.yml (2)

25-25: Verify CI actions versions alongside the toolchain bump.

While bumping the Flutter SDK, actions/checkout@v3 and codecov/codecov-action@v2 are now several major versions behind (v4 and v5 respectively). Not blocking, but consider bumping them together with the toolchain upgrade to avoid Node 16 deprecation warnings on GitHub-hosted runners.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bricks/template/__brick__/.github/workflows/test.yml` at line 25, The CI
workflow bumps the Flutter SDK at flutter-version: '3.38.10' but leaves
actions/checkout@v3 and codecov/codecov-action@v2 outdated; update
actions/checkout to v4 and codecov/codecov-action to v5 in the workflow file,
ensuring compatibility with the new toolchain (and Node runner versions), run
the workflow to verify there are no deprecation or runtime issues, and adjust
any associated steps (e.g., token or upload syntax) if the newer action versions
require changes.

30-31: Deprecated flutter packages pub run invocation.

flutter packages pub run has been deprecated for several Flutter releases in favor of dart run. Since this PR modernizes toolchains (Flutter 3.38.10 / Dart 3.8+), consider switching to dart run build_runner build --delete-conflicting-outputs here and in the two iOS deploy workflows to silence the deprecation notice in CI logs.

Proposed fix
-      - name: Run code generator
-        run: flutter packages pub run build_runner build --delete-conflicting-outputs
+      - name: Run code generator
+        run: dart run build_runner build --delete-conflicting-outputs
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bricks/template/__brick__/.github/workflows/test.yml` around lines 30 - 31,
Replace the deprecated Flutter CLI invocation in the "Run code generator" step
so the command uses the Dart CLI: update the run value currently calling
"flutter packages pub run build_runner build --delete-conflicting-outputs" to
use "dart run build_runner build --delete-conflicting-outputs" instead; also
apply the same replacement in the two iOS deploy workflow steps that use
"flutter packages pub run" to silence the deprecation warning.
sample/ios/.gitignore (1)

32-33: Consider anchoring these patterns to the iOS root.

.bundle/ and vendor/ without a leading / will match at any depth under sample/ios/. That is typically desired for Bundler/CocoaPods artifacts, but if you want to scope them to sample/ios/.bundle and sample/ios/vendor only (matching fastlane/bundler's standard locations), use /.bundle/ and /vendor/ for consistency with the surrounding rooted entries like Build/ is file-agnostic but Flutter/... are rooted.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/ios/.gitignore` around lines 32 - 33, The .gitignore patterns
`.bundle/` and `vendor/` should be anchored to the iOS root; update those
entries to use a leading slash (i.e., change `.bundle/` → `/.bundle/` and
`vendor/` → `/vendor/`) so they only match at the repository root consistent
with the other rooted entries.
sample/android/gradle.properties (1)

1-2: Heap bump and parallel=true look fine; one thing to double-check.

-Xmx4g and parallel execution are reasonable defaults for AGP 8.x / Gradle 8.14 builds and should speed up local/CI builds. Two minor considerations:

  • GitHub-hosted ubuntu-latest runners have ~7 GB RAM; 4 GB for Gradle + Kotlin daemons + AVD/emulator (if any) is usually OK, but worth confirming no OOM on the Android CI workflows.
  • org.gradle.parallel=true only helps multi-module builds; this sample appears to be a single app module, so the practical benefit is limited (harmless though).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/android/gradle.properties` around lines 1 - 2, Verify the CI and local
environments can support org.gradle.jvmargs=-Xmx4g and decide whether to lower
it or document it: check GitHub ubuntu-latest memory usage in your Android CI
workflows and either reduce Xmx (e.g., -Xmx3g) or add a comment in
gradle.properties noting the 4g requirement for local/CI; also confirm whether
to keep org.gradle.parallel=true (leave it if multi-module or remove/annotate it
as unnecessary for a single-module app).
README.md (1)

29-38: Minor: keep the Flutter version string in one place.

3.41.6 is now hard-coded in README.md, sample/README.md, .fvmrc, and CI workflows. Consider pointing users to .fvmrc (fvm use) as the source of truth to avoid drift on the next upgrade.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 29 - 38, Update README.md to stop hard-coding the
Flutter version and instead point users to the canonical .fvmrc file as the
single source of truth; change the text around the Flutter version (the block
that currently mentions "Flutter 3.41.6" and the fvm install/use commands) to
instruct users to run fvm use based on .fvmrc (and reference sample/README.md
and CI workflows as already using .fvmrc) so future upgrades only require
updating .fvmrc and CI, not multiple READMEs.
sample/README.md (1)

16-20: Document how .env / .env.staging are wired in.

Since these files are now tracked in the repo and loaded via flutter_dotenv, it's worth a one-liner reminding contributors that they must be listed under flutter/assets in pubspec.yaml and that changes require a full app restart (not hot reload) to take effect. Otherwise LGTM.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/README.md` around lines 16 - 20, Add a one-line note in the README
explaining that the tracked .env and .env.staging files are loaded via
flutter_dotenv, must be listed under flutter/assets in pubspec.yaml so Flutter
includes them, and that any changes to these files require a full app restart
(not hot reload) to take effect; reference the filenames `.env` and
`.env.staging`, the `flutter_dotenv` loader, and `pubspec.yaml` in that
sentence.
bricks/template/__brick__/test/data/repositories/credential_repository_test.dart (1)

33-42: Use expectLater with await for clearer and more robust async assertion.

repository.getUsers() is async. While expect(() => repository.getUsers(), throwsA(...)) works because throwsA awaits returned futures, using expectLater directly on the future is clearer and safer if the implementation ever throws synchronously before awaiting:

♻️ Suggested refactor
-        expect(() => repository.getUsers(), throwsA(isA<NetworkExceptions>()));
+        await expectLater(
+          repository.getUsers(),
+          throwsA(isA<NetworkExceptions>()),
+        );

Note: The bare DioException(requestOptions: RequestOptions(path: '/users')) will default to type: DioExceptionType.unknown, which correctly maps to NetworkExceptions.noInternetConnection() via the fromDioException() method. The test assertion passes because all NetworkExceptions subtypes match isA<NetworkExceptions>(), but verify this mapping aligns with the intended behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@bricks/template/__brick__/test/data/repositories/credential_repository_test.dart`
around lines 33 - 42, The test currently wraps the async call in a sync closure;
change it to await the future with expectLater for clearer async assertion: call
repository.getUsers() directly (not via a closure) and use await
expectLater(repository.getUsers(), throwsA(isA<NetworkExceptions>())); keep the
mocked behavior using mockApiService.getUsers() throwing the DioException and
ensure the test function is marked async so the await works.
sample/test/data/repositories/credential_repository_test.dart (1)

33-42: Async throwsA matcher may not reliably await the rejected future.

repository.getUsers() is async, so expect(() => repository.getUsers(), throwsA(...)) returns a Future that the test does not await. If the matcher’s future isn’t awaited, failures can surface as uncaught async errors after the test body completes rather than as a clean assertion failure. Prefer await expectLater(...) for async throw assertions.

♻️ Suggested change
-        expect(() => repository.getUsers(), throwsA(isA<NetworkExceptions>()));
+        await expectLater(
+          repository.getUsers(),
+          throwsA(isA<NetworkExceptions>()),
+        );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/test/data/repositories/credential_repository_test.dart` around lines
33 - 42, The test uses a synchronous expect with a closure for an async method,
which can lead to uncaught async errors; replace expect(() =>
repository.getUsers(), throwsA(isA<NetworkExceptions>())) with an awaited
expectLater on the Future returned by repository.getUsers() (e.g., await
expectLater(repository.getUsers(), throwsA(isA<NetworkExceptions>()))), keeping
the mock setup (when(mockApiService.getUsers()).thenThrow(...)) and the
assertion target repository.getUsers unchanged.
bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart (1)

51-111: Add a defensive default case to future-proof this switch.

The switch currently covers all eight DioExceptionType values in Dio 5.x, but it depends on that enum never growing. Since networkExceptions is a non-nullable local variable declared without an initializer, a new enum value in a future Dio release will either fail the analyzer (missing definite assignment) or create a runtime hole. A default case mapped to unexpectedError costs nothing and protects this template in downstream projects.

♻️ Proposed fix
             case DioExceptionType.badCertificate:
             case DioExceptionType.connectionError:
               networkExceptions = const NetworkExceptions.unexpectedError();
               break;
+            // Defensive: any future DioExceptionType values.
+            // ignore: unreachable_switch_default
+            default:
+              networkExceptions = const NetworkExceptions.unexpectedError();
+              break;
           }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart`
around lines 51 - 111, The switch over DioExceptionType in the
error-to-exception mapping (the switch that assigns networkExceptions based on
DioExceptionType) lacks a final default branch, which can cause analyzer/runtime
holes if the enum gains a new value; add a default case at the end of that
switch which assigns networkExceptions = const
NetworkExceptions.unexpectedError() (or the equivalent unexpectedError
constructor) to ensure networkExceptions is always initialized and future-proof
the mapping.
sample/lib/app/screens/home/home_view_model.dart (1)

6-11: Optional: consider migrating to the modern Notifier API.

Using StateNotifier from flutter_riverpod/legacy.dart is supported, but it's the legacy surface of Riverpod 3.x. Since this PR is modernizing the codebase, you might plan a follow-up to migrate HomeViewModel (and its provider in home_screen.dart) to Notifier<HomeViewState> + NotifierProvider, moving initialization logic to the build() method. Not required for this PR.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/lib/app/screens/home/home_view_model.dart` around lines 6 - 11, The
class HomeViewModel currently extends the legacy StateNotifier API (importing
flutter_riverpod/legacy.dart); to modernize later, plan to migrate HomeViewModel
to extend Notifier<HomeViewState> and replace its provider in home_screen.dart
with NotifierProvider, moving any initialization or dependency wiring (currently
via the constructor HomeViewModel(this._getUsersUseCase)) into the Notifier’s
build() method and accessing GetUsersUseCase through ref.read/ref.watch as
appropriate; this change keeps HomeViewState and GetUsersUseCase but replaces
StateNotifier usage with the Notifier API and updates provider
registration/consumption in home_screen.dart.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bricks/permission_handler/__brick__/`{{~ _pubspec_dependency.yaml }}:
- Line 2: Ensure Android compileSdk is explicitly set to 35 to meet
permission_handler v12: verify whether flutter.compileSdkVersion in your
template resolves to >=35; if not, set compileSdkVersion = 35 in
android/app/build.gradle (or update the template variable). Confirm Podfile
already has iOS deployment target 13.0. In addition, update comments in
_Podfile_build_configurations to refer to the current Permission enum names (not
the old PermissionGroup) and ensure permission_wrapper.dart usage
(Permission.camera.request(), PermissionStatus.granted) remains unchanged and
consistent with v12 API.

In `@bricks/template/__brick__/.env`:
- Line 2: The .env template contains SECRET=This is a sample secret which
triggers dotenv-linter's ValueWithoutQuotes; update the SECRET entry in the
template to quote the value (e.g., SECRET="This is a sample secret") so values
containing spaces are wrapped in quotes and the generated template is
lint-clean.

In
`@bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml`:
- Around line 34-38: The workflow's Flutter SDK pin in the "Set up Flutter
environment" step is out of sync with the PR target and .fvmrc (uses
flutter-version: '3.38.10'); update the flutter-version value to '3.41.6' (and
keep channel: 'stable') in the step that uses subosito/flutter-action@v2 so CI
uses the same SDK as .fvmrc and the PR summary.

In `@bricks/template/__brick__/.gitignore`:
- Around line 1-5: The .gitignore currently uses unanchored patterns (".env",
".env.staging", "!.env", "!.env.staging") which match files at any depth; update
those four entries to be anchored to the repository root by prefixing them with
"/", i.e., change ".env" and ".env.staging" to "/.env" and "/.env.staging" and
likewise the negations "!.env" and "!.env.staging" to "/!.env" and
"/!.env.staging" so only the project-root env files are affected.

In `@sample/.env`:
- Around line 1-2: Remove the SECRET key from the tracked sample .env and stop
committing runtime env files: create a .env.example that contains only
non-secret placeholders (e.g., REST_API_ENDPOINT) and add .env (and any .env.*
runtime files) to .gitignore; if sample .env is already committed, remove it
from the index (git rm --cached) so history no longer tracks the runtime file
and keep only the sanitized .env.example in the repo.
- Line 2: The SECRET value in sample/.env contains spaces and must be quoted for
flutter_dotenv to parse it correctly; update SECRET in sample/.env to wrap the
value in quotes (e.g., SECRET="This is a sample secret") and make the same
change in sample/.env.staging and the corresponding env files under
bricks/template/__brick__/ so any environment entries with spaces are
consistently quoted; ensure you only add quotes around values that include
spaces and preserve existing keys and formatting.

In `@sample/.env.staging`:
- Line 2: The SECRET value in the env sample contains spaces but is unquoted;
update the SECRET assignment to use quotes (e.g., wrap the value in single or
double quotes) so dotenv-linter and tools that parse .env files handle it
portably; locate the SECRET=This is a sample staging secret line and replace the
RHS with a quoted string (e.g., SECRET="This is a sample staging secret")
ensuring any internal quotes are escaped if needed.

In `@sample/.github/workflows/ios_deploy_staging_to_firebase.yml`:
- Line 38: The workflow's flutter-version pin is inconsistent with the PR;
update the YAML key flutter-version (currently '3.38.10') to '3.41.6' so this
file matches the other upgraded workflows and the PR description, or
alternatively update the PR description to state '3.38.10' if intentional;
change the value for flutter-version in ios_deploy_staging_to_firebase.yml (the
flutter-version entry) to reconcile the mismatch.

In `@sample/.github/workflows/ios_deploy_to_testflight.yml`:
- Line 39: The iOS production workflow pins flutter-version: '3.38.10' which is
inconsistent with the PR summary/other workflows that use '3.41.6'; update the
flutter-version entry in sample/.github/workflows/ios_deploy_to_testflight.yml
(the line with flutter-version) to '3.41.6' and verify the staging iOS workflow
uses the same version so both production and staging iOS workflows match the
repo/PR claim.

In `@sample/.gitignore`:
- Around line 1-5: The .gitignore currently lists unanchored entries ".env" and
".env.staging" which can match nested files; update the patterns to anchor them
to the repository root by changing the entries to "/.env" and "/.env.staging"
and update the negation lines accordingly to "!/.env" and "!/.env.staging" so
only the top-level env files are affected; modify the lines that reference
".env" and ".env.staging" in the .gitignore to use the anchored forms.

In `@sample/lib/domain/exceptions/network_exceptions.dart`:
- Around line 58-60: The Dio 5 mapping is inverted: update the switch handling
in network_exceptions.dart so DioExceptionType.connectionError maps to
NetworkExceptions.noInternetConnection() and DioExceptionType.unknown is treated
as unexpected unless its underlying error is a SocketException; in the unknown
case inspect the DioException instance's error.error (e.g., check if error.error
is a SocketException) and return NetworkExceptions.noInternetConnection() only
then, otherwise return NetworkExceptions.unexpectedError(); apply the same
swap-and-check change for the second occurrence (the other switch handling
around the NetworkExceptions creation).

In `@sample/pubspec.yaml`:
- Around line 87-89: The pubspec.yaml is bundling real secret files (.env and
.env.staging) via the assets section and your app reads SECRET through dotenv;
remove any real secrets from these tracked asset files and replace their
contents with public placeholders or example values, or stop listing them under
assets and add them to .gitignore so they aren’t packaged; instead load real
secrets from a secure runtime/backend secret store or platform secure storage
and update any code that reads SECRET via dotenv to fall back to
runtime-provided values when present.

---

Outside diff comments:
In
`@bricks/template/__brick__/.github/workflows/android_deploy_production_to_playstore.yml`:
- Around line 18-28: Update the workflow steps that set up Java and Flutter to
match the PR toolchain: in the "Set up Java JDK" step (uses:
actions/setup-java@v3) change the with keys so distribution is the JDK17
provider (e.g., 'temurin') and java-version is '17'; in the "Set up Flutter
environment" step (uses: subosito/flutter-action@v2) update the flutter-version
field to '3.41.6' to match .fvmrc and other workflows.

In `@bricks/template/__brick__/.github/workflows/android_deploy_production.yml`:
- Around line 18-28: The workflow uses actions/setup-java@v3 and
subosito/flutter-action@v2 with mismatched toolchain versions; update the Java
step (actions/setup-java@v3) to use a modern distribution and JDK 17 (e.g.,
distribution: 'temurin', java-version: '17') and update the Flutter step's
flutter-version to match .fvmrc/PR target (flutter-version: '3.41.6') so the
GitHub Action aligns with AGP 8.11.1 / Gradle 8.14 requirements and the
project's FVM pin.

In `@bricks/template/__brick__/.github/workflows/android_deploy_staging.yml`:
- Around line 18-28: The workflow is still pinning Java and Flutter to old
versions: update the actions setup blocks so actions/setup-java@v3 uses Temurin
(distribution: 'temurin') and java-version: '17' to match AGP 8.11.1, and update
the subosito/flutter-action@v2 block to set flutter-version: '3.41.6' to match
.fvmrc; change the distribution and java-version values in the existing
setup-java step (currently 'adopt' and '11') and change the flutter-version
value (currently '3.38.10') accordingly.

In `@bricks/template/__brick__/pubspec.yaml`:
- Around line 85-102: The template currently lists .env and .env.staging as
tracked assets in pubspec.yaml (assets: - .env - .env.staging) and also excludes
them under flutter_gen; update the template to ship example files instead and
ensure generated apps do not commit real secrets: replace the tracked
.env/.env.staging entries with .env.example/.env.staging.example in the assets
block, add .env and .env.staging to the template .gitignore, adjust
flutter_gen.assets.exclude to exclude .env and .env.staging (or remove them if
you switch to examples), and update the template README ({{~ README.md }}) to
instruct developers to copy .env.example -> .env and never commit real secrets;
verify the hooks/bricks that may write to .env (if any) in this repo so they
only write sample values or prompt for untracked local files.

In `@sample/.github/workflows/android_deploy_production_to_playstore.yml`:
- Around line 18-28: Update the Android workflow toolchain settings to match the
root workflows: in the YAML jobs that call actions/setup-java@v3 and
subosito/flutter-action@v2 (look for the keys distribution, java-version, and
flutter-version) change distribution: 'adopt' to distribution: 'temurin',
java-version: '11' to java-version: '17', and flutter-version: '3.38.10' to
flutter-version: '3.41.6' in the listed Android workflow files
(sample/.github/workflows/android_deploy_production_to_playstore.yml,
sample/.github/workflows/android_deploy_production.yml,
sample/.github/workflows/android_deploy_staging.yml and the three files under
bricks/template/__brick__/.github/workflows); also update flutter-version from
3.38.10 to 3.41.6 in the iOS workflow files (ios_deploy_to_app_store.yml,
ios_deploy_to_testflight.yml, ios_deploy_staging_to_firebase.yml, test.yml) for
consistency.

In `@sample/.github/workflows/android_deploy_production.yml`:
- Around line 18-28: The workflow uses the "Set up Java JDK" and "Set up Flutter
environment" steps with Java 11 and Flutter 3.38.10 which mismatch the sample
project's Java 17 requirement; update the "Set up Java JDK" step
(actions/setup-java@v3) to use distribution 'temurin' and java-version '17', and
update the "Set up Flutter environment" step (subosito/flutter-action@v2) to
flutter-version '3.41.6' (keep channel 'stable' if desired) so the CI matches
the project's sourceCompatibility/targetCompatibility JavaVersion.VERSION_17.

In `@sample/.github/workflows/android_deploy_staging.yml`:
- Around line 18-28: Update the GitHub Actions steps that configure Java and
Flutter: in the "Set up Java JDK" step (uses: actions/setup-java@v3) change the
distribution from 'adopt' to 'temurin' and set java-version to '17'; in the "Set
up Flutter environment" step (uses: subosito/flutter-action@v2) update
flutter-version to '3.41.6' so the workflow uses JDK 17 and Flutter 3.41.6
required by AGP 8.11.1.

In `@sample/.github/workflows/ios_deploy_to_app_store.yml`:
- Around line 35-39: The workflow step named "Set up Flutter environment" using
subosito/flutter-action@v2 pins flutter-version: '3.38.10' and must be updated
to '3.41.6'; change the flutter-version value in that step across all seven
workflows (ios_deploy_to_app_store.yml, ios_deploy_to_testflight.yml,
ios_deploy_staging_to_firebase.yml, android_deploy_production_to_playstore.yml,
android_deploy_production.yml, android_deploy_staging.yml, and test.yml) so the
Set up Flutter environment step consistently uses flutter-version: '3.41.6'.

In `@sample/.github/workflows/test.yml`:
- Around line 21-25: Replace the pinned Flutter version '3.38.10' with '3.41.6'
in the GitHub Actions step named "Set up Flutter environment" (the step that
uses subosito/flutter-action@v2 and sets flutter-version), and apply the same
change to the template workflow's test.yml so the sample CI and the template
both target Flutter 3.41.6.

---

Nitpick comments:
In `@bricks/template/__brick__/.github/workflows/test.yml`:
- Line 25: The CI workflow bumps the Flutter SDK at flutter-version: '3.38.10'
but leaves actions/checkout@v3 and codecov/codecov-action@v2 outdated; update
actions/checkout to v4 and codecov/codecov-action to v5 in the workflow file,
ensuring compatibility with the new toolchain (and Node runner versions), run
the workflow to verify there are no deprecation or runtime issues, and adjust
any associated steps (e.g., token or upload syntax) if the newer action versions
require changes.
- Around line 30-31: Replace the deprecated Flutter CLI invocation in the "Run
code generator" step so the command uses the Dart CLI: update the run value
currently calling "flutter packages pub run build_runner build
--delete-conflicting-outputs" to use "dart run build_runner build
--delete-conflicting-outputs" instead; also apply the same replacement in the
two iOS deploy workflow steps that use "flutter packages pub run" to silence the
deprecation warning.

In `@bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart`:
- Around line 51-111: The switch over DioExceptionType in the error-to-exception
mapping (the switch that assigns networkExceptions based on DioExceptionType)
lacks a final default branch, which can cause analyzer/runtime holes if the enum
gains a new value; add a default case at the end of that switch which assigns
networkExceptions = const NetworkExceptions.unexpectedError() (or the equivalent
unexpectedError constructor) to ensure networkExceptions is always initialized
and future-proof the mapping.

In
`@bricks/template/__brick__/test/data/repositories/credential_repository_test.dart`:
- Around line 33-42: The test currently wraps the async call in a sync closure;
change it to await the future with expectLater for clearer async assertion: call
repository.getUsers() directly (not via a closure) and use await
expectLater(repository.getUsers(), throwsA(isA<NetworkExceptions>())); keep the
mocked behavior using mockApiService.getUsers() throwing the DioException and
ensure the test function is marked async so the await works.

In `@README.md`:
- Around line 29-38: Update README.md to stop hard-coding the Flutter version
and instead point users to the canonical .fvmrc file as the single source of
truth; change the text around the Flutter version (the block that currently
mentions "Flutter 3.41.6" and the fvm install/use commands) to instruct users to
run fvm use based on .fvmrc (and reference sample/README.md and CI workflows as
already using .fvmrc) so future upgrades only require updating .fvmrc and CI,
not multiple READMEs.

In `@sample/android/gradle.properties`:
- Around line 1-2: Verify the CI and local environments can support
org.gradle.jvmargs=-Xmx4g and decide whether to lower it or document it: check
GitHub ubuntu-latest memory usage in your Android CI workflows and either reduce
Xmx (e.g., -Xmx3g) or add a comment in gradle.properties noting the 4g
requirement for local/CI; also confirm whether to keep org.gradle.parallel=true
(leave it if multi-module or remove/annotate it as unnecessary for a
single-module app).

In `@sample/ios/.gitignore`:
- Around line 32-33: The .gitignore patterns `.bundle/` and `vendor/` should be
anchored to the iOS root; update those entries to use a leading slash (i.e.,
change `.bundle/` → `/.bundle/` and `vendor/` → `/vendor/`) so they only match
at the repository root consistent with the other rooted entries.

In `@sample/lib/app/screens/home/home_view_model.dart`:
- Around line 6-11: The class HomeViewModel currently extends the legacy
StateNotifier API (importing flutter_riverpod/legacy.dart); to modernize later,
plan to migrate HomeViewModel to extend Notifier<HomeViewState> and replace its
provider in home_screen.dart with NotifierProvider, moving any initialization or
dependency wiring (currently via the constructor
HomeViewModel(this._getUsersUseCase)) into the Notifier’s build() method and
accessing GetUsersUseCase through ref.read/ref.watch as appropriate; this change
keeps HomeViewState and GetUsersUseCase but replaces StateNotifier usage with
the Notifier API and updates provider registration/consumption in
home_screen.dart.

In `@sample/README.md`:
- Around line 16-20: Add a one-line note in the README explaining that the
tracked .env and .env.staging files are loaded via flutter_dotenv, must be
listed under flutter/assets in pubspec.yaml so Flutter includes them, and that
any changes to these files require a full app restart (not hot reload) to take
effect; reference the filenames `.env` and `.env.staging`, the `flutter_dotenv`
loader, and `pubspec.yaml` in that sentence.

In `@sample/test/data/repositories/credential_repository_test.dart`:
- Around line 33-42: The test uses a synchronous expect with a closure for an
async method, which can lead to uncaught async errors; replace expect(() =>
repository.getUsers(), throwsA(isA<NetworkExceptions>())) with an awaited
expectLater on the Future returned by repository.getUsers() (e.g., await
expectLater(repository.getUsers(), throwsA(isA<NetworkExceptions>()))), keeping
the mock setup (when(mockApiService.getUsers()).thenThrow(...)) and the
assertion target repository.getUsers unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a0dd516-511c-4f4b-be6c-5456f8fb3228

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea62be and 27cd394.

⛔ Files ignored due to path filters (5)
  • bricks/template/__brick__/ios/Podfile.lock is excluded by !**/*.lock
  • bricks/template/__brick__/pubspec.lock is excluded by !**/*.lock
  • bricks/template/hooks/pubspec.lock is excluded by !**/*.lock
  • sample/ios/Podfile.lock is excluded by !**/*.lock
  • sample/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (113)
  • .fvmrc
  • .github/workflows/android_deploy_production.yml
  • .github/workflows/android_deploy_production_to_playstore.yml
  • .github/workflows/android_deploy_staging.yml
  • .github/workflows/ios_deploy_staging_to_firebase.yml
  • .github/workflows/ios_deploy_to_app_store.yml
  • .github/workflows/ios_deploy_to_testflight.yml
  • .github/workflows/test.yml
  • .gitignore
  • README.md
  • bricks/permission_handler/__brick__/lib/utils/wrappers/permission_wrapper.dart
  • bricks/permission_handler/__brick__/{{~ _pubspec_dependency.yaml }}
  • bricks/permission_handler/brick.yaml
  • bricks/template/__brick__/.env
  • bricks/template/__brick__/.env.sample
  • bricks/template/__brick__/.env.staging
  • bricks/template/__brick__/.github/workflows/android_deploy_production.yml
  • bricks/template/__brick__/.github/workflows/android_deploy_production_to_playstore.yml
  • bricks/template/__brick__/.github/workflows/android_deploy_staging.yml
  • bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml
  • bricks/template/__brick__/.github/workflows/ios_deploy_to_app_store.yml
  • bricks/template/__brick__/.github/workflows/ios_deploy_to_testflight.yml
  • bricks/template/__brick__/.github/workflows/test.yml
  • bricks/template/__brick__/.gitignore
  • bricks/template/__brick__/.metadata
  • bricks/template/__brick__/README.md
  • bricks/template/__brick__/android/app/build.gradle
  • bricks/template/__brick__/android/app/proguard-rules.pro
  • bricks/template/__brick__/android/build.gradle
  • bricks/template/__brick__/android/gradle.properties
  • bricks/template/__brick__/android/gradle/wrapper/gradle-wrapper.properties
  • bricks/template/__brick__/android/settings.gradle
  • bricks/template/__brick__/integration_test/real_app_test.dart
  • bricks/template/__brick__/integration_test/screens/home_screen_test.dart
  • bricks/template/__brick__/integration_test/utils/test_util.dart
  • bricks/template/__brick__/ios/.gitignore
  • bricks/template/__brick__/ios/Flutter/AppFrameworkInfo.plist
  • bricks/template/__brick__/ios/Flutter/Debug.xcconfig
  • bricks/template/__brick__/ios/Flutter/Release.xcconfig
  • bricks/template/__brick__/ios/Podfile
  • bricks/template/__brick__/ios/Runner.xcodeproj/project.pbxproj
  • bricks/template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • bricks/template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme
  • bricks/template/__brick__/lib/app/screens/home/home_screen.dart
  • bricks/template/__brick__/lib/app/screens/home/home_view_model.dart
  • bricks/template/__brick__/lib/data/remote/models/responses/user_response.dart
  • bricks/template/__brick__/lib/di/interceptor/app_interceptor.dart
  • bricks/template/__brick__/lib/di/module/network_module.dart
  • bricks/template/__brick__/lib/di/module/storage_module.dart
  • bricks/template/__brick__/lib/di/provider/dio_provider.dart
  • bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart
  • bricks/template/__brick__/lib/domain/models/user.dart
  • bricks/template/__brick__/lib/domain/usecases/get_users_use_case.dart
  • bricks/template/__brick__/lib/env.dart
  • bricks/template/__brick__/lib/main.dart
  • bricks/template/__brick__/pubspec.yaml
  • bricks/template/__brick__/test/app/screens/home/home_view_model_test.dart
  • bricks/template/__brick__/test/data/repositories/credential_repository_test.dart
  • bricks/template/__brick__/test/domain/usecases/get_users_use_case_test.dart
  • bricks/template/__brick__/test/mocks/data/remote/models/responses/user_response_mocks.dart
  • bricks/template/__brick__/test/mocks/generate_mocks.dart
  • bricks/template/brick.yaml
  • bricks/template/hooks/bundles/permission_handler_bundle.dart
  • bricks/template/hooks/pubspec.yaml
  • sample/.env
  • sample/.env.sample
  • sample/.env.staging
  • sample/.github/workflows/android_deploy_production.yml
  • sample/.github/workflows/android_deploy_production_to_playstore.yml
  • sample/.github/workflows/android_deploy_staging.yml
  • sample/.github/workflows/ios_deploy_staging_to_firebase.yml
  • sample/.github/workflows/ios_deploy_to_app_store.yml
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • sample/.github/workflows/test.yml
  • sample/.gitignore
  • sample/.metadata
  • sample/README.md
  • sample/android/app/build.gradle
  • sample/android/app/proguard-rules.pro
  • sample/android/build.gradle
  • sample/android/gradle.properties
  • sample/android/gradle/wrapper/gradle-wrapper.properties
  • sample/android/settings.gradle
  • sample/integration_test/real_app_test.dart
  • sample/integration_test/screens/home_screen_test.dart
  • sample/integration_test/utils/test_util.dart
  • sample/ios/.gitignore
  • sample/ios/Flutter/AppFrameworkInfo.plist
  • sample/ios/Flutter/Debug.xcconfig
  • sample/ios/Flutter/Release.xcconfig
  • sample/ios/Podfile
  • sample/ios/Runner.xcodeproj/project.pbxproj
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme
  • sample/lib/app/screens/home/home_screen.dart
  • sample/lib/app/screens/home/home_view_model.dart
  • sample/lib/data/remote/models/responses/user_response.dart
  • sample/lib/di/interceptor/app_interceptor.dart
  • sample/lib/di/module/network_module.dart
  • sample/lib/di/module/storage_module.dart
  • sample/lib/di/provider/dio_provider.dart
  • sample/lib/domain/exceptions/network_exceptions.dart
  • sample/lib/domain/models/user.dart
  • sample/lib/domain/usecases/get_users_use_case.dart
  • sample/lib/env.dart
  • sample/lib/main.dart
  • sample/lib/utils/wrappers/permission_wrapper.dart
  • sample/pubspec.yaml
  • sample/test/app/screens/home/home_view_model_test.dart
  • sample/test/data/repositories/credential_repository_test.dart
  • sample/test/domain/usecases/get_users_use_case_test.dart
  • sample/test/mocks/data/remote/models/responses/user_response_mocks.dart
  • sample/test/mocks/generate_mocks.dart
💤 Files with no reviewable changes (14)
  • sample/.env.sample
  • bricks/template/brick/android/app/proguard-rules.pro
  • bricks/template/brick/.env.sample
  • bricks/template/brick/ios/Flutter/Release.xcconfig
  • sample/ios/Flutter/Release.xcconfig
  • sample/ios/Flutter/Debug.xcconfig
  • sample/android/app/proguard-rules.pro
  • bricks/template/brick/ios/Flutter/Debug.xcconfig
  • bricks/template/brick/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • bricks/template/brick/android/build.gradle
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme
  • sample/android/build.gradle
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • bricks/template/brick/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme

Comment thread bricks/permission_handler/__brick__/{{~ _pubspec_dependency.yaml }}
Comment thread bricks/template/__brick__/.env Outdated
Comment thread bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml Outdated
Comment thread bricks/template/__brick__/.gitignore Outdated
Comment thread sample/.env Outdated
Comment thread sample/.github/workflows/ios_deploy_staging_to_firebase.yml Outdated
Comment thread sample/.github/workflows/ios_deploy_to_testflight.yml
Comment thread sample/.gitignore Outdated
Comment thread sample/lib/domain/exceptions/network_exceptions.dart Outdated
Comment thread sample/pubspec.yaml
Update workflow Flutter pins and Android/iOS permission-related template configs, correct Dio exception mapping behavior, and sanitize sample environment file tracking by keeping only .env.example in version control.
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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml (1)

81-83: ⚠️ Potential issue | 🟠 Major

Fix the RELEASE_NOTE_CONTENT env mapping.

Line 83 is parsed as a scalar under env, not as a RELEASE_NOTE_CONTENT key/value pair, because the colon is missing a following space. This breaks the workflow schema/env injection.

🛠️ Proposed fix
       - name: Deploy to Firebase
         env:
-          RELEASE_NOTE_CONTENT:${{`#mustacheCase`}}steps.changelog.outputs.changelog{{/mustacheCase}}
+          RELEASE_NOTE_CONTENT: ${{`#mustacheCase`}}steps.changelog.outputs.changelog{{/mustacheCase}}
         run: |
           cd ./ios && bundle exec fastlane build_and_upload_staging_app
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml`
around lines 81 - 83, The env mapping for the "Deploy to Firebase" step
incorrectly writes
RELEASE_NOTE_CONTENT:${{`#mustacheCase`}}steps.changelog.outputs.changelog{{/mustacheCase}}
as a scalar instead of a key/value pair; update the env mapping for
RELEASE_NOTE_CONTENT to use a proper YAML key/value format so the value is
parsed (i.e., make RELEASE_NOTE_CONTENT a key with the mustache-expanded value
from steps.changelog.outputs.changelog), ensuring the mustacheCase expression
remains intact.
sample/.github/workflows/ios_deploy_staging_to_firebase.yml (1)

81-83: ⚠️ Potential issue | 🟠 Major

Fix the RELEASE_NOTE_CONTENT env mapping.

Line 83 is missing a space after the colon in the YAML key/value pair. The line RELEASE_NOTE_CONTENT:${{ steps.changelog.outputs.changelog }} is parsed as a scalar under env, not as the intended key/value mapping. This breaks environment variable injection for the deploy step.

🛠️ Proposed fix
       - name: Deploy to Firebase
         env:
-          RELEASE_NOTE_CONTENT:${{ steps.changelog.outputs.changelog }}
+          RELEASE_NOTE_CONTENT: ${{ steps.changelog.outputs.changelog }}
         run: |
           cd ./ios && bundle exec fastlane build_and_upload_staging_app
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/.github/workflows/ios_deploy_staging_to_firebase.yml` around lines 81
- 83, The env mapping for the "Deploy to Firebase" step is malformed because
`RELEASE_NOTE_CONTENT:${{ steps.changelog.outputs.changelog }}` is missing a
space after the colon; update the `Deploy to Firebase` step's env block to use a
proper YAML key/value mapping for RELEASE_NOTE_CONTENT (i.e.,
`RELEASE_NOTE_CONTENT: ${{ steps.changelog.outputs.changelog }}`) so the
environment variable is injected correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart`:
- Around line 108-111: The mapping for DioExceptionType.badCertificate is
incorrect: instead of grouping it with DioExceptionType.connectionError to
return NetworkExceptions.noInternetConnection(), change the logic so only
DioExceptionType.connectionError maps to
NetworkExceptions.noInternetConnection(), and map
DioExceptionType.badCertificate to a more accurate variant (e.g.,
NetworkExceptions.unexpectedError() or add a dedicated
NetworkExceptions.badCertificate() variant) within the same switch handling;
update any constructors or usages of NetworkExceptions if you introduce a new
variant and ensure the switch in the code referencing
DioExceptionType.badCertificate and DioExceptionType.connectionError reflects
this separation.

In `@bricks/template/hooks/bundles/permission_handler_bundle.dart`:
- Line 6: Update the embedded Podfile docs link inside the
_Podfile_build_configurations payload of the permission_handler_bundle: replace
references to permission_handler/ios/Classes/PermissionHandlerEnums.h with the
new permission_handler_apple/ios/Classes/PermissionHandlerEnums.h path (as used
in permission_handler 12.0.1 setup docs), refresh the URL to point to the
current GitHub doc, and then regenerate the Mason bundle so generated apps no
longer inherit the broken setup reference.

---

Outside diff comments:
In
`@bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml`:
- Around line 81-83: The env mapping for the "Deploy to Firebase" step
incorrectly writes
RELEASE_NOTE_CONTENT:${{`#mustacheCase`}}steps.changelog.outputs.changelog{{/mustacheCase}}
as a scalar instead of a key/value pair; update the env mapping for
RELEASE_NOTE_CONTENT to use a proper YAML key/value format so the value is
parsed (i.e., make RELEASE_NOTE_CONTENT a key with the mustache-expanded value
from steps.changelog.outputs.changelog), ensuring the mustacheCase expression
remains intact.

In `@sample/.github/workflows/ios_deploy_staging_to_firebase.yml`:
- Around line 81-83: The env mapping for the "Deploy to Firebase" step is
malformed because `RELEASE_NOTE_CONTENT:${{ steps.changelog.outputs.changelog
}}` is missing a space after the colon; update the `Deploy to Firebase` step's
env block to use a proper YAML key/value mapping for RELEASE_NOTE_CONTENT (i.e.,
`RELEASE_NOTE_CONTENT: ${{ steps.changelog.outputs.changelog }}`) so the
environment variable is injected correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f3b88f80-9519-4542-9a5d-240e4a851dc5

📥 Commits

Reviewing files that changed from the base of the PR and between 27cd394 and d6c6ef8.

📒 Files selected for processing (15)
  • bricks/permission_handler/__brick__/{{~ _Podfile_build_configurations }}
  • bricks/template/__brick__/.env
  • bricks/template/__brick__/.env.staging
  • bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml
  • bricks/template/__brick__/.gitignore
  • bricks/template/__brick__/android/app/build.gradle
  • bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart
  • bricks/template/hooks/bundles/permission_handler_bundle.dart
  • sample/.env.example
  • sample/.github/workflows/ios_deploy_staging_to_firebase.yml
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • sample/.gitignore
  • sample/android/app/build.gradle
  • sample/ios/Podfile
  • sample/lib/domain/exceptions/network_exceptions.dart
✅ Files skipped from review due to trivial changes (4)
  • sample/.env.example
  • bricks/template/brick/.env.staging
  • bricks/template/brick/.env
  • bricks/permission_handler/brick/{{~ _Podfile_build_configurations }}
🚧 Files skipped from review as they are similar to previous changes (5)
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • sample/.gitignore
  • bricks/template/brick/.gitignore
  • sample/android/app/build.gradle
  • sample/ios/Podfile

Comment thread bricks/template/hooks/bundles/permission_handler_bundle.dart Outdated
Apply dart format output for sample network exceptions mapping so CI format checks pass.
Update permission handler Podfile reference to the permission_handler_apple path and regenerate the Mason bundle; also separate Dio badCertificate/connectionError mapping in sample and template network exceptions.
@ducbm051291 ducbm051291 force-pushed the chore/288-upgrade-flutter-and-deps branch from 944d07b to 651f6dc Compare April 23, 2026 09:19
Apply dart format to template network exceptions so generated projects pass CI formatting checks.
Apply dart format output for template network exceptions using the same Dart formatter version as CI.
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: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bricks/template/__brick__/pubspec.yaml`:
- Line 48: The pubspec uses package_info_plus: ^9.0.1 which requires Android
Gradle Plugin (AGP) >= 8.12.1 but the template currently pins AGP to 8.11.1;
update the AGP version string to 8.12.1 (or newer) in the Android settings files
referenced by the template (update the AGP declaration in the template's
settings.gradle and the sample's settings.gradle) so AGP aligns with
package_info_plus 9.x, or alternatively change package_info_plus to a <9.0.x
constraint if you prefer to keep AGP at 8.11.1. Ensure the change targets the
AGP version token in those settings files and not the Kotlin or Gradle wrapper
versions.
- Around line 85-87: Rename the SECRET key in the shipped .env and .env.staging
asset files to a clearly non-secret name (e.g., PUBLIC_VALUE or SAMPLE_CONFIG)
and update any references in code (notably home_screen.dart where
dotenv['SECRET'] is read) to use the new key name; add a short comment in the
.env templates and a brief note in the project README (or near pubspec.yaml)
stating that these assets are public and that real API keys/tokens must remain
server-side and never be placed in Flutter assets, referencing flutter_dotenv
security guidance.

In `@sample/lib/app/screens/home/home_screen.dart`:
- Line 64: The code currently calls dotenv.get('SECRET') in home_screen.dart
which throws an AssertionError if SECRET is missing; update both places: add
SECRET=<your_default_or_placeholder> to the .env.example file so new devs see
the required key, and change the runtime lookup in the HomeScreen (replace
dotenv.get('SECRET') usage) to use dotenv.maybeGet('SECRET') ?? 'default_secret'
(or another safe placeholder) so the widget won't crash if the env key is
absent.

In `@sample/lib/main.dart`:
- Around line 13-17: The app is failing because dotenv.load(fileName: envFile)
expects the files to exist in the app bundle; add both .env and .env.staging
files into the sample/ directory (so rootBundle can find them) with the
environment keys the app expects, ensuring their filenames match what main.dart
derives via packageInfo and envFile (see PackageInfo.fromPlatform, envFile
variable, and dotenv.load). Confirm the files are present in sample/ (not just
declared in pubspecs) and re-run to verify dotenv.load succeeds.

In `@sample/README.md`:
- Around line 16-17: Change the README wording to clarify that .env files are
not bundled and must be created by the user: update the line in sample/README.md
to instruct users to create environment files (for example, copy .env.example to
.env and .env.staging) and reference that sample/.gitignore excludes .env and
.env.*; mention .env.example as the template to copy from.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cc072602-3691-486b-9252-1592a2999d0a

📥 Commits

Reviewing files that changed from the base of the PR and between d6c6ef8 and 651f6dc.

⛔ Files ignored due to path filters (5)
  • bricks/template/__brick__/ios/Podfile.lock is excluded by !**/*.lock
  • bricks/template/__brick__/pubspec.lock is excluded by !**/*.lock
  • bricks/template/hooks/pubspec.lock is excluded by !**/*.lock
  • sample/ios/Podfile.lock is excluded by !**/*.lock
  • sample/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (113)
  • .fvmrc
  • .github/workflows/android_deploy_production.yml
  • .github/workflows/android_deploy_production_to_playstore.yml
  • .github/workflows/android_deploy_staging.yml
  • .github/workflows/ios_deploy_staging_to_firebase.yml
  • .github/workflows/ios_deploy_to_app_store.yml
  • .github/workflows/ios_deploy_to_testflight.yml
  • .github/workflows/test.yml
  • .gitignore
  • README.md
  • bricks/permission_handler/__brick__/lib/utils/wrappers/permission_wrapper.dart
  • bricks/permission_handler/__brick__/{{~ _Podfile_build_configurations }}
  • bricks/permission_handler/__brick__/{{~ _pubspec_dependency.yaml }}
  • bricks/permission_handler/brick.yaml
  • bricks/template/__brick__/.env
  • bricks/template/__brick__/.env.sample
  • bricks/template/__brick__/.env.staging
  • bricks/template/__brick__/.github/workflows/android_deploy_production.yml
  • bricks/template/__brick__/.github/workflows/android_deploy_production_to_playstore.yml
  • bricks/template/__brick__/.github/workflows/android_deploy_staging.yml
  • bricks/template/__brick__/.github/workflows/ios_deploy_staging_to_firebase.yml
  • bricks/template/__brick__/.github/workflows/ios_deploy_to_app_store.yml
  • bricks/template/__brick__/.github/workflows/ios_deploy_to_testflight.yml
  • bricks/template/__brick__/.github/workflows/test.yml
  • bricks/template/__brick__/.gitignore
  • bricks/template/__brick__/.metadata
  • bricks/template/__brick__/README.md
  • bricks/template/__brick__/android/app/build.gradle
  • bricks/template/__brick__/android/app/proguard-rules.pro
  • bricks/template/__brick__/android/build.gradle
  • bricks/template/__brick__/android/gradle.properties
  • bricks/template/__brick__/android/gradle/wrapper/gradle-wrapper.properties
  • bricks/template/__brick__/android/settings.gradle
  • bricks/template/__brick__/integration_test/real_app_test.dart
  • bricks/template/__brick__/integration_test/screens/home_screen_test.dart
  • bricks/template/__brick__/integration_test/utils/test_util.dart
  • bricks/template/__brick__/ios/.gitignore
  • bricks/template/__brick__/ios/Flutter/AppFrameworkInfo.plist
  • bricks/template/__brick__/ios/Flutter/Debug.xcconfig
  • bricks/template/__brick__/ios/Flutter/Release.xcconfig
  • bricks/template/__brick__/ios/Podfile
  • bricks/template/__brick__/ios/Runner.xcodeproj/project.pbxproj
  • bricks/template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • bricks/template/__brick__/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme
  • bricks/template/__brick__/lib/app/screens/home/home_screen.dart
  • bricks/template/__brick__/lib/app/screens/home/home_view_model.dart
  • bricks/template/__brick__/lib/data/remote/models/responses/user_response.dart
  • bricks/template/__brick__/lib/di/interceptor/app_interceptor.dart
  • bricks/template/__brick__/lib/di/module/network_module.dart
  • bricks/template/__brick__/lib/di/module/storage_module.dart
  • bricks/template/__brick__/lib/di/provider/dio_provider.dart
  • bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart
  • bricks/template/__brick__/lib/domain/models/user.dart
  • bricks/template/__brick__/lib/domain/usecases/get_users_use_case.dart
  • bricks/template/__brick__/lib/env.dart
  • bricks/template/__brick__/lib/main.dart
  • bricks/template/__brick__/pubspec.yaml
  • bricks/template/__brick__/test/app/screens/home/home_view_model_test.dart
  • bricks/template/__brick__/test/data/repositories/credential_repository_test.dart
  • bricks/template/__brick__/test/domain/usecases/get_users_use_case_test.dart
  • bricks/template/__brick__/test/mocks/data/remote/models/responses/user_response_mocks.dart
  • bricks/template/__brick__/test/mocks/generate_mocks.dart
  • bricks/template/brick.yaml
  • bricks/template/hooks/bundles/permission_handler_bundle.dart
  • bricks/template/hooks/pubspec.yaml
  • sample/.env.example
  • sample/.env.sample
  • sample/.github/workflows/android_deploy_production.yml
  • sample/.github/workflows/android_deploy_production_to_playstore.yml
  • sample/.github/workflows/android_deploy_staging.yml
  • sample/.github/workflows/ios_deploy_staging_to_firebase.yml
  • sample/.github/workflows/ios_deploy_to_app_store.yml
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • sample/.github/workflows/test.yml
  • sample/.gitignore
  • sample/.metadata
  • sample/README.md
  • sample/android/app/build.gradle
  • sample/android/app/proguard-rules.pro
  • sample/android/build.gradle
  • sample/android/gradle.properties
  • sample/android/gradle/wrapper/gradle-wrapper.properties
  • sample/android/settings.gradle
  • sample/integration_test/real_app_test.dart
  • sample/integration_test/screens/home_screen_test.dart
  • sample/integration_test/utils/test_util.dart
  • sample/ios/.gitignore
  • sample/ios/Flutter/AppFrameworkInfo.plist
  • sample/ios/Flutter/Debug.xcconfig
  • sample/ios/Flutter/Release.xcconfig
  • sample/ios/Podfile
  • sample/ios/Runner.xcodeproj/project.pbxproj
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme
  • sample/lib/app/screens/home/home_screen.dart
  • sample/lib/app/screens/home/home_view_model.dart
  • sample/lib/data/remote/models/responses/user_response.dart
  • sample/lib/di/interceptor/app_interceptor.dart
  • sample/lib/di/module/network_module.dart
  • sample/lib/di/module/storage_module.dart
  • sample/lib/di/provider/dio_provider.dart
  • sample/lib/domain/exceptions/network_exceptions.dart
  • sample/lib/domain/models/user.dart
  • sample/lib/domain/usecases/get_users_use_case.dart
  • sample/lib/env.dart
  • sample/lib/main.dart
  • sample/lib/utils/wrappers/permission_wrapper.dart
  • sample/pubspec.yaml
  • sample/test/app/screens/home/home_view_model_test.dart
  • sample/test/data/repositories/credential_repository_test.dart
  • sample/test/domain/usecases/get_users_use_case_test.dart
  • sample/test/mocks/data/remote/models/responses/user_response_mocks.dart
  • sample/test/mocks/generate_mocks.dart
💤 Files with no reviewable changes (14)
  • sample/.env.sample
  • bricks/template/brick/.env.sample
  • sample/android/app/proguard-rules.pro
  • sample/ios/Flutter/Debug.xcconfig
  • bricks/template/brick/android/app/proguard-rules.pro
  • bricks/template/brick/android/build.gradle
  • bricks/template/brick/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • sample/android/build.gradle
  • sample/ios/Runner.xcodeproj/xcshareddata/xcschemes/staging.xcscheme
  • bricks/template/brick/ios/Flutter/Release.xcconfig
  • sample/ios/Flutter/Release.xcconfig
  • bricks/template/brick/ios/Runner.xcodeproj/xcshareddata/xcschemes/production.xcscheme
  • bricks/template/brick/ios/Flutter/Debug.xcconfig
✅ Files skipped from review due to trivial changes (62)
  • bricks/template/brick/.github/workflows/android_deploy_production_to_playstore.yml
  • .gitignore
  • bricks/permission_handler/brick/{{~ _pubspec_dependency.yaml }}
  • bricks/template/brick/.env.staging
  • sample/.env.example
  • .github/workflows/ios_deploy_staging_to_firebase.yml
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • bricks/template/brick/lib/data/remote/models/responses/user_response.dart
  • sample/lib/data/remote/models/responses/user_response.dart
  • .github/workflows/ios_deploy_to_testflight.yml
  • .fvmrc
  • sample/.github/workflows/ios_deploy_to_app_store.yml
  • bricks/template/brick/integration_test/real_app_test.dart
  • sample/android/gradle.properties
  • bricks/permission_handler/brick.yaml
  • sample/ios/Flutter/AppFrameworkInfo.plist
  • sample/.github/workflows/test.yml
  • bricks/permission_handler/brick/lib/utils/wrappers/permission_wrapper.dart
  • sample/android/gradle/wrapper/gradle-wrapper.properties
  • sample/ios/.gitignore
  • bricks/template/brick/.github/workflows/ios_deploy_to_app_store.yml
  • bricks/template/brick/test/mocks/data/remote/models/responses/user_response_mocks.dart
  • bricks/template/brick/android/gradle/wrapper/gradle-wrapper.properties
  • bricks/template/brick/.github/workflows/test.yml
  • sample/lib/env.dart
  • bricks/template/brick/.metadata
  • bricks/template/brick/ios/.gitignore
  • sample/integration_test/real_app_test.dart
  • .github/workflows/android_deploy_production.yml
  • sample/test/mocks/data/remote/models/responses/user_response_mocks.dart
  • bricks/template/brick/lib/env.dart
  • bricks/template/brick/ios/Flutter/AppFrameworkInfo.plist
  • sample/.github/workflows/android_deploy_production_to_playstore.yml
  • sample/integration_test/screens/home_screen_test.dart
  • sample/.metadata
  • sample/.github/workflows/android_deploy_production.yml
  • bricks/template/brick/.github/workflows/android_deploy_production.yml
  • sample/test/domain/usecases/get_users_use_case_test.dart
  • .github/workflows/android_deploy_staging.yml
  • bricks/template/brick/test/domain/usecases/get_users_use_case_test.dart
  • sample/lib/utils/wrappers/permission_wrapper.dart
  • sample/lib/domain/models/user.dart
  • .github/workflows/android_deploy_production_to_playstore.yml
  • bricks/template/brick/lib/di/module/network_module.dart
  • sample/lib/di/provider/dio_provider.dart
  • bricks/template/brick/integration_test/screens/home_screen_test.dart
  • bricks/template/brick/lib/di/provider/dio_provider.dart
  • sample/lib/domain/usecases/get_users_use_case.dart
  • sample/lib/app/screens/home/home_view_model.dart
  • .github/workflows/test.yml
  • bricks/template/hooks/pubspec.yaml
  • bricks/template/brick/lib/app/screens/home/home_view_model.dart
  • bricks/template/brick/lib/domain/models/user.dart
  • sample/.gitignore
  • bricks/template/brick/.env
  • bricks/template/brick/test/app/screens/home/home_view_model_test.dart
  • sample/ios/Runner.xcodeproj/project.pbxproj
  • bricks/template/brick/lib/domain/usecases/get_users_use_case.dart
  • sample/lib/di/module/network_module.dart
  • sample/test/app/screens/home/home_view_model_test.dart
  • bricks/template/hooks/bundles/permission_handler_bundle.dart
  • bricks/template/brick/ios/Runner.xcodeproj/project.pbxproj
🚧 Files skipped from review as they are similar to previous changes (28)
  • .github/workflows/ios_deploy_to_app_store.yml
  • sample/.github/workflows/ios_deploy_staging_to_firebase.yml
  • bricks/template/brick/.github/workflows/android_deploy_staging.yml
  • bricks/template/brick/android/gradle.properties
  • bricks/template/brick/lib/di/module/storage_module.dart
  • bricks/template/brick/test/mocks/generate_mocks.dart
  • bricks/template/brick/ios/Podfile
  • sample/test/mocks/generate_mocks.dart
  • bricks/template/brick.yaml
  • sample/android/settings.gradle
  • bricks/template/brick/android/settings.gradle
  • bricks/template/brick/.gitignore
  • bricks/template/brick/README.md
  • bricks/template/brick/lib/di/interceptor/app_interceptor.dart
  • sample/integration_test/utils/test_util.dart
  • sample/.github/workflows/android_deploy_staging.yml
  • sample/test/data/repositories/credential_repository_test.dart
  • bricks/template/brick/android/app/build.gradle
  • bricks/template/brick/.github/workflows/ios_deploy_to_testflight.yml
  • sample/pubspec.yaml
  • bricks/template/brick/lib/domain/exceptions/network_exceptions.dart
  • sample/android/app/build.gradle
  • sample/lib/di/interceptor/app_interceptor.dart
  • sample/ios/Podfile
  • sample/lib/domain/exceptions/network_exceptions.dart
  • bricks/template/brick/lib/main.dart
  • bricks/permission_handler/brick/{{~ _Podfile_build_configurations }}
  • bricks/template/brick/lib/app/screens/home/home_screen.dart

Comment thread bricks/template/__brick__/pubspec.yaml
Comment thread bricks/template/__brick__/pubspec.yaml
Comment thread sample/lib/app/screens/home/home_screen.dart Outdated
Comment thread sample/lib/main.dart
Comment thread sample/README.md
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.

♻️ Duplicate comments (1)
sample/.env (1)

2-2: ⚠️ Potential issue | 🟠 Major

Avoid tracking secret-like runtime env keys in committed .env files.

Line 2 still introduces a SECRET key in a tracked runtime .env file. Even with sample content, this pattern can normalize committing secrets in generated apps. Prefer tracked *.example files with placeholders and keep runtime .env* ignored.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sample/.env` at line 2, Remove the actual SECRET value from the tracked .env,
replace it with a placeholder in a tracked sample (e.g., create or update
.env.example with SECRET=your-secret-here), and ensure runtime .env files are
not committed by adding .env and .env.* to .gitignore; specifically delete or
blank the SECRET entry in the committed .env, add the placeholder SECRET in
.env.example, and confirm .gitignore contains ".env" and ".env.*".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@sample/.env`:
- Line 2: Remove the actual SECRET value from the tracked .env, replace it with
a placeholder in a tracked sample (e.g., create or update .env.example with
SECRET=your-secret-here), and ensure runtime .env files are not committed by
adding .env and .env.* to .gitignore; specifically delete or blank the SECRET
entry in the committed .env, add the placeholder SECRET in .env.example, and
confirm .gitignore contains ".env" and ".env.*".

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 917f5484-fe91-4377-9128-125f22d4b6ca

📥 Commits

Reviewing files that changed from the base of the PR and between 651f6dc and 2ce64d9.

📒 Files selected for processing (5)
  • bricks/template/__brick__/lib/domain/exceptions/network_exceptions.dart
  • sample/.env
  • sample/.env.staging
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • sample/.gitignore
✅ Files skipped from review due to trivial changes (1)
  • sample/.env.staging
🚧 Files skipped from review as they are similar to previous changes (3)
  • sample/.github/workflows/ios_deploy_to_testflight.yml
  • sample/.gitignore
  • bricks/template/brick/lib/domain/exceptions/network_exceptions.dart

Rename sample env display key to SAMPLE_CONFIG across template and sample files, add public-config security notes, include sample runtime env asset files for dotenv loading, and bump template/sample Android AGP to 8.12.1.
@ducbm051291 ducbm051291 force-pushed the chore/288-upgrade-flutter-and-deps branch from 5dc91f6 to d8eeea8 Compare April 23, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Flutter version and library versions

2 participants