Profile View
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:le_kiosque_by_gcs/services/auth/auth.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/view/auth.dart';
|
||||
import 'package:le_kiosque_by_gcs/ui/view/main.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LandingPageView extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
final auth = Provider.of<Auth>(context, listen: false);
|
||||
return StreamBuilder<User>(
|
||||
stream: auth.authStateChanges(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.active) {
|
||||
if (snapshot.data == null) {
|
||||
return AuthView();
|
||||
} else {
|
||||
return MainView();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user