Skip to content

Conversation

@Amit-Matth
Copy link
Contributor

@Amit-Matth Amit-Matth commented Jan 11, 2026

This PR refactors IDeviceService to initialize the device size once at application startup and expose it via a synchronous Riverpod provider, avoiding repeated getSizeInPixels() calls and ensuring a stable device size throughout the app lifecycle.

PAINTROID-733

New Features and Enhancements

  • Synchronous Size Provider: Migrated IDeviceService.sizeProvider from a FutureProvider to a synchronous Provider, eliminating the need for AsyncValue handling in the UI.
  • Optimized Initialization: Updated main.dart to resolve the device size before app startup, ensuring the canvas and dependent services have valid dimensions from the first frame.

Refactorings and Bug Fixes

  • Test Suite Recovery: Fixed UnimplementedError crashes across widget and integration tests by providing proper IDeviceService.sizeProvider overrides.
  • Code Simplification: Removed redundant future-handling logic and .map() calls in LandingPage and DrawingCanvas, resulting in cleaner state management.
  • Robust Integration Testing: Stabilized the heart shape test in shapes_tool_test.dart by making pixel assertions resilient to anti-aliasing variations.
  • Consistent Test Environment: Updated manual ProviderContainer usage and adjusted canvas size expectations in landing_page_test.dart to match overridden test dimensions (1080×1920).

Checklist

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Add the link to the ticket in Jira in the description of the PR
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines (Wiki)
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Add new information to the Wiki

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant