Kronos - NTP plugin for Flutter

Overview

Kronos - NTP plugin for Flutter

Unlike the device clock, the time reported by Kronos is unaffected when the local time is changed while your app is running. Instead, Kronos stores accurate time along with a delta between the NTP time and the system uptime. Since uptime increases monotonically, Kronos isn't affected by device time changes. Accessing KronosClock.getCurrentTimeMs() will return the local time based on the last known accurate time + delta since last sync.

This plugin is based on Kronos in iOS and Kronos-Android in android for the whole SNTP protocol implementation.

Installation

Just add flutter_kronos as a dependency in your pubspec.yaml file.

Android

Add the following permission in your Android Manifest file:

">
<uses-permission android:name="android.permission.INTERNET"/>

Usage

Sync clock using a pool of NTP servers

Calling Clock.sync will fire a bunch of NTP requests to up to 5 of the servers on the given NTP pool. As soon as we get the first response, the given closure is called but the Clock will keep trying to get a more accurate response.

KronosClock.sync();

Get an NTP time

KronosClock.getCurrentTimeMs(); //return time from the fallback clock if Kronos has not yet been synced
KronosClock.getCurrentNtpTimeMs(); //return null if Kronos has not yet been synced
You might also like...

Flutter-ffmpeg - FFmpeg plugin for Flutter. Not maintained anymore. Superseded by FFmpegKit.

Flutter-ffmpeg - FFmpeg plugin for Flutter. Not maintained anymore. Superseded by FFmpegKit.

flutter_ffmpeg FFmpeg plugin for Flutter. Supports iOS and Android. Not maintained anymore, superseded by FFmpegKit. See FlutterFFmpeg to FFmpegKit Mi

Dec 22, 2022

Rave flutter - A Flutter plugin for Flutterwaves's rave.

Rave flutter - A Flutter plugin for Flutterwaves's rave.

Rave Flutter A robust Flutter plugin for accepting payment on Rave with Card Nigerian Bank Account ACH Payments Mobile money Francophone Africa Mpesa

Oct 6, 2022

A flutter plugin to add login with facebook in your flutter app

A flutter plugin to add login with facebook in your flutter app

Features Login on iOS, Android and Web. Express login on Android. Granted and declined permissions. User information, picture profile and more. Provid

Jan 6, 2023

Flutter blue plus - Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS

Flutter blue plus - Flutter plugin for connecting and communicationg with Bluetooth Low Energy devices, on Android and iOS

Introduction FlutterBluePlus is a bluetooth plugin for Flutter, a new app SDK to

Dec 22, 2022

This is a Flutter plugin that takes a JSON string and converts it onto a customizable Flutter Widget.

This is a Flutter plugin that takes a JSON string and converts it onto a customizable Flutter Widget.

Colored JSON Convert JSON string into customizable widget. Getting Started ColoredJson is a stateless widget that produces a structured view of JSON s

May 20, 2022

Flutter plugin to manage home screen widget within flutter app.

Flutter App Widget App Widget / Home Screen widget plugin for flutter app Usage Please see app_widget subdirectory for the usage documentation. Plafor

Dec 16, 2022

Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter plugin for creating static & dynamic app shortcuts on the home screen.

Flutter Shortcuts Show some ❤️ and ⭐ the repo Why use Flutter Shortcuts? Flutter Shortcuts Plugin is known for : Flutter Shortcuts Fast, performant &

Sep 26, 2022

Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Dec 19, 2022

Flutter plugin to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.

Agora UI Kit for Flutter Instantly integrate Agora video calling or video streaming into your Flutter application. Getting started Requirements An Ago

Dec 16, 2022
Comments
  • Upgrade Gradle

    Upgrade Gradle

    I am unable to run flutter build because it seems that this projects uses a version of gradle that's too old

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ':flutter_kronos' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50
    

    I like this package and I couldn't find anything similar, please help 🙏🏽

    opened by cesare-torchia 0
Releases(v0.0.2+1)
Owner
Hau Tran
Hau Tran
This is just the simplyfied Flutter Plugin use for one of the popular flutter plugin for social media login.

social_media_logins Flutter Plugin to login via Social Media Accounts. Available Social Media Logins: Facebook Google Apple Getting Started To use thi

Reymark Esponilla 3 Aug 24, 2022
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

Flutter permission_handler plugin The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation o

Baseflow 1.7k Dec 31, 2022
Unloc customizations of the Permission plugin for Flutter. This plugin provides an API to request and check permissions.

Flutter Permission handler Plugin A permissions plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check perm

Unloc 1 Nov 26, 2020
Klutter plugin makes it possible to write a Flutter plugin for both Android and iOS using Kotlin only.

The Klutter Framework makes it possible to write a Flutter plugin for both Android and iOS using Kotlin Multiplatform. Instead of writing platform spe

Gillian 33 Dec 18, 2022
A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also have privilege for fully customization from user side. like flipkart, amazon, myntra, meesho.

step_tracker plugin A Flutter step_tracker plugin is collect information from user and display progress through a sequence of steps. this plugin also

Roshan nahak 5 Oct 21, 2022
Boris Gautier 1 Jan 31, 2022
A Side Menu plugin for flutter and compatible with liquid ui for flutter

Liquid Shrink Side Menu A Side Menu plugin for flutter and compatible with liquid ui Side Menu Types There are 8 configuration of Liquid shrink side m

Raj Singh 18 Nov 24, 2022
FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts

中文文档 中文介绍 Release Note v3.0-preview.17 PS: Before updating the beta version, please read the CHANGELOG to see if there are any BREAKING CHANGE Flutter

Alibaba 6.3k Dec 30, 2022
Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable.

Flutter Counter (iOS & Android) Description Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable. Create i

Salmaan Ahmed 15 Sep 18, 2022
Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

null 97 Dec 14, 2021