flutter_time_guard
1.3.2, released 7 weeks ago by m-yahia2011.space
Detects and validates device clock changes using NTP
What it does
FlutterTimeGuard monitors manual date/time/timezone changes and compares the device clock against trusted NTP servers. It caches the last valid timestamp for offline use and triggers callbacks when tampering is detected.
AI-written summary of version 1.3.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- Enforcing trial or subscription periods
- Protecting OTPs, signed tokens or time‑limited credentials
- Ensuring compliance in attendance or workforce apps
Skip it when
- Apps that do not rely on accurate device time
- Environments where NTP access is blocked or unreliable
Strengths
- Real‑time change detection
- Configurable NTP tolerance
- Offline cache with monotonic clock
- Cross‑platform (Android & iOS)
Weaknesses
- Depends on NTP availability
- No support for web or desktop
- Requires native plugin setup
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add dependency via pub add, optional verbose logging, no extra permissions needed
import 'package:flutter_time_guard/flutter_time_guard.dart';
final isValid = await FlutterTimeGuard.isDateTimeValid(toleranceInSeconds: 86400);Alternatives
Packages that do the same job and could replace flutter_time_guard.
- flutter_timezone
A flutter plugin for getting the local timezone of the device.
88Compare - time_change_detector
Detects device time, date, and timezone changes on Android and iOS.
37Compare - timezone
Time zone databases and time zone aware DateTime class in Dart.
94Compare - mobile_device_identifier
Provides a persistent unique device identifier for Android and iOS.
74Compare
Works with
Packages commonly used together with flutter_time_guard: ones it builds on, ones built on it, and its own family.
- plugin_platform_interfaceflutter_time_guard depends on itReusable base class for platform interfaces of Flutter federated plugins.
- flutter_secure_storageflutter_time_guard depends on itSecure key-value storage using platform-specific secure mechanisms
- ntpflutter_time_guard depends on itFetch accurate current time from an NTP server as a DateTime object.