Atualização geral de optimazação e desing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
|
||||
import 'main.dart' show supabase;
|
||||
import 'home_screen.dart';
|
||||
import 'logged_home.dart';
|
||||
|
||||
@@ -14,10 +15,11 @@ class AuthGate extends StatelessWidget {
|
||||
return ValueListenableBuilder<bool>(
|
||||
valueListenable: forceHomeScreen,
|
||||
builder: (context, forcedHome, _) {
|
||||
return StreamBuilder<User?>(
|
||||
stream: FirebaseAuth.instance.authStateChanges(),
|
||||
return StreamBuilder<AuthState>(
|
||||
stream: supabase.auth.onAuthStateChange,
|
||||
initialData: AuthState(AuthChangeEvent.initialSession, supabase.auth.currentSession),
|
||||
builder: (context, snapshot) {
|
||||
final user = snapshot.data;
|
||||
final user = snapshot.data?.session?.user;
|
||||
|
||||
final Widget child;
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
|
||||
Reference in New Issue
Block a user