session_screen_manager

Last updated:

0 purchases

session_screen_manager Image
session_screen_manager Images
Add to Cart

Description:

session screen manager

Session Manager #
The session_screen_manager package provides a set of widgets and functionalities designed to manage user sessions in a Flutter application. It includes a SessionActivityManager widget that handles user inactivity time and calls the corresponding callback functions when the user session expires or there is user activity.
Usage #
To use session_screen_manager, add the package as a dependency in your pubspec.yaml file:


dependencies:
session_screen_manager: ^1.0.1
copied to clipboard
In your Dart code, import the session_manager library:
import 'package:session_manager/session_manager.dart';
copied to clipboard
Then, wrap your root widget with the SessionActivityManager widget and specify the required parameters:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SessionActivityManager(
onSessionExpired: () {
// Handle session expiration
},
sessionTimeout: Duration(minutes: 5),
onSessionActivity: () {
// handle session activity
},

child: MaterialApp(
title: 'My App',
home: MyHomePage(),
),
);
}
}
copied to clipboard
In this example, SessionActivityManager wraps a MaterialApp widget as the child, and the onSessionExpired callback function is specified to handle the expiration of the user session.
Versioning
The current version of session_manager is ^0.0.5.
We use semantic versioning to manage package versions. In short, the version number is in the format of MAJOR. MINOR. PATCH, where:
MAJOR is incremented when there are breaking changes
MINOR is incremented when new features are added
PATCH is incremented when bugs are fixed or minor changes are made
For more information, please refer to the changelog for this package.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.