ntp_dart
1.5.2, released 2 weeks ago by vdes.it
Cross-platform NTP and SNTP time synchronization client for Dart and Flutter.
What it does
Synchronizes true UTC and local time via UDP and Web HTTP with microsecond precision, offset caching, and system clock tamper detection. It handles cross-platform discrepancies and unstable networks to deliver reliable, tamper-proof time.
AI-written summary of version 1.5.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need accurate time that cannot be spoofed by users changing their device clock.
- Your Flutter app targets Web/WASM as well as mobile and desktop platforms.
- You need live accurate time streams or anti-tamper detection for financial, auction, or gaming apps.
Skip it when
- Standard device DateTime.now() is completely sufficient for your app's requirements.
- Your app has strictly zero network connectivity and never connects to the internet.
Strengths
- Cross-platform support including Web/WASM without intl dependency conflicts.
- Includes built-in offset caching, multi-server failover, and multi-sample RTT filtering.
- Provides reactive clock streams and system clock tamper detection.
Weaknesses
- Requires an active internet connection or a previously cached offset for initial accuracy.
- Depends on external NTP servers or custom time API endpoints being reachable.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
final DateTime now = await NtpClient().now();Alternatives
Packages that do the same job and could replace ntp_dart.
- timezone
Time zone databases and time zone aware DateTime class in Dart.
94Compare - webcrypto
Cross-platform implementation of Web Cryptography APIs for Dart.
89Compare - flutter_ntp
A small, fast NTP client for Flutter and Dart with built-in offset caching.
52Compare - flutter_time_guard
Detects and validates device clock changes using NTP
65Compare