Skip to content
This repository was archived by the owner on Nov 11, 2023. It is now read-only.

fix(update): google working again #38

Open
wants to merge 1 commit into
base: master
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
28 changes: 28 additions & 0 deletions example/android/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android_</name>
<comment>Project android_ created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1632906553098</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
13 changes: 13 additions & 0 deletions example/android/.settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=C\:/Program Files/Java/jdk-16.0.2
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
28 changes: 28 additions & 0 deletions example/android/app/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1636369572190</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connection.project.dir=..
eclipse.preferences.version=1
7 changes: 4 additions & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def localProperties = new Properties()
/* def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
Expand All @@ -8,7 +8,7 @@ if (localPropertiesFile.exists()) {

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.")
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand Down Expand Up @@ -40,7 +40,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.boilerplate"
minSdkVersion 16
minSdkVersion 23
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand All @@ -65,3 +65,4 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compile 'com.android.support:multidex:1.0.1'
}
*/
4 changes: 2 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
<!-- <meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
/> -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
6 changes: 4 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.5.31'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'


}
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-rc-1-all.zip
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _MyHomePageState extends State<MyHomePage> {
class HomeScreen extends StatelessWidget {
HomeScreen({this.user});

final FirebaseUser user;
final User user;

void _logout() {
signOutProviders();
Expand Down Expand Up @@ -162,7 +162,7 @@ class HomeScreen extends StatelessWidget {
new SizedBox(
height: 32.0,
),
new RaisedButton(
new ElevatedButton(
child: new Text("DECONNEXION"), onPressed: _logout)
],
)));
Expand Down
100 changes: 51 additions & 49 deletions lib/email_view.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';

Expand All @@ -7,9 +9,9 @@ import 'sign_up_view.dart';
import 'utils.dart';

class EmailView extends StatefulWidget {
final bool passwordCheck;
final bool? passwordCheck;

EmailView(this.passwordCheck, {Key key}) : super(key: key);
EmailView(this.passwordCheck, {Key? key}) : super(key: key);

@override
_EmailViewState createState() => new _EmailViewState();
Expand All @@ -21,7 +23,7 @@ class _EmailViewState extends State<EmailView> {
@override
Widget build(BuildContext context) => new Scaffold(
appBar: new AppBar(
title: new Text(FFULocalizations.of(context).welcome),
title: new Text(FFULocalizations.of(context).welcome!),
elevation: 4.0,
),
body: new Builder(
Expand Down Expand Up @@ -49,11 +51,11 @@ class _EmailViewState extends State<EmailView> {
alignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new FlatButton(
new ElevatedButton(
onPressed: () => _connexion(context),
child: new Row(
children: <Widget>[
new Text(FFULocalizations.of(context).nextButtonLabel),
new Text(FFULocalizations.of(context).nextButtonLabel!),
],
)),
],
Expand All @@ -69,23 +71,23 @@ class _EmailViewState extends State<EmailView> {
try {
final FirebaseAuth auth = FirebaseAuth.instance;
List<String> providers =
await auth.fetchSignInMethodsForEmail( _controllerEmail.text);
await auth.fetchSignInMethodsForEmail(_controllerEmail.text);
print(providers);

if (providers == null || providers.isEmpty) {
bool connected = await Navigator.of(context)
bool connected = await (Navigator.of(context)
.push(new MaterialPageRoute<bool>(builder: (BuildContext context) {
return new SignUpView(_controllerEmail.text, widget.passwordCheck);
}));
})) as FutureOr<bool>);

if (connected) {
Navigator.pop(context);
}
} else if (providers.contains('password')) {
bool connected = await Navigator.of(context)
bool connected = await (Navigator.of(context)
.push(new MaterialPageRoute<bool>(builder: (BuildContext context) {
return new PasswordView(_controllerEmail.text);
}));
})) as FutureOr<bool>);

if (connected) {
Navigator.pop(context);
Expand All @@ -108,55 +110,55 @@ class _EmailViewState extends State<EmailView> {
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) => new AlertDialog(
content: new SingleChildScrollView(
child: new ListBody(
content: new SingleChildScrollView(
child: new ListBody(
children: <Widget>[
new Text(FFULocalizations.of(context)
.allReadyEmailMessage(email, providerName)!),
new SizedBox(
height: 16.0,
),
new Column(
children: providers.map((String p) {
return new ElevatedButton(
child: new Row(
children: <Widget>[
new Text(_providerStringToButton(p)!),
],
),
onPressed: () {
Navigator.of(context).pop(p);
},
);
}).toList(),
)
],
)),
actions: <Widget>[
new TextButton(
child: new Row(
children: <Widget>[
new Text(FFULocalizations.of(context)
.allReadyEmailMessage(email, providerName)),
new SizedBox(
height: 16.0,
),
new Column(
children: providers.map((String p) {
return new RaisedButton(
child: new Row(
children: <Widget>[
new Text(_providerStringToButton(p)),
],
),
onPressed: () {
Navigator.of(context).pop(p);
},
);
}).toList(),
)
new Text(FFULocalizations.of(context).cancelButtonLabel!),
],
)),
actions: <Widget>[
new FlatButton(
child: new Row(
children: <Widget>[
new Text(FFULocalizations.of(context).cancelButtonLabel),
],
),
onPressed: () {
Navigator.of(context).pop('');
},
),
],
),
onPressed: () {
Navigator.of(context).pop('');
},
),
],
),
);
}

String _providersToString(List<String> providers) {
return providers.map((String provider) {
ProvidersTypes type = stringToProvidersType(provider);
return providersDefinitions(context)[type]?.name;
ProvidersTypes? type = stringToProvidersType(provider);
return providersDefinitions(context)[type!]?.name;
}).join(", ");
}

String _providerStringToButton(String provider) {
ProvidersTypes type = stringToProvidersType(provider);
return providersDefinitions(context)[type]?.label;
String? _providerStringToButton(String provider) {
ProvidersTypes? type = stringToProvidersType(provider);
return providersDefinitions(context)[type!]?.label;
}
}
32 changes: 16 additions & 16 deletions lib/flutter_firebase_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'utils.dart';

class SignInScreen extends StatefulWidget {
SignInScreen(
{Key key,
{Key? key,
this.title,
this.header,
this.footer,
Expand All @@ -18,25 +18,25 @@ class SignInScreen extends StatefulWidget {
this.twitterConsumerKey,
this.twitterConsumerSecret,
this.appleSignInAvailable,
@required this.showBar,
@required this.avoidBottomInset,
@required this.bottomPadding,
@required this.horizontalPadding})
required this.showBar,
required this.avoidBottomInset,
required this.bottomPadding,
required this.horizontalPadding})
: super(key: key);

final String title;
final Widget header;
final Widget footer;
final List<ProvidersTypes> providers;
final String? title;
final Widget? header;
final Widget? footer;
final List<ProvidersTypes>? providers;
final Color color;
final bool signUpPasswordCheck;
final String twitterConsumerKey;
final String twitterConsumerSecret;
final bool? signUpPasswordCheck;
final String? twitterConsumerKey;
final String? twitterConsumerSecret;
final bool showBar;
final bool avoidBottomInset;
final double horizontalPadding;
final double bottomPadding;
final bool appleSignInAvailable;
final bool? appleSignInAvailable;

@override
_SignInScreenState createState() => new _SignInScreenState();
Expand All @@ -55,7 +55,7 @@ class _SignInScreenState extends State<SignInScreen> {
Widget build(BuildContext context) => new Scaffold(
appBar: widget.showBar
? new AppBar(
title: new Text(widget.title),
title: new Text(widget.title!),
elevation: 4.0,
)
: null,
Expand All @@ -75,8 +75,8 @@ class _SignInScreenState extends State<SignInScreen> {
child: LoginView(
providers: _providers,
passwordCheck: _passwordCheck,
twitterConsumerKey: widget.twitterConsumerKey,
twitterConsumerSecret: widget.twitterConsumerSecret,
/* twitterConsumerKey: widget.twitterConsumerKey,
twitterConsumerSecret: widget.twitterConsumerSecret, */
bottomPadding: widget.bottomPadding,
appleSignIn: widget.appleSignInAvailable)),
),
Expand Down
Loading