Steps to reproduce:
- Use the default flutter app
- Convert stateless into statefull widget
- Insert the following code into the class _MyAppState
@override
void initState() {
super.initState();
Once.runOnNewDay(
'testonce',
callback: () {
debugPrint("Once is running");
return true;
},
debugCallback: true,
fallback: () {
debugPrint("Fallback triggered");
}
);
}
After starting the app for the first time the console shows
I/flutter (26773): Once is running
After stopping the app and running it again the console shows:
I/flutter (27127): Once is running
Expected behavior: I would expect to get the log message the first time the app is running but not the second time.
Running on Android Emulator.
Output of flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on Ubuntu 20.04.4 LTS 5.13.0-52-generic, locale de_DE.UTF-8)
• Flutter version 3.0.5 at /home/olf/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f1875d570e (vor 5 Wochen), 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 31.0.0)
• Android SDK at /home/olf/Android/Sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /opt/android-studio-2021.2.1/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
• cmake version 3.10.2
• ninja version 1.8.2
• pkg-config version 0.29.1
[✓] Android Studio (version 2021.2)
• Android Studio at /opt/android-studio-2021.2.1/android-studio
• Flutter plugin version 69.0.2
• Dart plugin version 212.5744
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] Android Studio
• Android Studio at /opt/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+0-b1504.28-7817840)
[✓] Connected device (3 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator)
• Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.4 LTS 5.13.0-52-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.101
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.