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

[Question]: UserAccelerometerEvent not working #2654

Open
8 tasks done
RafaelFurlan20 opened this issue Mar 4, 2024 · 0 comments
Open
8 tasks done

[Question]: UserAccelerometerEvent not working #2654

RafaelFurlan20 opened this issue Mar 4, 2024 · 0 comments
Labels
question Further information is requested

Comments

@RafaelFurlan20
Copy link

RafaelFurlan20 commented Mar 4, 2024

What is your question?

Hello I'm making an app that collects data from all sensors, but unfotunatelly UserAccelerometerEvent is not working, the other sensors are working fine, but UserAccelerometerEvent is only working when the app is in the background.
The card bellow is only updated when I leave the app and then return to it.
` DynamicCard(
streamCard: StreamBuilder(
stream: accelerometerEventStream(),
builder: (context, snapshot) {
if (snapshot.hasData) {
accelerometeRawX = snapshot.data!.x;
accelerometeRawY = snapshot.data!.y;
accelerometeRawZ = snapshot.data!.z;

                    return Column(
                      crossAxisAlignment: CrossAxisAlignment.center,
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Text(
                          'Accelerometer Raw Data:',
                          textAlign: TextAlign.center,
                          style: kTextStyleInnerTitleBox,
                        ),
                        Text(
                          'x: ${accelerometeRawX.toStringAsFixed(5)}',
                          style: kTextStyleInnerBodyBox,
                        ),
                        Text(
                          'y: ${accelerometeRawY.toStringAsFixed(5)}',
                          style: kTextStyleInnerBodyBox,
                        ),
                        Text(
                          'z: ${accelerometeRawZ.toStringAsFixed(5)}',
                          style: kTextStyleInnerBodyBox,
                        ),
                      ],
                    );
                  } else {
                    return Text('No data');
                  }
                },
              ),
            ),`

Checklist before submitting a question

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I am using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@RafaelFurlan20 RafaelFurlan20 added the question Further information is requested label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant