Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile: Update to flutter 3.22.3 and packages #964

Merged
merged 13 commits into from
Dec 17, 2024

Conversation

KarinBerg
Copy link
Contributor

@KarinBerg KarinBerg commented Dec 2, 2024

Upgrade Flutter and its packages to the latest possible without changing the minimal supported versions of iOS and Android.

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated Flutter SDK to version 3.22.3 for improved performance and compatibility.
    • Enhanced localization with new methods for clearer user interface elements.
  • Improvements

    • Streamlined instructions in the README for building the app on Apple Silicon Macs.
    • Updated button styling logic for better visual consistency across different states.
    • Adjusted app theme configuration for a cleaner appearance.
  • Bug Fixes

    • Fixed potential build errors related to Java and Flutter configurations.
  • Dependencies

    • Updated various dependencies to their latest versions to ensure optimal functionality and security.

Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
public ⬜️ Ignored (Inspect) Visit Preview Dec 15, 2024 6:07pm

Copy link

coderabbitai bot commented Dec 2, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request includes updates to various files in the recipients_app project. Key changes involve upgrading the Flutter SDK version from 3.19.6 to 3.22.3 in the .tool-versions file and updating the corresponding references in the README and pubspec.yaml. The build script has been adjusted to dynamically retrieve the required Flutter version. Additionally, localization classes have been modified to enhance clarity, and button styling has been updated to use WidgetStateProperty. Dependencies have also been updated to their latest versions.

Changes

File Change Summary
recipients_app/.tool-versions Updated Flutter version from 3.19.6 to 3.22.3.
recipients_app/README.md Updated Flutter version reference, streamlined setup instructions, clarified Java and Flutter setup, expanded asdf section, refined build instructions, and modified upgrade section.
recipients_app/clean_build.sh Changed version check to dynamically retrieve from .tool-versions, added feedback for version match.
recipients_app/lib/kri_intl.dart Updated delegate declarations to a concise format, added clearButtonTooltip and selectedDateLabel methods.
recipients_app/lib/ui/buttons/button_outlined_big.dart Replaced MaterialStateProperty with WidgetStateProperty for button styling.
recipients_app/lib/ui/buttons/button_small.dart Replaced MaterialStateProperty with WidgetStateProperty for button styling.
recipients_app/lib/ui/configs/app_theme.dart Removed background property from light theme colorScheme.
recipients_app/pubspec.yaml Incremented version number, updated Dart SDK and Flutter version, and updated multiple dependencies.

Possibly related PRs

Suggested reviewers

  • andrashee
  • novas1r1
  • mkue
  • MDikkii
  • ssandino

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. This feature will be included in our Pro Plan when released.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6469a78 and 3633806.

📒 Files selected for processing (1)
  • recipients_app/README.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipients_app/README.md

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ssandino ssandino changed the title Update to flutter 3.22.3 and update flutter packages Mobile: Update to flutter 3.22.3 and packages Dec 6, 2024
@ssandino ssandino added the mobile Issues concerning Mobile App label Dec 6, 2024
@KarinBerg KarinBerg marked this pull request as ready for review December 7, 2024 17:05
Copy link

github-actions bot commented Dec 7, 2024

Visit the preview URL for this PR (updated for commit 9ba3150):

https://si-admin-staging--pr964-karin-update-to-flut-p9l4veaz.web.app

