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

[BUG] AnimationController callback is not executing in background mode #64

Open
JLoRenderer opened this issue Oct 14, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@JLoRenderer
Copy link

Describe the bug
Callback form an AnimationController is not executing in background mode.

To Reproduce
AnimationController? _controller;
_controller = AnimationController(
vsync: this,
duration: Duration(seconds: 10),
);
_controller!.addStatusListener((status) {
switch (status) {
case AnimationStatus.forward:
_onStart();
break;

    case AnimationStatus.reverse:
      _onStart();
      break;

    case AnimationStatus.dismissed:
      _onComplete();
      break;
    case AnimationStatus.completed:

    default:
    // Do nothing
  }

void _onComplete() {
debugPrint("this does not get called while the screen is off");
}

Expected behavior
The animation should be continiued in the background and the callback should be called, after AnimationStatus is updated.

Screenshots
Not applicable.

Smartphone:

  • Device: Android Emulator API 32 & Samsung Node 9 Android 11
Logs I don't feel comfortable to share this information , but I looked at it and there was nothing which would explain this. ``` ```

flutter doctor -v
[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.2130], locale de-DE)
• Flutter version 3.0.5 at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f1875d570e (3 months ago), 2022-07-13 11:24:16 -0700
• Engine revision e85ea0e79c
• Dart version 2.17.6
• DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1)
• Android SDK at C:\Users\Johannes\AppData\Local\Android\Sdk
• Platform android-Tiramisu, build-tools 32.0.0-rc1
• ANDROID_HOME = C:\Users\Johannes\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.2.32526.322
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code, 64-bit edition (version 1.71.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.48.0

[√] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 32) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19044.2130]
• Chrome (web) • chrome • web-javascript • Google Chrome 106.0.5249.119
• Edge (web) • edge • web-javascript • Microsoft Edge 105.0.1343.42

[√] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!

@JLoRenderer JLoRenderer added the bug Something isn't working label Oct 14, 2022
@JLoRenderer
Copy link
Author

To clarify: The animation continues while the screen is off , but the callback is not executed.

@atreeon
Copy link

atreeon commented Apr 4, 2023

Did you manage to get this to work @JLoRenderer ?

@JLoRenderer
Copy link
Author

@atreeon Sadly not, but I also didn't try very hard, was just for a personal project. Also was a long time ago, don't know if it is fixed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants