Skip to content
pubscout

flutter_time_guard

1.3.2, released 7 weeks ago by m-yahia2011.space

Detects and validates device clock changes using NTP

$ flutter pub add flutter_time_guard
Source repository

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.

Works with

Packages commonly used together with flutter_time_guard: ones it builds on, ones built on it, and its own family.