session_storage 0.0.1 copy "session_storage: ^0.0.1" to clipboard
session_storage: ^0.0.1 copied to clipboard

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:session_storage/session_storage.dart';

void main() {
  SessionStorage()..addAll({'language': 'english', 'name': 'Session Man'});
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    final session = SessionStorage();

    return Column(
      children: [
        Text('User: ${session['name']}'),
        Text('Language: ${session['language']}'),
      ],
    );
  }
}
7
likes
160
points
4.32k
downloads

Publisher

verified publisherjcquintas.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on session_storage