Skip to content

feat: added Accelerometer screen #2709

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

Merged
merged 3 commits into from
Jun 4, 2025

Conversation

Vidhijain20
Copy link
Contributor

@Vidhijain20 Vidhijain20 commented May 31, 2025

Adds the Accelerometer screen.

Screenshots / Recordings

Checklist:

  • No hard coding: I have used resources from strings.xml, dimens.xml and colors.xml without hard coding any value.
  • No end of file edits: No modifications done at end of resource files strings.xml, dimens.xml or colors.xml.
  • Code reformatting: I have reformatted code and fixed indentation in every file included in this pull request.
  • No extra space: My code does not contain any extra lines or extra spaces than the ones that are necessary.

Summary by Sourcery

Add a new Accelerometer screen and its widgets to display live accelerometer data and integrate it into the app’s navigation flow.

New Features:

  • Introduce Accelerometer screen showing live x, y, and z axis readings with min, max, and graph visualization.
  • Implement AccelerometerCard widget that subscribes to accelerometer events and plots them using FLChart.

Enhancements:

  • Register '/accelerometer' route in main app and update instruments screen to navigate to the Accelerometer screen.

Build:

  • Add sensors_plus dependency for accelerometer data acquisition.

Copy link

sourcery-ai bot commented May 31, 2025

Reviewer's Guide

Introduces a new Accelerometer screen with real-time sensor data visualization, updates navigation logic to include the accelerometer route, and manages dependencies and routing.

File-Level Changes

Change Details Files
Enhanced instruments screen navigation to support the accelerometer screen
  • Added case 7 in tap handler
  • Checked existing route and used popUntil for '/accelerometer'
  • Fallback to pushNamedAndRemoveUntil for '/accelerometer'
lib/view/instruments_screen.dart
Registered the new accelerometer route in app routing
  • Imported AccelerometerScreen
  • Added '/accelerometer' entry to routes map
lib/main.dart
Added sensors_plus package for accelerometer data
  • Declared sensors_plus:^6.1.1 under dependencies
pubspec.yaml
Created AccelerometerCard widget for live data charts
  • Subscribed to accelerometerEventStream and updated state
  • Tracked current, min, and max values per axis
  • Rendered line chart with fl_chart and axis labels
  • Structured UI with image, values, and chart in a Card
lib/view/widgets/accelerometer_card.dart
Built AccelerometerScreen to host three axis cards
  • Used CommonScaffold with title 'Accelerometer'
  • Placed three AccelerometerCard instances for x, y, z axes in a column
lib/view/accelerometer_screen.dart

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

github-actions bot commented May 31, 2025

@AsCress AsCress self-requested a review June 3, 2025 11:52
@Vidhijain20 Vidhijain20 marked this pull request as ready for review June 3, 2025 16:31
@Vidhijain20
Copy link
Contributor Author

@AsCress @CloudyPadmal Could you please review this?

@AsCress AsCress requested a review from CloudyPadmal June 3, 2025 16:44
@CloudyPadmal CloudyPadmal merged commit 5c9f425 into fossasia:flutter Jun 4, 2025
5 checks passed
Yugesh-Kumar-S added a commit to Yugesh-Kumar-S/pslab-android that referenced this pull request Jun 4, 2025
feat: added Accelerometer screen (fossasia#2709)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants