-
Notifications
You must be signed in to change notification settings - Fork 1k
Refactor: Replace deprecated Flutter APIs for compatibility with newer versions #233
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes the Flutter codebase by replacing deprecated APIs with their current recommended equivalents, ensuring compatibility with newer Flutter versions while maintaining all existing functionality.
Key changes:
- Replaced
withOpacity()withwithValues(alpha:)for color opacity modifications - Updated color component accessors from
.red/.green/.blue/.opacityto.r/.g/.b/.a - Migrated
textScaleFactorandtextScaleFactorOfto the newerTextScalerAPI - Changed
mountedproperty checks tocontext.mountedfor better context safety - Refactored
forEachto standardforloops where appropriate
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| petra_illustration.dart | Updated opacity method calls on foreground colors |
| illustration_piece.dart | Code formatting adjustments |
| _wonder_image_with_timeline.dart | Migrated color component accessors to new API |
| _events_list.dart | Updated backdrop color opacity usage |
| _event_markers.dart | Replaced opacity method calls for marker colors |
| _animated_cutout_overlay.dart | Updated overlay color opacity |
| intro_screen.dart | Migrated gradient color opacity |
| home_menu.dart | Updated mounted check and multiple color opacity calls |
| about_dialog_content.dart | Migrated text scale factor to TextScaler API |
| wonders_home_screen.dart | Updated multiple gradient and color opacity calls |
| _scrolling_content.dart | Migrated text scale factor and updated color opacity |
| _collapsing_pull_quote_image.dart | Updated gradient color opacity values |
| _app_bar.dart | Updated overlay color opacity |
| _collection_footer.dart | Updated footer gradient and progress bar colors |
| _collectible_image.dart | Updated shadow color opacity |
| _celebration_particles.dart | Updated particle color opacity |
| collectible_found_screen.dart | Updated multiple screen color opacity calls |
| _search_input.dart | Updated input decoration color opacity values |
| _results_grid.dart | Updated result tile background opacity |
| _result_tile.dart | Updated tile color opacity |
| time_range_painter.dart | Updated paint fill color opacity |
| range_selector.dart | Updated selector decoration color opacity values |
| expanding_time_range_selector.dart | Updated container and timeline colors |
| artifact_search_screen.dart | Updated icon color opacity |
| _artifact_image_btn.dart | Updated gradient color opacity |
| _blurred_image_bg.dart | Updated background foreground decoration opacity |
| artifact_carousel_screen.dart | Updated carousel container color opacity |
| static_text_scale.dart | Migrated textScaleFactor to TextScaler API |
| list_gradient.dart | Updated gradient color opacity values |
| fade_color_transition.dart | Updated transition color opacity |
| scroll_decorator.dart | Updated scroll gradient color opacity |
| checkbox.dart | Updated checkbox color opacity values |
| app_image.dart | Updated placeholder icon color opacity |
| app_backdrop.dart | Updated backdrop fill color opacity |
| styles.dart | Updated shadow color opacity values |
| color_utils.dart | Migrated color component accessors to new API |
| app_logic.dart | Refactored forEach to for loops |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
This PR updates the codebase to remove usage of deprecated Flutter APIs.
Changes include:
All changes are backward-compatible and do not alter UI or functionality.