(expires Sat, 14 Dec 2024 17:07:08 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: b7b0969384059dce6ea8fad1ee1d1737e54e6676

Copy link

@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: 0

🧹 Outside diff range and nitpick comments (3)
recipients_app/clean_build.sh (1)

15-22: Enhance version extraction robustness

The version extraction logic could be more resilient to file format changes.

Consider this more robust implementation:

-REQUIRED_VERSION=$(grep flutter .tool-versions | awk '{print $2}')
+REQUIRED_VERSION=$(grep "^flutter" .tool-versions | awk '{print $2}' || echo "")
+if [ -z "$REQUIRED_VERSION" ]; then
+    echo "Error: Could not determine required Flutter version from .tool-versions"
+    exit 1
+fi
recipients_app/README.md (2)

8-8: Add explicit version information

While referencing .tool-versions is good for maintenance, adding the current version number in parentheses would improve clarity.

-Flutter (Version see file .tool-versions)
+Flutter (Version see file .tool-versions, currently 3.22.3)

Line range hint 15-40: Add environment verification steps

The Java and Flutter setup instructions would benefit from verification steps.

Add these verification commands after the setup instructions:

# Verify Java setup
java -version  # Should show version 17
echo $JAVA_HOME  # Should point to Java 17 installation

# Verify Flutter setup
flutter doctor -v  # Should show all checkmarks
flutter config --jdk-dir  # Should show the correct Java 17 path
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 43c070f and 9ba3150.

⛔ Files ignored due to path filters (1)
  • recipients_app/pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • recipients_app/.tool-versions (1 hunks)
  • recipients_app/README.md (1 hunks)
  • recipients_app/clean_build.sh (2 hunks)
  • recipients_app/lib/kri_intl.dart (4 hunks)
  • recipients_app/lib/ui/buttons/button_outlined_big.dart (1 hunks)
  • recipients_app/lib/ui/buttons/button_small.dart (2 hunks)
  • recipients_app/lib/ui/configs/app_theme.dart (0 hunks)
  • recipients_app/pubspec.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • recipients_app/lib/ui/configs/app_theme.dart
✅ Files skipped from review due to trivial changes (1)
  • recipients_app/.tool-versions
🔇 Additional comments (8)
recipients_app/lib/ui/buttons/button_outlined_big.dart (1)

24-25: LGTM: API migration for Flutter 3.22.3

The change from MaterialStateProperty to WidgetStateProperty is correct and aligns with Flutter's API updates.

recipients_app/pubspec.yaml (2)

8-9: Verify Dart SDK compatibility

The Dart SDK requirement has been increased to >=3.4.4. Ensure all team members have updated their development environment.

✅ Verification successful

SDK version 3.4.4 appears compatible with the codebase

The codebase scan shows only standard switch statements and no usage of newer Dart features like record classes, extension types, or pattern matching that would require Dart SDK 3.4.4 or higher.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if any Dart files use features not available in 3.4.4
rg -l 'record\s+class|extension\s+type|switch\s+expression' 

Length of output: 61


Script:

#!/bin/bash
# Let's check for Dart files in the repository first
fd -e dart

# Then let's look for pattern matches that might indicate newer Dart features
rg -l 'sealed\s+class|base\s+class|interface\s+class|final\s+class|mixin\s+class|inline\s+class|\bswitch\s*\(' 

# Also check for pattern matches in imports that might indicate usage of newer SDK features
rg -l 'dart:.*\s+show.*Record\b|dart:.*\s+show.*Pattern\b'

Length of output: 8073


14-39: Verify package compatibility

Several packages have been updated. Notable changes:

  • firebase_core: ^2.32.0
  • intl: ^0.19.0
  • sentry_flutter: ^8.10.1
✅ Verification successful

Package updates appear safe to proceed

The codebase uses standard APIs from Firebase Core, Intl, and Sentry packages. No deprecated patterns were found, and the usage is straightforward without any complex customizations that might be affected by the updates.

  • Firebase Core is only used for basic app initialization
  • Intl usage is limited to standard date formatting and phone number input
  • Sentry implementation follows the standard integration pattern
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any deprecated API usage in the codebase
rg -l 'deprecated|@deprecated'

# Check changelog files for breaking changes
fd -e md -e txt -g "*change*" -x cat {}

Length of output: 119


Script:

#!/bin/bash
# Check for specific Firebase Core usage patterns that might be affected by the update
rg -p "firebase.*core" -g "!*.lock" -g "!*.yaml"

# Check for Intl usage patterns that might be affected by the update
rg -p "import.*intl" -g "!*.lock" -g "!*.yaml"

# Check for Sentry usage patterns that might be affected by the update
rg -p "import.*sentry" -g "!*.lock" -g "!*.yaml"

# Look for any Firebase initialization code
ast-grep --pattern 'Firebase.initializeApp($$$)'

Length of output: 1806

recipients_app/lib/ui/buttons/button_small.dart (1)

33-35: LGTM: Consistent API migration

The MaterialStateProperty to WidgetStateProperty migration is correctly applied for both outlined and filled button variants.

Also applies to: 58-60

recipients_app/lib/kri_intl.dart (4)

416-416: LGTM: Simplified delegate declaration

The delegate declaration has been simplified to a single line, which improves readability.


461-461: LGTM: Added required date picker order method

Added the required datePickerDateTimeOrder method to support the new Flutter version's date picker functionality.


665-665: LGTM: Simplified delegate declaration

The delegate declaration has been simplified to a single line, consistent with the change in the Cupertino localizations.


1134-1139: LGTM: Added required localization methods

Added new required methods clearButtonTooltip and selectedDateLabel to support the new Flutter version's functionality.

…S build error with the message "Cannot find type 'PhoneNumberKit' in scope".

v0.8.0 is not publish on pub.dev but it is released on Github.
@KarinBerg KarinBerg merged commit 44ade87 into main Dec 17, 2024
16 checks passed
@KarinBerg KarinBerg deleted the karin/update-to-flutter-3.22.3-and-update-packages branch December 17, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Issues concerning Mobile App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants