mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
authpage fixes
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterfire_ui/auth.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'home.dart';
|
||||
|
||||
class AuthGate extends StatelessWidget {
|
||||
@@ -9,33 +8,23 @@ class AuthGate extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String webId = dotenv.env['GOOGLEWEBSDK']!;
|
||||
AssetImage ruExpressAsset = const AssetImage('assets/ruexpress.png');
|
||||
Image image = Image(image: ruExpressAsset, width: 400, height: 400);
|
||||
return StreamBuilder<User?>(
|
||||
stream: FirebaseAuth.instance.authStateChanges(),
|
||||
builder: (context, snapshot) {
|
||||
if (!snapshot.hasData) {
|
||||
return SignInScreen(
|
||||
providerConfigs: [
|
||||
const EmailProviderConfiguration(),
|
||||
providerConfigs: const [
|
||||
GoogleProviderConfiguration(
|
||||
clientId: webId,
|
||||
clientId: "291581242565-mjeocm5vqg9pntpnv5uk4o4mfoa0k5e6.apps.googleusercontent.com",
|
||||
)
|
||||
],
|
||||
headerBuilder: (context, constraints, shrinkOffset) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Image.asset('flutterfire_300x.png'),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
subtitleBuilder: (context, action) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: action == AuthAction.signIn
|
||||
? const Text('Welcome to FlutterFire, please sign in!')
|
||||
: const Text('Welcome to Flutterfire, please sign up!'),
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 8.0),
|
||||
child: Text('Welcome to RUSwipeShare, please sign in with your RUID Gmail account!')
|
||||
);
|
||||
},
|
||||
footerBuilder: (context, action) {
|
||||
@@ -47,15 +36,6 @@ class AuthGate extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
sideBuilder: (context, shrinkOffset) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Image.asset('flutterfire_300x.png'),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,16 +1,15 @@
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:ruswipeshare/home.dart';
|
||||
|
||||
import 'firebase_options.dart';
|
||||
import 'authGate.dart';
|
||||
|
||||
Future main() async {
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
options: DefaultFirebaseOptions.android,
|
||||
);
|
||||
await dotenv.load(fileName: ".env");
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user