Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alexander #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file should be version controlled and should not be manually edited.

version:
revision: "ef1af02aead6fe2414f3aafa5a61087b610e1332"
revision: "41456452f29d64e8deb623a3c927524bcf9f111b"
channel: "stable"

project_type: app
Expand All @@ -13,26 +13,26 @@ project_type: app
migration:
platforms:
- platform: root
create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
- platform: android
create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
- platform: ios
create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
- platform: linux
create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
- platform: macos
create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
- platform: web
create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
- platform: windows
create_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
base_revision: ef1af02aead6fe2414f3aafa5a61087b610e1332
create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b

# User provided section

Expand Down
77 changes: 31 additions & 46 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,67 +1,52 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:7.0.0'
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
allprojects {
repositories {
google()
mavenCentral()
}
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
namespace "com.example.acm_mobile"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
compileSdkVersion 33
buildToolsVersion "30.0.3"

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.acm_mobile"
// 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
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
minSdkVersion 16
targetSdkVersion 33
versionCode 1
versionName "1.0"
multiDexEnabled true
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

flutter {
source '../..'
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
}

dependencies {}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.example.acm_mobile_login_fork

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}
77 changes: 57 additions & 20 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,67 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

allprojects {
repositories {
google()
mavenCentral()
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
subprojects {
project.evaluationDependsOn(':app')

android {
namespace "com.example.acm_mobile"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.acm_mobile"
// 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
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
flutter {
source '../..'
}

dependencies {}
1 change: 1 addition & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extensions:
17 changes: 16 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import 'package:acm_mobile/firebase_options.dart';
import 'package:acm_mobile/pages/example.dart';
import 'package:acm_mobile/pages/home.dart';
import 'package:acm_mobile/pages/login.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_strategy/url_strategy.dart';



void main() async {
WidgetsFlutterBinding.ensureInitialized();
setPathUrlStrategy();
Expand All @@ -22,11 +25,23 @@ void main() async {
handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
return const ExamplePage();
});

Handler loginHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
return const LoginPage();
});
router.define("/", handler: homeHandler);
router.define("/example", handler: exampleHandler);
router.define("/login", handler: loginHandler);
<<<<<<< HEAD
router.notFoundHandler = homeHandler;
runApp(DevicePreview(
enabled: false,
builder: (context) => MyApp(),
),);
=======
// router.notFoundHandler = homeHandler;
runApp(const MyApp());
>>>>>>> parent of 0bd624e (Gradient Widget)
}
final router = FluroRouter();

Expand Down
85 changes: 85 additions & 0 deletions lib/pages/login.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
<<<<<<< HEAD
import 'package:acm_mobile/components/gradient.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';

class LoginPage extends StatefulWidget {
const LoginPage({Key? key}) : super(key: key);
=======
import 'package:flutter/widgets.dart';

class LoginPage extends StatefulWidget {
const LoginPage({super.key});
>>>>>>> parent of 0bd624e (Gradient Widget)

@override
State<LoginPage> createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
// Function to handle Google sign-in
Future<UserCredential> signInWithGoogle() async {
// Trigger the authentication flow
final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn();

// Obtain the auth details from the request
final GoogleSignInAuthentication? googleAuth = await googleUser?.authentication;

// Create a new credential
final credential = GoogleAuthProvider.credential(
accessToken: googleAuth?.accessToken,
idToken: googleAuth?.idToken,
);

// Once signed in, return the UserCredential
return await FirebaseAuth.instance.signInWithCredential(credential);
}

@override
Widget build(BuildContext context) {
return Scaffold(
<<<<<<< HEAD
appBar: AppBar(title: const Text("Login Page")),
body: GradientBackgroundWidget( // Assuming this is a correctly imported custom widget
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"Login Page",
style: TextStyle(fontSize: 24, color: Colors.white),
),
const SizedBox(height: 20), // Provides spacing between text and button
ElevatedButton(
onPressed: () async {
try {
await signInWithGoogle();
// Upon success, you can navigate or display success message
print('Successfully signed in with Google');
} catch (error) {
// Handle errors here
print('Error signing in with Google: $error');
}
},
child: const Text('Sign in with Google'),
style: ElevatedButton.styleFrom(
primary: Colors.white, // Button color
onPrimary: Colors.black, // Text color
),
),
],
),
),
=======
appBar: AppBar(
title: Text("Log in page")
>>>>>>> parent of 0bd624e (Gradient Widget)
),
body: Center(
child: Text("Log in page!")
)
);
}
}
1 change: 1 addition & 0 deletions linux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flutter/ephemeral
Loading