镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

About

Allows manipulation of SessionStorage on Web platform while using an in-memory map for other platforms.

Resources

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

session_storage

Pub

Getting Started

This is a very simple abstraction over a Map to allow usage of SessionStorage on any platform, but specifically intended to interact with window.sessionStorage on web without breaking other platforms.

Programmatically

Install the library using your preferred method.

flutter pub add session_storage

Then use the library, the SessionStorage class only exposes a single constructor, and it always shares the same static instance.

import 'package:session_storage/session_storage.dart';

final session = SessionStorage();

// Use it like you would any other Map.
session['language'] = 'english';

// Sessions are shared, so by calling the constructor again
// you will still have any value you previously set.
final newSession = SessionStorage();

newSession['language'] == 'english' // true

About

Allows manipulation of SessionStorage on Web platform while using an in-memory map for other platforms.

Resources

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages