-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the brew crew with new sign in page
have issues on the version of the dependencies, settings.graddle, If you have this issues again, follow this link: firebase/flutterfire#3876
- Loading branch information
1 parent
0b0c71a
commit dd83e99
Showing
9 changed files
with
213 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:brew_crew/screens/authenticate/sign_in.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class Authenticate extends StatefulWidget { | ||
const Authenticate({Key key}) : super(key: key); | ||
|
||
@override | ||
_AuthenticateState createState() => _AuthenticateState(); | ||
} | ||
|
||
class _AuthenticateState extends State<Authenticate> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
child: SignIn(), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class SignIn extends StatefulWidget { | ||
const SignIn({Key key}) : super(key: key); | ||
|
||
@override | ||
_SignInState createState() => _SignInState(); | ||
} | ||
|
||
class _SignInState extends State<SignIn> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: Colors.brown[100], | ||
appBar: AppBar( | ||
backgroundColor: Colors.brown[400], | ||
elevation: 0.0, | ||
title: Text('Sign into Brew Crew'), | ||
), | ||
body: Container( | ||
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 50), | ||
child: ElevatedButton( | ||
child: Text('Sign in Anonymously'), | ||
onPressed: () async{ | ||
|
||
}, | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class Home extends StatelessWidget { | ||
const Home({Key key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
child: Text('home'), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:brew_crew/screens/authenticate/authenticate.dart'; | ||
import 'package:brew_crew/screens/home/home.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
|
||
class Wrapper extends StatelessWidget { | ||
const Wrapper({Key key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
|
||
// return Home or Authenticate depending on the user logged in or not | ||
return Authenticate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
|
||
class AuthService{ | ||
|
||
final FirebaseAuth _auth = FirebaseAuth.instance; | ||
|
||
// sign in anon | ||
Future signInAnon() async{ | ||
try{ | ||
AuthResult result = await _auth.signInAnonymously(); | ||
FirebaseUser user = result.user; | ||
return user; | ||
} catch(e){ | ||
print(e.toString()); | ||
return null; | ||
} | ||
} | ||
|
||
// sign in with email | ||
|
||
// register in with email | ||
|
||
|
||
// sign out | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters