Skip to content
pubscout

flutter_ntp

0.1.0, released 6 months ago by an unverified publisher

A small, fast NTP client for Flutter and Dart with built-in offset caching.

$ flutter pub add flutter_ntp
Source repository

What it does

Fetches accurate time from Network Time Protocol (NTP) servers using pure Dart. It caches the offset between the device and the server so subsequent time lookups are instant.

AI-written summary of version 0.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need accurate, synchronized time independent of the device's local clock.
  • Your app requires offline fallback support while attempting to sync with an NTP server.

Skip it when

  • You are targeting Flutter Web (UDP is not supported on the web platform).

Strengths

  • Pure Dart with no platform channels required.
  • Built-in caching for instant subsequent time reads.
  • Includes 40+ public NTP servers by default.

Weaknesses

  • Does not support Flutter Web due to lack of UDP support.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
await FlutterNTP.sync();
final accurateNow = FlutterNTP.nowSync();
print('NTP time : $accurateNow');

Alternatives

Packages that do the same job and could replace flutter_ntp.

  • ntp_dart

    Cross-platform NTP and SNTP time synchronization client for Dart and Flutter.

  • ntp

    Fetch accurate current time from an NTP server as a DateTime object.