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

[flutter_local_notifications] Fixes #1486 :Adds ability to count down chronometer with chronometerCountDown #1778

Merged
merged 6 commits into from Dec 3, 2022

Conversation

ebelevics
Copy link
Contributor

Fixes #1486, #791, #306

chronometerCountDown will only work for Android devices that are 7.0 or newer. But this will do the trick for updating timer without updating notification every single second.

AndroidNotificationDetails(
          _channelKey,
          'Channel',
          channelDescription: 'Description',
          when: endAt.millisecondsSinceEpoch, // should be greater than DateTime.now()
          timeoutAfter: endAt.difference(DateTime.now()).inMilliseconds, // this will ensure that notification will hide after reaching 0:00
          usesChronometer: true,
          chronometerCountDown: true, // chronometer will go backwards from positive to negative
        ),

@ebelevics
Copy link
Contributor Author

Noticed typo at notification_details.dart. Should be /// This property is only applicable to Android 7.0 and newer versions.

@MaikuB
Copy link
Owner

MaikuB commented Nov 16, 2022

Thanks for the PR. Could you push an update to fix the issue in the API docs that you had mentioned in your previous message?

@ebelevics
Copy link
Contributor Author

Api doc corrected

@MaikuB
Copy link
Owner

MaikuB commented Nov 17, 2022

Thanks for the update. The unit tests are failing due to the updates made in this PR, could you look to address this as well?

@ebelevics
Copy link
Contributor Author

Sorry for delay, done.

@MaikuB MaikuB merged commit cb05fb7 into MaikuB:master Dec 3, 2022
mgonzalezc pushed a commit to developmentMindapps/flutter_local_notifications that referenced this pull request Apr 12, 2023
…_flutter_local_notifications

* commit '4b723e750d1371206520b10a122a444c4bba7475': (76 commits)
  [flutter_local_notifications] update docs on initialize method to describe callbacks more (MaikuB#1841)
  enable usePubspecOverrides with melos (MaikuB#1822)
  replaced placeholder.com with dummyimage.com in example app due to Cloudflare blocking requests (MaikuB#1821)
  Google Java Format
  [flutter_local_notifications] Fixes MaikuB#1486 :Adds ability to count down chronometer with chronometerCountDown (MaikuB#1778)
  Implement options to hide or crop attachments in the thumbnail on iOS (MaikuB#1785)
  bump linux plugin's Flutter version requirement to 3.0.0 and add explicit ffi dependency (MaikuB#1812)
  [flutter_local_notifications] re-add imports needed for Flutter 3.0 and add build tasks that use Flutter 3.0 (MaikuB#1811)
  updated example app to not request the ability to display critical alerts (MaikuB#1809)
  Add note about keeping `@mipmap/ic_launcher` resource (MaikuB#1804)
  Recommend WindowManager to fix Android 12L+ bugs (MaikuB#1803)
  [flutter_local_notifications] Upgraded Android Gradle Plugin to fix Android build (MaikuB#1781)
  [flutter_local_notifications] fixes parsing of callback handles for notification actions on Android (MaikuB#1798)
  [flutter_local_notifications] fix Kotlin version used in example app (MaikuB#1791)
  Updates readme for iOS Setup (MaikuB#1776)
  added missing kudos for contributions relating to flutter_local_notifications 12.0.3 release
  release flutter_local_notifications 12.0.3
  updated code snippet  in readme on requesting permissions on Android (MaikuB#1754)
  Google Java Format
  Drop registerWith in Android plugin (MaikuB#1745)
  ...
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.

Timer in notification
2 participants