mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 10:58:47 -04:00
authpage fixes
This commit is contained in:
@@ -5,7 +5,6 @@ if (localPropertiesFile.exists()) {
|
||||
localProperties.load(reader)
|
||||
}
|
||||
}
|
||||
|
||||
def flutterRoot = localProperties.getProperty('flutter.sdk')
|
||||
if (flutterRoot == null) {
|
||||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
|
||||
@@ -50,7 +49,7 @@ android {
|
||||
applicationId "com.example.ruswipeshare"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
minSdkVersion 19
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
|
@@ -0,0 +1,25 @@
|
||||
// Generated file.
|
||||
//
|
||||
// If you wish to remove Flutter's multidex support, delete this entire file.
|
||||
//
|
||||
// Modifications to this file should be done in a copy under a different name
|
||||
// as this file may be regenerated.
|
||||
|
||||
package io.flutter.app;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
/**
|
||||
* Extension of {@link android.app.Application}, adding multidex support.
|
||||
*/
|
||||
public class FlutterMultiDexApplication extends Application {
|
||||
@Override
|
||||
@CallSuper
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(this);
|
||||
}
|
||||
}
|
BIN
assets/ruexpress.png
Normal file
BIN
assets/ruexpress.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
@@ -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());
|
||||
}
|
||||
|
||||
|
@@ -66,6 +66,7 @@ flutter:
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
assets:
|
||||
- .env
|
||||
- assets/ruexpress.png
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/assets-and-images/#resolution-aware
|
||||
|
Reference in New Issue
Block a user