user_interaction_detector 0.0.8 copy "user_interaction_detector: ^0.0.8" to clipboard
user_interaction_detector: ^0.0.8 copied to clipboard

This package helps developers detect and monitor every gesture, tap or click made in the application even when it runs in the background

TODO: This package helps developers detect and monitor every gesture, tap or click made in the application even when it runs in the background

Features #

TODO: You can use this package to set a timer and run a function that logs the user out if they do not make any taps or interaction with the application in the required amount of time

Getting started #

TODO: List prerequisites and provide or point to information on how to start using the package. Runs on all Flutter sdk

Usage #

TODO:

Call the class SessionTimeout class in your main.dart. wrap your MaterialApp with the SessionTimeout package and pass the required paramenters.

 Widget build(BuildContext context) {
  return SessionInactivity(
    duration: Duration(minutes: 3),
    onSessionTimeout: () {
      loggedInStatus != SessionNotifier.notLoggedIn
          ? _timeoutFunction()
          : null;
    },
    child: MaterialApp(
      navigatorKey: _UserInactivity.navKey,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      debugShowCheckedModeBanner: false,
      home: const LoginScreen(),
    ),
  );
}


Additional information #

 _timeoutFunction() {
    Navigator.push(navKey.currentState!.context,
        MaterialPageRoute(builder: (context) => const LoginScreen()));
    customAlertWidget(
      navKey.currentState!.context,
      "Your session expired or timedout, please login to continue ",
    );
  }
16
likes
140
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

This package helps developers detect and monitor every gesture, tap or click made in the application even when it runs in the background

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on user_interaction_detector