Auto Logout
A simple package that can automatically log users out after a certain period of inactivity or if the app is sent to the background for a certain amount of time.
Getting started
Add the package to your pubspec.yaml file:
dependencies:
auto_logout: ^0.0.1
Usage
AutoLogout(
onLogout: () {},
isLoggedIn: () async => true,
config: const LogoutConfig(
appBackgroundDelay: Duration(seconds: 2),
appInactivityDelay: Duration(seconds: 5),
),
child: YourRootWidget,
)
Example App
A comprehensive demo is available under example/.
Run the example:
cd example
flutter run