flutter_session_jwt
1.2.0, released 3 months ago by an unverified publisher
Store and decode JWT tokens securely on device with helper methods for expiration and refresh flows.
What it does
It stores JWT and refresh tokens using secure storage, decodes their payloads, and provides helper methods to check expiration dates, token age, and token validity without manual base64 parsing.
AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to store and manage authentication JWTs and refresh tokens securely
- You need a quick way to check if a token is expired or extract its payload and expiration date
Skip it when
- You require complex cross-platform state management solutions beyond authentication sessions
Strengths
- Simplifies JWT payload decoding and expiration checking
- Built-in support for access and refresh token pairs
- Allows inspecting tokens directly without touching secure storage
Weaknesses
- Relies on device secure storage which can occasionally require platform-specific configuration
- Does not handle full OAuth or credential exchange flows on its own
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Requires adding the package dependency to pubspec.yaml and ensuring standard platform secure storage dependencies are configured.
import 'package:flutter_session_jwt/flutter_session_jwt.dart';
// Save a token after login
await FlutterSessionJwt.saveToken(token);
// Retrieve payload
var payload = await FlutterSessionJwt.getPayload();
// Check if expired
bool expired = await FlutterSessionJwt.isTokenExpired();Alternatives
Packages that do the same job and could replace flutter_session_jwt.
- hive_local_storage
A wrapper around hive_ce for easy local data storage and encryption.
70Compare - flutter_storage_info
Flutter plugin to retrieve internal and external storage usage on Android devices.
45Compare - api_cache_manager
Stores REST API responses in SQLite for offline access
45Compare - get_secure_storage
Encrypted synchronous key‑value storage for Flutter apps.
44Compare
Works with
Packages commonly used together with flutter_session_jwt: ones it builds on, ones built on it, and its own family.