From 0f2f189f4f4e1a510fc2005f3390edd8bf7015c3 Mon Sep 17 00:00:00 2001 From: Moe Date: Thu, 12 May 2022 22:10:16 +0700 Subject: [PATCH] Fix sessions auth --- lib/screens/sessions.dart | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/screens/sessions.dart b/lib/screens/sessions.dart index 984ad5e..8eaaae6 100644 --- a/lib/screens/sessions.dart +++ b/lib/screens/sessions.dart @@ -12,15 +12,10 @@ class Sessions extends StatefulWidget { } class _SessionsState extends State { - var session = ''; - - @override - void initState() { - super.initState(); - - getSession().then((session) async { - session = session; - }); + Future loadSessions() async { + var session = await getSession(); + var data = await getSessions(session); + return data; } @override @@ -33,7 +28,7 @@ class _SessionsState extends State { backgroundColor: const Color(0xff212226), ), body: FutureBuilder( - future: getSessions(session), + future: loadSessions(), builder: (context, snapshot) { if (snapshot.hasData) { var listSessions = snapshot.data;