SHARE
TWEET

Untitled

wildanfuady Nov 14th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Future<bool> getLoginStatus() async{
  2.     final prefs = await SharedPreferences.getInstance();
  3.     bool loginStatus = prefs.getBool('login') ?? false;
  4.     print('login status $loginStatus');
  5.     return loginStatus;
  6.   }
  7.  
  8.   @override
  9.   Widget build(BuildContext context) {
  10.     return FutureBuilder<bool>(
  11.         future: getLoginStatus(),
  12.         builder: (context, snapshot) {
  13.           return (snapshot.data) ?
  14.           // jika sudah login tampilkan list siswa
  15.           new ListSiswa() :
  16.           // jika belum login tampilkan form login
  17.           loginForm();
  18.         },
  19.       );
  20.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top