Profile View

This commit is contained in:
2021-03-22 16:49:24 +02:00
parent 8f86ec409d
commit 1381647a3d
28 changed files with 645 additions and 154 deletions
+34
View File
@@ -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(),
),
);
}
}
);
}
}