Set default portal port to 8081, fix Dart build issue in cart screen, and update setup documentation. Co-Authored-By: Oz <oz-agent@warp.dev>
31 lines
761 B
Dart
31 lines
761 B
Dart
import 'package:firebase_auth/firebase_auth.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../services/auth_service.dart';
|
|
import 'home_screen.dart';
|
|
import 'login_screen.dart';
|
|
|
|
class AuthGate extends StatelessWidget {
|
|
const AuthGate({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return StreamBuilder<User?>(
|
|
stream: AuthService.instance.authStateChanges(),
|
|
builder: (context, snapshot) {
|
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
|
return const Scaffold(
|
|
body: Center(child: CircularProgressIndicator()),
|
|
);
|
|
}
|
|
|
|
if (snapshot.hasData) {
|
|
return const HomeScreen();
|
|
}
|
|
|
|
return const LoginScreen();
|
|
},
|
|
);
|
|
}
|
|
}
|