adding packages
@@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
@@ -0,0 +1,21 @@
|
||||
# See https://www.dartlang.org/guides/libraries/private-files
|
||||
|
||||
# Files and directories created by pub
|
||||
.dart_tool/
|
||||
.packages
|
||||
build/
|
||||
# If you're building an application, you may want to check-in your pubspec.lock
|
||||
pubspec.lock
|
||||
|
||||
# Directory created by dartdoc
|
||||
# If you don't generate documentation locally you can remove this line.
|
||||
doc/api/
|
||||
|
||||
# Avoid committing generated Javascript files:
|
||||
*.dart.js
|
||||
*.info.json # Produced by the --dump-info flag.
|
||||
*.js # When generated by dart2js. Don't specify *.js if your
|
||||
# project includes source files written in JavaScript.
|
||||
*.js_
|
||||
*.js.deps
|
||||
*.js.map
|
||||
@@ -0,0 +1,10 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: 72cacb40401c96dad9905cf2b180893ddfd0105d
|
||||
channel: master
|
||||
|
||||
project_type: plugin
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Flutter",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"program": "example/lib/main.dart"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
# 1.2.0
|
||||
|
||||
* Plugin is now deprecated
|
||||
|
||||
## 1.1.0
|
||||
|
||||
* Updating to Bloc 2.0.0
|
||||
|
||||
## 1.0.6
|
||||
|
||||
* Fixing Google Login (Mobile, Web)
|
||||
|
||||
## 1.0.3
|
||||
|
||||
* Updating to `bloc 1.0.0`
|
||||
* Fixing Google Login (Mobile, Web)
|
||||
* Try login after failed create account or user is null
|
||||
|
||||
## 1.0.1
|
||||
|
||||
* Support for Login with Access Token
|
||||
* Support for Google Sign In for Mobile and Web
|
||||
|
||||
## 1.0.0
|
||||
|
||||
* Adding Support for Desktop
|
||||
* Updated Example for Desktop
|
||||
* Adding App Config Requirement
|
||||
* Fixing Bugs with `io` auth
|
||||
|
||||
## 0.0.2
|
||||
|
||||
* Add Sign In As Guest
|
||||
|
||||
## 0.0.1
|
||||
|
||||
* TODO: Describe initial release.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Rody Davis
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,116 @@
|
||||
[](https://www.buymeacoffee.com/rodydavis)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WSH3GVC49GNNJ)
|
||||
|
||||
# fb_auth
|
||||
|
||||
A Shared Firebase Auth Plugin for Mobile, Web and Desktop. Included AuthBloc for minimal setup! Single dynamic import and compile time ready for ios, android, macos, windows, linux and web.
|
||||
|
||||
This package is now deprecated and was originally created to add firebase on the desktop and web. You can now use the [FlutterFire](https://github.com/FirebaseExtended/flutterfire) packages to do anything this plugin could.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Setup your Bloc
|
||||
|
||||
```dart
|
||||
final _auth = AuthBloc();
|
||||
```
|
||||
|
||||
Follow Installation Instructions for Web: https://pub.dev/packages/firebase
|
||||
|
||||
Update `/web/index.html` in the body tag.
|
||||
|
||||
```html
|
||||
<!-- The core Firebase JS SDK is always required and must be listed first -->
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-app.js"></script>
|
||||
|
||||
<!-- TODO: Add SDKs for Firebase products that you want to use
|
||||
https://firebase.google.com/docs/web/setup#config-web-app -->
|
||||
<script src="https://www.gstatic.com/firebasejs//6.3.3/firebase-auth.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-firestore.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-storage.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-functions.js"></script>
|
||||
|
||||
<script>
|
||||
// Your web app's Firebase configuration
|
||||
var firebaseConfig = {
|
||||
apiKey: "API_KEY",
|
||||
authDomain: "AUTH_DOMAIN",
|
||||
databaseURL: "DATABASE_URL",
|
||||
projectId: "PROJECT_ID",
|
||||
storageBucket: "STORAGE_BUCKET",
|
||||
messagingSenderId: "MESSAGING_SENDER_ID",
|
||||
appId: "APP_ID"
|
||||
};
|
||||
// Initialize Firebase
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
</script>
|
||||
```
|
||||
|
||||
Follow Installation Instructions for Mobile: https://pub.dev/packages/firebase_auth
|
||||
|
||||
- Update `ios/Runner` and add the `GoogleService-Info.plist` downloaded from firebase
|
||||
|
||||
- Update `android/app` and add the `google-services.json` downloaded from firebase
|
||||
- Update `android/build.gradle` and update the classpath:
|
||||
|
||||
```gradle
|
||||
classpath 'com.google.gms:google-services:4.2.0'
|
||||
```
|
||||
|
||||
## Actions
|
||||
|
||||
- Check Current User
|
||||
|
||||
```dart
|
||||
_auth.dispatch(CheckUser());
|
||||
```
|
||||
|
||||
- Listen for Auth Changes
|
||||
|
||||
```dart
|
||||
_userChanged = _fbAuth.onAuthChanged().listen((user) {
|
||||
_auth.dispatch(UpdateUser(user));
|
||||
});
|
||||
```
|
||||
|
||||
- Logout
|
||||
|
||||
```dart
|
||||
_auth.dispatch(LogoutEvent(_user));
|
||||
```
|
||||
|
||||
- Login
|
||||
|
||||
```dart
|
||||
_auth.dispatch(LoginEvent(_email, _password));
|
||||
```
|
||||
|
||||
- Guest
|
||||
|
||||
```dart
|
||||
_auth.dispatch(LoginGuest());
|
||||
```
|
||||
|
||||
- Create Account
|
||||
|
||||
```dart
|
||||
_auth.dispatch(CreateAccount(_email, _password, displayName: _name));
|
||||
```
|
||||
|
||||
- Edit Info
|
||||
|
||||
```dart
|
||||
_auth.dispatch(EditInfo(displayName: _name));
|
||||
```
|
||||
|
||||
- Forgot Password
|
||||
|
||||
```dart
|
||||
_auth.dispatch(ForgotPassword(_email));
|
||||
```
|
||||
|
||||
- Send Email Verification
|
||||
|
||||
```dart
|
||||
_auth.dispatch(SendEmailVerification());
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"firebase_auth","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.14.0+9/","dependencies":["firebase_core"]},{"name":"firebase_core","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.2+2/","dependencies":[]},{"name":"path_provider","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.28/","dependencies":[]}],"android":[{"name":"firebase_auth","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.14.0+9/","dependencies":["firebase_core"]},{"name":"firebase_core","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.2+2/","dependencies":[]},{"name":"path_provider","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.28/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/usr/local/Caskroom/flutter/1.2.1/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.5/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"firebase_auth","dependencies":["firebase_core"]},{"name":"firebase_core","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-09-27 10:53:45.188402","version":"2.5.1"}
|
||||
@@ -0,0 +1,76 @@
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
#.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
**/doc/api/
|
||||
.dart_tool/
|
||||
.flutter-plugins
|
||||
.packages
|
||||
.pub-cache/
|
||||
.pub/
|
||||
/build/
|
||||
|
||||
# Android related
|
||||
**/android/**/gradle-wrapper.jar
|
||||
**/android/.gradle
|
||||
**/android/captures/
|
||||
**/android/gradlew
|
||||
**/android/gradlew.bat
|
||||
**/android/local.properties
|
||||
**/android/**/GeneratedPluginRegistrant.java
|
||||
|
||||
# iOS/XCode related
|
||||
**/ios/**/*.mode1v3
|
||||
**/ios/**/*.mode2v3
|
||||
**/ios/**/*.moved-aside
|
||||
**/ios/**/*.pbxuser
|
||||
**/ios/**/*.perspectivev3
|
||||
**/ios/**/*sync/
|
||||
**/ios/**/.sconsign.dblite
|
||||
**/ios/**/.tags*
|
||||
**/ios/**/.vagrant/
|
||||
**/ios/**/DerivedData/
|
||||
**/ios/**/Icon?
|
||||
**/ios/**/Pods/
|
||||
**/ios/**/.symlinks/
|
||||
**/ios/**/profile
|
||||
**/ios/**/xcuserdata
|
||||
**/ios/.generated/
|
||||
**/ios/Flutter/App.framework
|
||||
**/ios/Flutter/Flutter.framework
|
||||
**/ios/Flutter/Generated.xcconfig
|
||||
**/ios/Flutter/app.flx
|
||||
**/ios/Flutter/app.zip
|
||||
**/ios/Flutter/flutter_assets/
|
||||
**/ios/Flutter/flutter_export_environment.sh
|
||||
**/ios/ServiceDefinitions.json
|
||||
**/ios/Runner/GeneratedPluginRegistrant.*
|
||||
|
||||
# Web related
|
||||
lib/generated_plugin_registrant.dart
|
||||
|
||||
# Exceptions to above rules.
|
||||
!**/ios/**/default.mode1v3
|
||||
!**/ios/**/default.mode2v3
|
||||
!**/ios/**/default.pbxuser
|
||||
!**/ios/**/default.perspectivev3
|
||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
||||
@@ -0,0 +1,10 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: 72cacb40401c96dad9905cf2b180893ddfd0105d
|
||||
channel: master
|
||||
|
||||
project_type: app
|
||||
@@ -0,0 +1,191 @@
|
||||
# fb_auth_example
|
||||
|
||||
```dart
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fb_auth/fb_auth.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
void main() => runApp(MyApp());
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
StreamSubscription<AuthUser> _userChanged;
|
||||
final _auth = AuthBloc(
|
||||
saveUser: _saveUser,
|
||||
deleteUser: _deleteUser,
|
||||
);
|
||||
|
||||
static _deleteUser() async {}
|
||||
static _saveUser(user) async {}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_auth.dispatch(CheckUser());
|
||||
final _fbAuth = FBAuth();
|
||||
_userChanged = _fbAuth.onAuthChanged().listen((user) {
|
||||
_auth.dispatch(UpdateUser(user));
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_auth.dispose();
|
||||
_userChanged.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<AuthBloc>(builder: (_) => _auth),
|
||||
],
|
||||
child: MaterialApp(
|
||||
home: AuthCheck(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AuthCheck extends StatelessWidget {
|
||||
const AuthCheck({
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AuthBloc, AuthState>(
|
||||
builder: (context, state) {
|
||||
if (state is LoggedInState) {
|
||||
return HomeScreen();
|
||||
}
|
||||
return LoginScreen();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
@override
|
||||
_LoginScreenState createState() => _LoginScreenState();
|
||||
}
|
||||
|
||||
class _LoginScreenState extends State<LoginScreen> {
|
||||
String _email, _password, _name;
|
||||
bool _createAccount = true;
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _auth = BlocProvider.of<AuthBloc>(context);
|
||||
return BlocBuilder<AuthBloc, AuthState>(
|
||||
builder: (context, state) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Login to Firebase'),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Visibility(
|
||||
visible: _createAccount,
|
||||
child: ListTile(
|
||||
title: TextFormField(
|
||||
decoration: InputDecoration(labelText: 'Display Name'),
|
||||
onSaved: (val) => _name = val,
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: TextFormField(
|
||||
decoration: InputDecoration(labelText: 'Email'),
|
||||
validator: (val) => val.isEmpty ? 'Email Required' : null,
|
||||
onSaved: (val) => _email = val,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: TextFormField(
|
||||
decoration: InputDecoration(labelText: 'Password'),
|
||||
validator: (val) =>
|
||||
val.isEmpty ? 'Password Required' : null,
|
||||
onSaved: (val) => _password = val,
|
||||
),
|
||||
),
|
||||
if (_createAccount) ...[
|
||||
ListTile(
|
||||
title: RaisedButton(
|
||||
child: Text('Sign Up'),
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
_formKey.currentState.save();
|
||||
_auth.dispatch(CreateAccount(_email, _password,
|
||||
displayName: _name));
|
||||
}
|
||||
},
|
||||
)),
|
||||
] else ...[
|
||||
ListTile(
|
||||
title: RaisedButton(
|
||||
child: Text('Login'),
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
_formKey.currentState.save();
|
||||
_auth.dispatch(LoginEvent(_email, _password));
|
||||
}
|
||||
},
|
||||
)),
|
||||
],
|
||||
ListTile(
|
||||
title: FlatButton(
|
||||
child: Text(_createAccount
|
||||
? 'Already have an account?'
|
||||
: 'Create a new account?'),
|
||||
onPressed: () {
|
||||
if (mounted)
|
||||
setState(() {
|
||||
_createAccount = !_createAccount;
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (state is AuthLoadingState) ...[CircularProgressIndicator()],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _user = AuthBloc.currentUser(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Welcome ${_user?.displayName ?? 'Guest'}'),
|
||||
),
|
||||
body: Center(
|
||||
child: RaisedButton(
|
||||
child: Text('Logout'),
|
||||
onPressed: () {
|
||||
BlocProvider.of<AuthBloc>(context).dispatch(LogoutEvent(_user));
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
@@ -0,0 +1,70 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||
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.")
|
||||
}
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
|
||||
sourceSets {
|
||||
main.java.srcDirs += 'src/main/kotlin'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.example.fb_auth_example"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
implementation 'com.google.firebase:firebase-core:16.0.9'
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.fb_auth_example">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,33 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.fb_auth_example">
|
||||
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<application
|
||||
android:name="io.flutter.app.FlutterApplication"
|
||||
android:label="fb_auth_example"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/LaunchTheme"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||
android:hardwareAccelerated="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<!-- This keeps the window background of the activity showing
|
||||
until Flutter renders its first frame. It can be removed if
|
||||
there is no splash screen (such as the default splash screen
|
||||
defined in @style/LaunchTheme). -->
|
||||
<meta-data
|
||||
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
|
||||
android:value="true" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.example.fb_auth_example
|
||||
|
||||
import android.os.Bundle
|
||||
|
||||
import io.flutter.app.FlutterActivity
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant
|
||||
|
||||
class MainActivity: FlutterActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
GeneratedPluginRegistrant.registerWith(this)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Modify this file to customize your launch splash screen -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@android:color/white" />
|
||||
|
||||
<!-- You can insert your own image assets here -->
|
||||
<!-- <item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@mipmap/launch_image" />
|
||||
</item> -->
|
||||
</layer-list>
|
||||
|
After Width: | Height: | Size: 544 B |
|
After Width: | Height: | Size: 442 B |
|
After Width: | Height: | Size: 721 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||
<!-- Show a splash screen on the activity. Automatically removed when
|
||||
Flutter draws its first frame -->
|
||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -0,0 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.fb_auth_example">
|
||||
<!-- Flutter needs it to communicate with the running application
|
||||
to allow setting breakpoints, to provide hot reload, etc.
|
||||
-->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
</manifest>
|
||||
@@ -0,0 +1,32 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.2.71'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.2.0'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#Fri Jun 23 08:50:38 CEST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
@@ -0,0 +1,15 @@
|
||||
include ':app'
|
||||
|
||||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
|
||||
|
||||
def plugins = new Properties()
|
||||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
|
||||
if (pluginsFile.exists()) {
|
||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
||||
}
|
||||
|
||||
plugins.each { name, path ->
|
||||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
|
||||
include ":$name"
|
||||
project(":$name").projectDir = pluginDirectory
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>App</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>io.flutter.flutter.app</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>App</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>8.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,3 @@
|
||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
@@ -0,0 +1,3 @@
|
||||
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||
#include "Generated.xcconfig"
|
||||
@@ -0,0 +1,77 @@
|
||||
# Using a CDN with CocoaPods 1.7.2 or later can save a lot of time on pod installation, but it's experimental rather than the default.
|
||||
# source 'https://cdn.cocoapods.org/'
|
||||
|
||||
# Uncomment this line to define a global platform for your project
|
||||
# platform :ios, '9.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
project 'Runner', {
|
||||
'Debug' => :debug,
|
||||
'Profile' => :release,
|
||||
'Release' => :release,
|
||||
}
|
||||
|
||||
def parse_KV_file(file, separator='=')
|
||||
file_abs_path = File.expand_path(file)
|
||||
if !File.exists? file_abs_path
|
||||
return [];
|
||||
end
|
||||
pods_ary = []
|
||||
skip_line_start_symbols = ["#", "/"]
|
||||
File.foreach(file_abs_path) { |line|
|
||||
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
|
||||
plugin = line.split(pattern=separator)
|
||||
if plugin.length == 2
|
||||
podname = plugin[0].strip()
|
||||
path = plugin[1].strip()
|
||||
podpath = File.expand_path("#{path}", file_abs_path)
|
||||
pods_ary.push({:name => podname, :path => podpath});
|
||||
else
|
||||
puts "Invalid plugin specification: #{line}"
|
||||
end
|
||||
}
|
||||
return pods_ary
|
||||
end
|
||||
|
||||
target 'Runner' do
|
||||
use_frameworks!
|
||||
|
||||
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
|
||||
# referring to absolute paths on developers' machines.
|
||||
system('rm -rf .symlinks')
|
||||
system('mkdir -p .symlinks/plugins')
|
||||
|
||||
# Flutter Pods
|
||||
generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
|
||||
if generated_xcode_build_settings.empty?
|
||||
puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first."
|
||||
end
|
||||
generated_xcode_build_settings.map { |p|
|
||||
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
|
||||
symlink = File.join('.symlinks', 'flutter')
|
||||
File.symlink(File.dirname(p[:path]), symlink)
|
||||
pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
|
||||
end
|
||||
}
|
||||
|
||||
# Plugin Pods
|
||||
plugin_pods = parse_KV_file('../.flutter-plugins')
|
||||
plugin_pods.map { |p|
|
||||
symlink = File.join('.symlinks', 'plugins', p[:name])
|
||||
File.symlink(p[:path], symlink)
|
||||
pod p[:name], :path => File.join(symlink, 'ios')
|
||||
}
|
||||
end
|
||||
|
||||
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
|
||||
install! 'cocoapods', :disable_input_output_paths => true
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['ENABLE_BITCODE'] = 'NO'
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,135 @@
|
||||
PODS:
|
||||
- Firebase/Auth (6.7.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseAuth (~> 6.2.3)
|
||||
- Firebase/Core (6.7.0):
|
||||
- Firebase/CoreOnly
|
||||
- FirebaseAnalytics (= 6.1.1)
|
||||
- Firebase/CoreOnly (6.7.0):
|
||||
- FirebaseCore (= 6.2.1)
|
||||
- firebase_auth (0.0.1):
|
||||
- Firebase/Auth (~> 6.0)
|
||||
- Firebase/Core
|
||||
- Flutter
|
||||
- firebase_core (0.0.1):
|
||||
- Firebase/Core
|
||||
- Flutter
|
||||
- FirebaseAnalytics (6.1.1):
|
||||
- FirebaseCore (~> 6.2)
|
||||
- FirebaseInstanceID (~> 4.2)
|
||||
- GoogleAppMeasurement (= 6.1.1)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 6.0)
|
||||
- GoogleUtilities/Network (~> 6.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 6.0)"
|
||||
- nanopb (~> 0.3)
|
||||
- FirebaseAuth (6.2.3):
|
||||
- FirebaseAuthInterop (~> 1.0)
|
||||
- FirebaseCore (~> 6.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.2)
|
||||
- GoogleUtilities/Environment (~> 6.2)
|
||||
- GTMSessionFetcher/Core (~> 1.1)
|
||||
- FirebaseAuthInterop (1.0.0)
|
||||
- FirebaseCore (6.2.1):
|
||||
- FirebaseCoreDiagnostics (~> 1.0)
|
||||
- FirebaseCoreDiagnosticsInterop (~> 1.0)
|
||||
- GoogleUtilities/Environment (~> 6.2)
|
||||
- GoogleUtilities/Logger (~> 6.2)
|
||||
- FirebaseCoreDiagnostics (1.0.1):
|
||||
- FirebaseCoreDiagnosticsInterop (~> 1.0)
|
||||
- GoogleDataTransportCCTSupport (~> 1.0)
|
||||
- GoogleUtilities/Environment (~> 6.2)
|
||||
- GoogleUtilities/Logger (~> 6.2)
|
||||
- FirebaseCoreDiagnosticsInterop (1.0.0)
|
||||
- FirebaseInstanceID (4.2.3):
|
||||
- FirebaseCore (~> 6.0)
|
||||
- GoogleUtilities/Environment (~> 6.0)
|
||||
- GoogleUtilities/UserDefaults (~> 6.0)
|
||||
- Flutter (1.0.0)
|
||||
- GoogleAppMeasurement (6.1.1):
|
||||
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
|
||||
- GoogleUtilities/MethodSwizzler (~> 6.0)
|
||||
- GoogleUtilities/Network (~> 6.0)
|
||||
- "GoogleUtilities/NSData+zlib (~> 6.0)"
|
||||
- nanopb (~> 0.3)
|
||||
- GoogleDataTransport (1.1.2)
|
||||
- GoogleDataTransportCCTSupport (1.0.2):
|
||||
- GoogleDataTransport (~> 1.1)
|
||||
- nanopb
|
||||
- GoogleUtilities/AppDelegateSwizzler (6.2.5):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Environment (6.2.5)
|
||||
- GoogleUtilities/Logger (6.2.5):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/MethodSwizzler (6.2.5):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network (6.2.5):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (6.2.5)"
|
||||
- GoogleUtilities/Reachability (6.2.5):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/UserDefaults (6.2.5):
|
||||
- GoogleUtilities/Logger
|
||||
- GTMSessionFetcher/Core (1.2.2)
|
||||
- nanopb (0.3.901):
|
||||
- nanopb/decode (= 0.3.901)
|
||||
- nanopb/encode (= 0.3.901)
|
||||
- nanopb/decode (0.3.901)
|
||||
- nanopb/encode (0.3.901)
|
||||
|
||||
DEPENDENCIES:
|
||||
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
|
||||
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
|
||||
- Flutter (from `.symlinks/flutter/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
https://github.com/cocoapods/specs.git:
|
||||
- Firebase
|
||||
- FirebaseAnalytics
|
||||
- FirebaseAuth
|
||||
- FirebaseAuthInterop
|
||||
- FirebaseCore
|
||||
- FirebaseCoreDiagnostics
|
||||
- FirebaseCoreDiagnosticsInterop
|
||||
- FirebaseInstanceID
|
||||
- GoogleAppMeasurement
|
||||
- GoogleDataTransport
|
||||
- GoogleDataTransportCCTSupport
|
||||
- GoogleUtilities
|
||||
- GTMSessionFetcher
|
||||
- nanopb
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
firebase_auth:
|
||||
:path: ".symlinks/plugins/firebase_auth/ios"
|
||||
firebase_core:
|
||||
:path: ".symlinks/plugins/firebase_core/ios"
|
||||
Flutter:
|
||||
:path: ".symlinks/flutter/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Firebase: 291d7b0a7b393f252358083b5d224884126fa46d
|
||||
firebase_auth: 1e3b7bdd37b9fbd4ef75ba1d985b00be09e02d3d
|
||||
firebase_core: ae55ea92448ec8675d325da4db22cf3b4d58a54d
|
||||
FirebaseAnalytics: 843c7f64a8f9c79f0d03281197ebe7bb1d58d477
|
||||
FirebaseAuth: e7f86c2dfc57281cd01f7da5e4b40e01e4510a4a
|
||||
FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc
|
||||
FirebaseCore: 32b48f41c84a56fbde73b35ed01a830b3b6dc048
|
||||
FirebaseCoreDiagnostics: 4c04ae09d0ab027c30179828c6bb47764df1bd13
|
||||
FirebaseCoreDiagnosticsInterop: 6829da2b8d1fc795ff1bd99df751d3788035d2cb
|
||||
FirebaseInstanceID: 8b42755db950682e7de0d167bc6fb26a57b244af
|
||||
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
|
||||
GoogleAppMeasurement: 86a82f0e1f20b8eedf8e20326530138fd71409de
|
||||
GoogleDataTransport: 9c3d63ed82f882a9a74d4be67dd7ad01bf046102
|
||||
GoogleDataTransportCCTSupport: 6b545f7149111180763dc18c6f372c963de4a310
|
||||
GoogleUtilities: e7dc37039b19df7fe543479d3e4a02ac8d11bb69
|
||||
GTMSessionFetcher: 61bb0f61a4cb560030f1222021178008a5727a23
|
||||
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
|
||||
|
||||
PODFILE CHECKSUM: 10ae9c18d12c9ffc2275c9a159a3b1e281990db0
|
||||
|
||||
COCOAPODS: 1.7.2
|
||||
@@ -0,0 +1,591 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0B264CD38F4485B4805FF463 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08B1E4411ADD9E090644DD4F /* Pods_Runner.framework */; };
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
|
||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
|
||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
F780CA1B23213D26002E7EC3 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = F780CA1A23213D26002E7EC3 /* GoogleService-Info.plist */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
|
||||
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
08B1E4411ADD9E090644DD4F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
153375F54E0134D9146069B2 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
|
||||
7079509518FAA06A5CCB56F6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
AF5FB0E3A7316766D119B9D1 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
F780CA1A23213D26002E7EC3 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
|
||||
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
|
||||
0B264CD38F4485B4805FF463 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
734430C48CA032CD69626BB5 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AF5FB0E3A7316766D119B9D1 /* Pods-Runner.debug.xcconfig */,
|
||||
153375F54E0134D9146069B2 /* Pods-Runner.release.xcconfig */,
|
||||
7079509518FAA06A5CCB56F6 /* Pods-Runner.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3B80C3931E831B6300D905FE /* App.framework */,
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||
9740EEBA1CF902C7004384FC /* Flutter.framework */,
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||
);
|
||||
name = Flutter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146E51CF9000F007C117D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9740EEB11CF90186004384FC /* Flutter */,
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
734430C48CA032CD69626BB5 /* Pods */,
|
||||
A21E749DC58E317CA8DEFCD8 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146EF1CF9000F007C117D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146F01CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||
F780CA1A23213D26002E7EC3 /* GoogleService-Info.plist */,
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||
97C147021CF9000F007C117D /* Info.plist */,
|
||||
97C146F11CF9000F007C117D /* Supporting Files */,
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||
);
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146F11CF9000F007C117D /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A21E749DC58E317CA8DEFCD8 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
08B1E4411ADD9E090644DD4F /* Pods_Runner.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
4E7D99980341A01468746A70 /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
BB9E7B33D60916CAE32E3F9A /* [CP] Embed Pods Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Runner;
|
||||
productName = Runner;
|
||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1020;
|
||||
ORGANIZATIONNAME = "The Chromium Authors";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
DevelopmentTeam = 9FK3425VTA;
|
||||
LastSwiftMigration = 0910;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 97C146E51CF9000F007C117D;
|
||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
97C146ED1CF9000F007C117D /* Runner */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||
F780CA1B23213D26002E7EC3 /* GoogleService-Info.plist in Resources */,
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Thin Binary";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
|
||||
};
|
||||
4E7D99980341A01468746A70 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Run Script";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
BB9E7B33D60916CAE32E3F9A /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C146FB1CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
97C147001CF9000F007C117D /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 9FK3425VTA;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.fbAuthExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 4.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Profile;
|
||||
};
|
||||
97C147031CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147041CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
97C147061CF9000F007C117D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 9FK3425VTA;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.fbAuthExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
97C147071CF9000F007C117D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 9FK3425VTA;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/Flutter",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.example.fbAuthExample;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 4.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147031CF9000F007C117D /* Debug */,
|
||||
97C147041CF9000F007C117D /* Release */,
|
||||
249021D3217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
97C147061CF9000F007C117D /* Debug */,
|
||||
97C147071CF9000F007C117D /* Release */,
|
||||
249021D4217E4FDB00AE95B9 /* Profile */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1020"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Profile"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||
BuildableName = "Runner.app"
|
||||
BlueprintName = "Runner"
|
||||
ReferencedContainer = "container:Runner.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,13 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
|
||||
@UIApplicationMain
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
override func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 564 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "LaunchImage@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
|
After Width: | Height: | Size: 68 B |
@@ -0,0 +1,5 @@
|
||||
# Launch Screen Assets
|
||||
|
||||
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||
|
||||
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LaunchImage" width="168" height="185"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Flutter View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>fb_auth_example</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1 @@
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
@@ -0,0 +1,79 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:fb_auth/fb_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import 'plugins/desktop/desktop.dart';
|
||||
import 'ui/auth/check.dart';
|
||||
|
||||
void main() {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
setTargetPlatformForDesktop();
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
final _app = FbApp(
|
||||
apiKey: "API_KEY",
|
||||
authDomain: "AUTH_DOMAIN",
|
||||
databaseURL: "DATABASE_URL",
|
||||
projectId: "PROJECT_ID",
|
||||
storageBucket: "STORAGE_BUCKET",
|
||||
messagingSenderId: "MESSAGING_SENDER_ID",
|
||||
appId: "APP_ID",
|
||||
);
|
||||
|
||||
AuthBloc _auth;
|
||||
StreamSubscription<AuthUser> _userChanged;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_auth.close();
|
||||
_userChanged?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_auth = AuthBloc(saveUser: _saveUser, deleteUser: _deleteUser, app: _app);
|
||||
_auth.add(CheckUser());
|
||||
final _fbAuth = FBAuth(_app);
|
||||
_userChanged = _fbAuth.onAuthChanged().listen((user) {
|
||||
_auth.add(UpdateUser(user));
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
static _deleteUser() async {}
|
||||
|
||||
static _saveUser(user) async {}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider<AuthBloc>(create: (_) => _auth),
|
||||
],
|
||||
child: MaterialApp(
|
||||
home: AuthCheck(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// class MyApp extends StatelessWidget {
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return MaterialApp(
|
||||
// home: Scaffold(
|
||||
// appBar: AppBar(),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@@ -0,0 +1 @@
|
||||
export 'unsupported.dart' if (dart.library.io) 'io.dart';
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void setTargetPlatformForDesktop({TargetPlatform platform}) {
|
||||
TargetPlatform targetPlatform;
|
||||
if (platform != null) {
|
||||
targetPlatform = platform;
|
||||
}
|
||||
if (targetPlatform == null) {
|
||||
if (Platform.isMacOS) {
|
||||
targetPlatform = TargetPlatform.iOS;
|
||||
} else if (Platform.isLinux || Platform.isWindows) {
|
||||
targetPlatform = TargetPlatform.android;
|
||||
}
|
||||
}
|
||||
debugDefaultTargetPlatformOverride = targetPlatform;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
void setTargetPlatformForDesktop({TargetPlatform platform}) {}
|
||||
@@ -0,0 +1,24 @@
|
||||
import 'package:fb_auth/fb_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../auth/screen.dart';
|
||||
import '../home/screen.dart';
|
||||
|
||||
class AuthCheck extends StatelessWidget {
|
||||
const AuthCheck({
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<AuthBloc, AuthState>(
|
||||
builder: (context, state) {
|
||||
if (state is LoggedInState) {
|
||||
return HomeScreen();
|
||||
}
|
||||
return LoginScreen();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
import 'package:fb_auth/fb_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
@override
|
||||
_LoginScreenState createState() => _LoginScreenState();
|
||||
}
|
||||
|
||||
class _LoginScreenState extends State<LoginScreen> {
|
||||
bool _createAccount = true;
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
String _email, _password, _name;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _auth = BlocProvider.of<AuthBloc>(context);
|
||||
return BlocBuilder<AuthBloc, AuthState>(
|
||||
builder: (context, state) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Login to Firebase'),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Visibility(
|
||||
visible: _createAccount,
|
||||
child: ListTile(
|
||||
title: TextFormField(
|
||||
decoration: InputDecoration(labelText: 'Display Name'),
|
||||
onSaved: (val) => _name = val,
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: TextFormField(
|
||||
decoration: InputDecoration(labelText: 'Email'),
|
||||
validator: (val) => val.isEmpty ? 'Email Required' : null,
|
||||
onSaved: (val) => _email = val,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: TextFormField(
|
||||
decoration: InputDecoration(labelText: 'Password'),
|
||||
validator: (val) =>
|
||||
val.isEmpty ? 'Password Required' : null,
|
||||
onSaved: (val) => _password = val,
|
||||
),
|
||||
),
|
||||
if (_createAccount) ...[
|
||||
ListTile(
|
||||
title: RaisedButton(
|
||||
child: Text('Sign Up'),
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
_formKey.currentState.save();
|
||||
_auth.add(CreateAccount(_email, _password,
|
||||
displayName: _name));
|
||||
}
|
||||
},
|
||||
)),
|
||||
] else ...[
|
||||
ListTile(
|
||||
title: RaisedButton(
|
||||
child: Text('Login'),
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
_formKey.currentState.save();
|
||||
_auth.add(LoginEvent(_email, _password));
|
||||
}
|
||||
},
|
||||
)),
|
||||
],
|
||||
ListTile(
|
||||
title: FlatButton(
|
||||
child: Text(_createAccount
|
||||
? 'Already have an account?'
|
||||
: 'Create a new account?'),
|
||||
onPressed: () {
|
||||
if (mounted)
|
||||
setState(() {
|
||||
_createAccount = !_createAccount;
|
||||
});
|
||||
},
|
||||
)),
|
||||
ListTile(
|
||||
title: RaisedButton(
|
||||
child: Text('Start as Guest'),
|
||||
onPressed: () {
|
||||
_auth.add(LoginGuest());
|
||||
},
|
||||
)),
|
||||
if (state is AuthLoadingState) ...[CircularProgressIndicator()],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import 'package:fb_auth/fb_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final _user = AuthBloc.currentUser(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('Welcome ${_user?.displayName ?? 'Guest'}'),
|
||||
),
|
||||
body: Center(
|
||||
child: RaisedButton(
|
||||
child: Text('Logout'),
|
||||
onPressed: () {
|
||||
BlocProvider.of<AuthBloc>(context).add(LogoutEvent(_user));
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
name: fb_auth_example
|
||||
description: Demonstrates how to use the fb_auth plugin.
|
||||
version: 0.0.1+1
|
||||
publish_to: 'none'
|
||||
|
||||
environment:
|
||||
sdk: ">=2.2.2 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
bloc: ^2.0.0
|
||||
flutter_bloc: ^2.0.0
|
||||
cupertino_icons: ^0.1.2
|
||||
fb_auth:
|
||||
path: ../
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
flutter:
|
||||
|
||||
uses-material-design: true
|
||||
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>fb_auth_example</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script src="main.dart.js" type="application/javascript"></script>
|
||||
<!-- The core Firebase JS SDK is always required and must be listed first -->
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-app.js"></script>
|
||||
|
||||
<!-- TODO: Add SDKs for Firebase products that you want to use
|
||||
https://firebase.google.com/docs/web/setup#config-web-app -->
|
||||
<script src="https://www.gstatic.com/firebasejs//6.3.3/firebase-auth.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-firestore.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-storage.js"></script>
|
||||
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-functions.js"></script>
|
||||
|
||||
<script>
|
||||
// Your web app's Firebase configuration
|
||||
var firebaseConfig = {
|
||||
apiKey: "API_KEY",
|
||||
authDomain: "AUTH_DOMAIN",
|
||||
databaseURL: "DATABASE_URL",
|
||||
projectId: "PROJECT_ID",
|
||||
storageBucket: "STORAGE_BUCKET",
|
||||
messagingSenderId: "MESSAGING_SENDER_ID",
|
||||
appId: "APP_ID"
|
||||
};
|
||||
// Initialize Firebase
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,172 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import './bloc.dart';
|
||||
import '../../../fb_auth.dart';
|
||||
import '../../classes/auth_user.dart';
|
||||
|
||||
class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
AuthBloc({
|
||||
@required this.app,
|
||||
this.saveUser,
|
||||
this.deleteUser,
|
||||
}) : _auth = FBAuth(app);
|
||||
|
||||
final FbApp app;
|
||||
|
||||
final FBAuth _auth;
|
||||
|
||||
@override
|
||||
AuthState get initialState => InitialAuthState();
|
||||
|
||||
@override
|
||||
Stream<AuthState> mapEventToState(
|
||||
AuthEvent event,
|
||||
) async* {
|
||||
if (event is CheckUser) {
|
||||
yield* _mapCheckToState(event);
|
||||
}
|
||||
if (event is LoginEvent) {
|
||||
yield* _mapLoginToState(event);
|
||||
}
|
||||
if (event is LogoutEvent) {
|
||||
yield* _mapLogoutToState(event);
|
||||
}
|
||||
if (event is CreateAccount) {
|
||||
yield* _mapCreateToState(event);
|
||||
}
|
||||
if (event is UpdateUser) {
|
||||
yield* _mapUpdateToState(event);
|
||||
}
|
||||
if (event is EditInfo) {
|
||||
yield* _mapEditInfoToState(event);
|
||||
}
|
||||
if (event is ForgotPassword) {
|
||||
yield* _mapForgotPasswordToState(event);
|
||||
}
|
||||
if (event is SendEmailVerification) {
|
||||
yield* _mapVerifyToState(event);
|
||||
}
|
||||
if (event is LoginGuest) {
|
||||
yield* _mapGuestToState(event);
|
||||
}
|
||||
if (event is LoginGoogle) {
|
||||
yield* _mapGoogleToState(event);
|
||||
}
|
||||
if (event is ChangeUser) {
|
||||
yield LoggedInState(event.user);
|
||||
}
|
||||
}
|
||||
|
||||
/// Called every time the user info changes. You can use this method for updating a database.
|
||||
final Function(AuthUser) saveUser;
|
||||
|
||||
/// Called when the user logs out. You can use this method for updating a database.
|
||||
final Function() deleteUser;
|
||||
|
||||
Stream<AuthState> _mapGoogleToState(LoginGoogle event) async* {
|
||||
yield AuthLoadingState();
|
||||
final _user = await _auth.loginGoogle(
|
||||
idToken: event.idToken, accessToken: event.accessToken);
|
||||
if (_user != null) {
|
||||
if (saveUser != null) saveUser(_user);
|
||||
yield LoggedInState(_user);
|
||||
} else {
|
||||
yield LoggedOutState();
|
||||
}
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapGuestToState(LoginGuest event) async* {
|
||||
yield AuthLoadingState();
|
||||
final _user = await _auth.startAsGuest();
|
||||
if (_user != null) {
|
||||
if (saveUser != null) saveUser(_user);
|
||||
yield LoggedInState(_user);
|
||||
} else {
|
||||
yield LoggedOutState();
|
||||
}
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapCheckToState(CheckUser event) async* {
|
||||
yield AuthLoadingState();
|
||||
final _user = await _auth.currentUser();
|
||||
if (_user != null) {
|
||||
if (saveUser != null) saveUser(_user);
|
||||
yield LoggedInState(_user);
|
||||
} else {
|
||||
yield LoggedOutState();
|
||||
}
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapCreateToState(CreateAccount event) async* {
|
||||
yield AuthLoadingState();
|
||||
try {
|
||||
AuthUser _user = await _auth.createAccount(event.username, event.password,
|
||||
displayName: event?.displayName, photoUrl: event?.photoUrl);
|
||||
if (_user != null) {
|
||||
if (saveUser != null) saveUser(_user);
|
||||
yield LoggedInState(_user);
|
||||
} else {
|
||||
yield AuthErrorState('Error creating user!');
|
||||
}
|
||||
} catch (e) {
|
||||
yield AuthErrorState('Email already exists!');
|
||||
}
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapLoginToState(LoginEvent event) async* {
|
||||
yield AuthLoadingState();
|
||||
final _user = await _auth.login(event.username, event.password);
|
||||
if (_user != null) {
|
||||
if (saveUser != null) saveUser(_user);
|
||||
yield LoggedInState(_user);
|
||||
} else {
|
||||
yield AuthErrorState('Username or Password Incorrect!');
|
||||
}
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapLogoutToState(LogoutEvent event) async* {
|
||||
yield AuthLoadingState();
|
||||
await _auth.logout();
|
||||
if (deleteUser != null) deleteUser();
|
||||
yield LoggedOutState();
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapVerifyToState(SendEmailVerification event) async* {
|
||||
await _auth.sendEmailVerification();
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapEditInfoToState(EditInfo event) async* {
|
||||
yield AuthLoadingState();
|
||||
await _auth.editInfo(
|
||||
displayName: event?.displayName, photoUrl: event?.photoUrl);
|
||||
final _user = await _auth.currentUser();
|
||||
if (saveUser != null) saveUser(_user);
|
||||
yield LoggedInState(_user);
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapUpdateToState(UpdateUser event) async* {
|
||||
if (event?.user != null) {
|
||||
if (saveUser != null) saveUser(event.user);
|
||||
yield LoggedInState(event.user);
|
||||
} else {
|
||||
yield LoggedOutState();
|
||||
}
|
||||
}
|
||||
|
||||
Stream<AuthState> _mapForgotPasswordToState(ForgotPassword event) async* {
|
||||
await _auth.forgotPassword(event.email);
|
||||
}
|
||||
|
||||
static AuthUser currentUser(BuildContext context) {
|
||||
final auth = BlocProvider.of<AuthBloc>(context);
|
||||
final state = auth.state;
|
||||
if (state is LoggedInState) {
|
||||
return state.user;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import '../../classes/index.dart';
|
||||
|
||||
@immutable
|
||||
abstract class AuthEvent {}
|
||||
|
||||
class CheckUser extends AuthEvent {}
|
||||
|
||||
class LoginEvent extends AuthEvent {
|
||||
LoginEvent(this.username, this.password);
|
||||
|
||||
final String username, password;
|
||||
}
|
||||
|
||||
class LoginGuest extends AuthEvent {}
|
||||
|
||||
class CreateAccount extends AuthEvent {
|
||||
CreateAccount(this.username, this.password,
|
||||
{this.displayName, this.photoUrl});
|
||||
|
||||
final String username, password;
|
||||
final String displayName, photoUrl;
|
||||
}
|
||||
|
||||
class ChangeUser extends AuthEvent {
|
||||
ChangeUser(this.user);
|
||||
|
||||
final AuthUser user;
|
||||
}
|
||||
|
||||
class LogoutEvent extends AuthEvent {
|
||||
LogoutEvent(this.user);
|
||||
|
||||
final AuthUser user;
|
||||
}
|
||||
|
||||
class UpdateUser extends AuthEvent {
|
||||
UpdateUser(this.user);
|
||||
|
||||
final AuthUser user;
|
||||
}
|
||||
|
||||
class ForgotPassword extends AuthEvent {
|
||||
ForgotPassword(this.email);
|
||||
|
||||
final String email;
|
||||
}
|
||||
|
||||
class LoginGoogle extends AuthEvent {
|
||||
LoginGoogle({
|
||||
this.accessToken,
|
||||
this.idToken,
|
||||
});
|
||||
|
||||
final String idToken;
|
||||
final String accessToken;
|
||||
}
|
||||
|
||||
class SendEmailVerification extends AuthEvent {}
|
||||
|
||||
class EditInfo extends AuthEvent {
|
||||
EditInfo(this.user, {this.displayName, this.photoUrl});
|
||||
|
||||
final String displayName, photoUrl;
|
||||
final AuthUser user;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import '../../classes/index.dart';
|
||||
|
||||
@immutable
|
||||
abstract class AuthState {}
|
||||
|
||||
class InitialAuthState extends AuthState {}
|
||||
|
||||
class LoggedInState extends AuthState {
|
||||
LoggedInState(this.user);
|
||||
|
||||
final AuthUser user;
|
||||
}
|
||||
|
||||
class LoggedOutState extends AuthState {}
|
||||
|
||||
class AuthLoadingState extends AuthState {}
|
||||
|
||||
class AuthErrorState extends AuthState {
|
||||
AuthErrorState(this.message);
|
||||
|
||||
final String message;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export 'auth_bloc.dart';
|
||||
export 'auth_event.dart';
|
||||
export 'auth_state.dart';
|
||||
@@ -0,0 +1 @@
|
||||
export 'auth/bloc.dart';
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
|
||||
class SimpleBlocDelegate extends BlocDelegate {
|
||||
@override
|
||||
void onEvent(Bloc bloc, Object event) {
|
||||
super.onEvent(bloc, event);
|
||||
print(event);
|
||||
}
|
||||
|
||||
@override
|
||||
void onTransition(Bloc bloc, Transition transition) {
|
||||
super.onTransition(bloc, transition);
|
||||
print(transition);
|
||||
}
|
||||
|
||||
@override
|
||||
void onError(Bloc bloc, Object error, StackTrace stacktrace) {
|
||||
super.onError(bloc, error, stacktrace);
|
||||
print('$error, $stacktrace');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
class FbApp {
|
||||
FbApp({
|
||||
this.apiKey,
|
||||
this.authDomain,
|
||||
this.databaseURL,
|
||||
this.projectId,
|
||||
this.storageBucket,
|
||||
this.messagingSenderId,
|
||||
this.appId,
|
||||
this.measurementId,
|
||||
});
|
||||
|
||||
final String apiKey;
|
||||
final String authDomain;
|
||||
final String databaseURL;
|
||||
final String projectId;
|
||||
final String storageBucket;
|
||||
final String messagingSenderId;
|
||||
final String appId;
|
||||
final String measurementId;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class AuthUser {
|
||||
final String uid;
|
||||
final String displayName;
|
||||
final String email;
|
||||
final String photoUrl;
|
||||
|
||||
AuthUser({
|
||||
@required this.uid,
|
||||
@required this.displayName,
|
||||
@required this.email,
|
||||
@required this.isEmailVerified,
|
||||
@required this.isAnonymous,
|
||||
@required this.photoUrl,
|
||||
});
|
||||
final bool isEmailVerified;
|
||||
final bool isAnonymous;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '$displayName';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export 'app.dart';
|
||||
export 'auth_user.dart';
|
||||
@@ -0,0 +1,3 @@
|
||||
export 'unsupported.dart'
|
||||
if (dart.library.html) 'web.dart'
|
||||
if (dart.library.io) 'io.dart';
|
||||
@@ -0,0 +1,52 @@
|
||||
import '../../classes/index.dart';
|
||||
|
||||
abstract class FBAuthImpl {
|
||||
final FbApp app;
|
||||
|
||||
FBAuthImpl(this.app);
|
||||
|
||||
Future<AuthUser> login(String username, String password) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future<AuthUser> createAccount(String username, String password,
|
||||
{String displayName, String photoUrl}) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future logout() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future<AuthUser> currentUser() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future<AuthUser> startAsGuest() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Stream<AuthUser> onAuthChanged() {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future editInfo({String displayName, String photoUrl}) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future forgotPassword(String email) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future sendEmailVerification() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future loginCustomToken(String token) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
Future loginGoogle({String idToken, String accessToken}) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import '../../classes/index.dart';
|
||||
import '../../utils/directory.dart';
|
||||
import '../mobile/sdk.dart';
|
||||
import '../rest_api/client.dart';
|
||||
import 'impl.dart';
|
||||
|
||||
class FBAuth implements FBAuthImpl {
|
||||
final FbApp app;
|
||||
final bool useRestClient;
|
||||
File _saveFile;
|
||||
|
||||
FBAuth(
|
||||
this.app, {
|
||||
this.useRestClient = false,
|
||||
}) {
|
||||
if (useClient) {
|
||||
_client = FbClient(
|
||||
app,
|
||||
onLoad: () async {
|
||||
await _loadFile();
|
||||
Map<String, dynamic> storage = Map<String, dynamic>();
|
||||
if (await _saveFile.exists()) {
|
||||
try {
|
||||
storage = json.decode(await _saveFile.readAsString())
|
||||
as Map<String, dynamic>;
|
||||
return storage;
|
||||
} catch (_) {
|
||||
await _saveFile.delete();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onSave: (data) async {
|
||||
try {
|
||||
if (data == null) {
|
||||
await _saveFile.delete();
|
||||
} else {
|
||||
await _saveFile.writeAsString(json.encode(data));
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
);
|
||||
}
|
||||
if (isMobile) {
|
||||
_sdk = FbSdk();
|
||||
}
|
||||
}
|
||||
|
||||
Future _loadFile() async {
|
||||
if (_saveFile == null) {
|
||||
final dir = await PathUtils.getDocumentDir();
|
||||
_saveFile = File('${dir.path}/fb_auth.json');
|
||||
}
|
||||
}
|
||||
|
||||
bool get useClient => isDesktop || useRestClient;
|
||||
static bool get isDesktop =>
|
||||
Platform.isWindows || Platform.isWindows || Platform.isMacOS;
|
||||
static bool get isMobile => Platform.isIOS || Platform.isAndroid;
|
||||
FbSdk _sdk;
|
||||
FbClient _client;
|
||||
@override
|
||||
Future<AuthUser> login(String username, String password) async {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
return _client.login(username, password);
|
||||
} else {
|
||||
return _sdk.login(username, password);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<AuthUser> onAuthChanged() {
|
||||
if (useClient) {
|
||||
return _client.onAuthChanged();
|
||||
} else {
|
||||
return _sdk.onAuthChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> startAsGuest() async {
|
||||
try {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
return _client.startAsGuest();
|
||||
} else {
|
||||
return _sdk.startAsGuest();
|
||||
}
|
||||
} catch (e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future logout() async {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
await _client.logout();
|
||||
} else {
|
||||
await _sdk.logout();
|
||||
}
|
||||
try {
|
||||
await _saveFile.delete();
|
||||
} catch (e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> currentUser() async {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
return _client.currentUser();
|
||||
} else {
|
||||
return _sdk.currentUser();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future editInfo({String displayName, String photoUrl}) async {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
return _client.editInfo(
|
||||
displayName: displayName,
|
||||
photoUrl: photoUrl,
|
||||
);
|
||||
} else {
|
||||
return _sdk.editInfo(
|
||||
displayName: displayName,
|
||||
photoUrl: photoUrl,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future forgotPassword(String email) async {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
return _client.forgotPassword(email);
|
||||
} else {
|
||||
return _sdk.forgotPassword(email);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future sendEmailVerification() async {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
return _client.sendEmailVerification();
|
||||
} else {
|
||||
return _sdk.sendEmailVerification();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> createAccount(String username, String password,
|
||||
{String displayName, String photoUrl}) async {
|
||||
if (useClient) {
|
||||
await _loadFile();
|
||||
return _client.createAccount(
|
||||
username,
|
||||
password,
|
||||
photoUrl: photoUrl,
|
||||
displayName: displayName,
|
||||
);
|
||||
} else {
|
||||
return _sdk.createAccount(
|
||||
username,
|
||||
password,
|
||||
photoUrl: photoUrl,
|
||||
displayName: displayName,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginCustomToken(String token) async {
|
||||
if (useClient) {
|
||||
return _client.loginCustomToken(token);
|
||||
} else {
|
||||
return _sdk.loginCustomToken(token);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginGoogle({String idToken, String accessToken}) async {
|
||||
if (useClient) {
|
||||
return _client.loginGoogle(
|
||||
idToken: idToken,
|
||||
accessToken: accessToken,
|
||||
);
|
||||
} else {
|
||||
return _sdk.loginGoogle(
|
||||
idToken: idToken,
|
||||
accessToken: accessToken,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import '../../classes/index.dart';
|
||||
import 'impl.dart';
|
||||
|
||||
class FBAuth implements FBAuthImpl {
|
||||
final FbApp app;
|
||||
|
||||
FBAuth(this.app);
|
||||
|
||||
@override
|
||||
Future<AuthUser> login(String username, String password) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> createAccount(String username, String password,
|
||||
{String displayName, String photoUrl}) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future logout() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> currentUser() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> startAsGuest() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<AuthUser> onAuthChanged() {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future editInfo({String displayName, String photoUrl}) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future forgotPassword(String email) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future sendEmailVerification() async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginCustomToken(String token) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginGoogle({String idToken, String accessToken}) async {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,210 @@
|
||||
import 'package:firebase/firebase.dart';
|
||||
|
||||
import '../../classes/index.dart';
|
||||
import 'impl.dart';
|
||||
|
||||
class FBAuth implements FBAuthImpl {
|
||||
final FbApp app;
|
||||
final _auth = auth();
|
||||
|
||||
FBAuth(this.app);
|
||||
|
||||
Future _setPersistenceWeb(Auth _auth) async {
|
||||
// try {
|
||||
// var selectedPersistence = 'local';
|
||||
// await _auth.setPersistence(selectedPersistence);
|
||||
// } catch (e) {
|
||||
// print('_auth.setPersistence -> $e');
|
||||
// }
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> login(String username, String password) async {
|
||||
await _setPersistenceWeb(_auth);
|
||||
try {
|
||||
final _result =
|
||||
await _auth.signInWithEmailAndPassword(username, password);
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.emailVerified,
|
||||
photoUrl: _result.user.photoURL,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> _loginWeb -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> startAsGuest() async {
|
||||
await _setPersistenceWeb(_auth);
|
||||
try {
|
||||
final _result = await _auth.signInAnonymously();
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.emailVerified,
|
||||
photoUrl: _result.user.photoURL,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> startAsGuest -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future logout() async {
|
||||
try {
|
||||
await _auth.signOut();
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> logout -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<AuthUser> onAuthChanged() {
|
||||
return _auth.onAuthStateChanged.map((user) {
|
||||
if (user == null) return null;
|
||||
final _user = AuthUser(
|
||||
uid: user.uid,
|
||||
displayName: user.displayName,
|
||||
email: user?.email,
|
||||
isAnonymous: user.isAnonymous,
|
||||
isEmailVerified: user.emailVerified,
|
||||
photoUrl: user.photoURL,
|
||||
);
|
||||
return _user;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> currentUser() async {
|
||||
await _setPersistenceWeb(_auth);
|
||||
try {
|
||||
final _result = _auth.currentUser;
|
||||
if (_result != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.uid,
|
||||
displayName: _result.displayName,
|
||||
email: _result?.email,
|
||||
isAnonymous: _result.isAnonymous,
|
||||
isEmailVerified: _result.emailVerified,
|
||||
photoUrl: _result.photoURL,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> currentUser -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future editInfo({String displayName, String photoUrl}) async {
|
||||
final _user = _auth.currentUser;
|
||||
final _info = UserProfile();
|
||||
if (displayName != null) _info.displayName = displayName;
|
||||
if (photoUrl != null) _info.photoURL = photoUrl;
|
||||
try {
|
||||
await _user.updateProfile(_info);
|
||||
} catch (e) {
|
||||
throw 'Error editInfo -> $e';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future forgotPassword(String email) async {
|
||||
try {
|
||||
await _auth.sendPasswordResetEmail(email);
|
||||
} catch (e) {
|
||||
throw 'Error forgotPassword -> $e';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future sendEmailVerification() async {
|
||||
try {
|
||||
final _user = _auth.currentUser;
|
||||
await _user.sendEmailVerification();
|
||||
} catch (e) {
|
||||
throw 'Error sendEmailVerification -> $e';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> createAccount(String username, String password,
|
||||
{String displayName, String photoUrl}) async {
|
||||
UserCredential _user;
|
||||
try {
|
||||
_user = await _auth.createUserWithEmailAndPassword(username, password);
|
||||
if (_user != null) {
|
||||
await editInfo(displayName: displayName, photoUrl: photoUrl);
|
||||
}
|
||||
} catch (e) {}
|
||||
if (_user == null) {
|
||||
try {
|
||||
_user = await _auth.signInWithEmailAndPassword(username, password);
|
||||
} catch (err) {
|
||||
throw Exception(err);
|
||||
}
|
||||
}
|
||||
return await currentUser();
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginCustomToken(String token) async {
|
||||
await _setPersistenceWeb(_auth);
|
||||
try {
|
||||
final _result = await _auth.signInAndRetrieveDataWithCustomToken(token);
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.emailVerified,
|
||||
photoUrl: _result.user.photoURL,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> loginCustomToken -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginGoogle({String idToken, String accessToken}) async {
|
||||
final _cred = GoogleAuthProvider.credential(idToken, accessToken);
|
||||
await _setPersistenceWeb(_auth);
|
||||
try {
|
||||
final _result = await _auth.signInWithCredential(_cred);
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.emailVerified,
|
||||
photoUrl: _result.user.photoURL,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> loginCustomToken -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
|
||||
import '../../classes/index.dart';
|
||||
import '../auth/impl.dart';
|
||||
|
||||
class FbSdk implements FBAuthImpl {
|
||||
final _auth = FirebaseAuth.instance;
|
||||
@override
|
||||
Future<AuthUser> login(String username, String password) async {
|
||||
try {
|
||||
final _result = await _auth.signInWithEmailAndPassword(
|
||||
email: username, password: password);
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.isEmailVerified,
|
||||
photoUrl: _result.user.photoUrl,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> _loginMobile -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<AuthUser> onAuthChanged() {
|
||||
return _auth.onAuthStateChanged.map((user) {
|
||||
if (user == null) return null;
|
||||
final _user = AuthUser(
|
||||
uid: user.uid,
|
||||
displayName: user.displayName,
|
||||
email: user?.email,
|
||||
isAnonymous: user.isAnonymous,
|
||||
isEmailVerified: user.isEmailVerified,
|
||||
photoUrl: user.photoUrl,
|
||||
);
|
||||
return _user;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> startAsGuest() async {
|
||||
final _result = await _auth.signInAnonymously();
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.isEmailVerified,
|
||||
photoUrl: _result.user.photoUrl,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future logout() async {
|
||||
try {
|
||||
await _auth.signOut();
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> logout -> $e');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> currentUser() async {
|
||||
try {
|
||||
final _result = await _auth.currentUser();
|
||||
if (_result != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.uid,
|
||||
displayName: _result.displayName,
|
||||
email: _result?.email,
|
||||
isAnonymous: _result.isAnonymous,
|
||||
isEmailVerified: _result.isEmailVerified,
|
||||
photoUrl: _result.photoUrl,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> currentUser -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future editInfo({String displayName, String photoUrl}) async {
|
||||
final _user = await _auth.currentUser();
|
||||
final _info = UserUpdateInfo();
|
||||
if (displayName != null) _info.displayName = displayName;
|
||||
if (photoUrl != null) _info.photoUrl = photoUrl;
|
||||
try {
|
||||
await _user.updateProfile(_info);
|
||||
} catch (e) {
|
||||
throw 'Error editInfo -> $e';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future forgotPassword(String email) async {
|
||||
try {
|
||||
await _auth.sendPasswordResetEmail(email: email);
|
||||
} catch (e) {
|
||||
throw 'Error forgotPassword -> $e';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future sendEmailVerification() async {
|
||||
try {
|
||||
final _user = await _auth.currentUser();
|
||||
await _user.sendEmailVerification();
|
||||
} catch (e) {
|
||||
throw 'Error sendEmailVerification -> $e';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> createAccount(String username, String password,
|
||||
{String displayName, String photoUrl}) async {
|
||||
AuthResult _user;
|
||||
try {
|
||||
_user = await _auth.createUserWithEmailAndPassword(
|
||||
email: username,
|
||||
password: password,
|
||||
);
|
||||
if (_user != null) {
|
||||
await editInfo(displayName: displayName, photoUrl: photoUrl);
|
||||
}
|
||||
} catch (e) {}
|
||||
if (_user == null) {
|
||||
try {
|
||||
_user = await _auth.signInWithEmailAndPassword(
|
||||
email: username,
|
||||
password: password,
|
||||
);
|
||||
} catch (err) {
|
||||
throw Exception(err);
|
||||
}
|
||||
}
|
||||
return await currentUser();
|
||||
}
|
||||
|
||||
@override
|
||||
FbApp get app => null;
|
||||
|
||||
@override
|
||||
Future loginGoogle({String idToken, String accessToken}) async {
|
||||
final _cred = GoogleAuthProvider.getCredential(
|
||||
idToken: idToken, accessToken: accessToken);
|
||||
try {
|
||||
final _result = await _auth.signInWithCredential(_cred);
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.isEmailVerified,
|
||||
photoUrl: _result.user.photoUrl,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> loginGoogle -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginCustomToken(String token) async {
|
||||
try {
|
||||
final _result = await _auth.signInWithCustomToken(token: token);
|
||||
if (_result != null && _result?.user != null) {
|
||||
final _user = AuthUser(
|
||||
uid: _result.user.uid,
|
||||
displayName: _result.user.displayName,
|
||||
email: _result.user?.email,
|
||||
isAnonymous: _result.user.isAnonymous,
|
||||
isEmailVerified: _result.user.isEmailVerified,
|
||||
photoUrl: _result.user.photoUrl,
|
||||
);
|
||||
return _user;
|
||||
}
|
||||
} catch (e) {
|
||||
print('FBAuthUtils -> loginCustomToken -> $e');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import '../../classes/index.dart';
|
||||
import '../auth/impl.dart';
|
||||
import 'helpers/index.dart';
|
||||
|
||||
class FbClient implements FBAuthImpl {
|
||||
FbClient(
|
||||
this.app, {
|
||||
@required this.onSave,
|
||||
@required this.onLoad,
|
||||
}) {
|
||||
_onAuthChanged = StreamController<AuthUser>();
|
||||
}
|
||||
|
||||
StreamController<AuthUser> _onAuthChanged;
|
||||
|
||||
@override
|
||||
final FbApp app;
|
||||
|
||||
@override
|
||||
Future<AuthUser> createAccount(String username, String password,
|
||||
{String displayName, String photoUrl}) async {
|
||||
final result = await http.post(
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${app.apiKey}',
|
||||
body: json.encode(
|
||||
{
|
||||
"email": username,
|
||||
"password": password,
|
||||
"returnSecureToken": true,
|
||||
},
|
||||
));
|
||||
FirestoreJsonAccessToken token = await _saveToken(result);
|
||||
await editInfo(displayName: displayName, photoUrl: photoUrl);
|
||||
token = await _loadToken();
|
||||
return _getUser(token);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> currentUser() async {
|
||||
FirestoreJsonAccessToken token = await _loadToken();
|
||||
if (token != null) {
|
||||
var result = await http.post(
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:lookup?key=${app.apiKey}',
|
||||
body: json.encode({
|
||||
"idToken": token?.idToken,
|
||||
"returnSecureToken": true,
|
||||
}),
|
||||
);
|
||||
token = await _saveToken(result);
|
||||
return _getUser(token);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future editInfo({String displayName, String photoUrl}) async {
|
||||
FirestoreJsonAccessToken token = await _loadToken();
|
||||
final result = await http.post(
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:update?key=${app.apiKey}',
|
||||
body: json.encode({
|
||||
"idToken": token?.idToken,
|
||||
if (displayName != null) ...{
|
||||
'displayName': displayName,
|
||||
},
|
||||
if (photoUrl != null) ...{
|
||||
'photoUrl': photoUrl,
|
||||
},
|
||||
"deleteAttribute": [
|
||||
if (displayName == null) 'DISPLAY_NAME',
|
||||
if (photoUrl == null) 'PHOTO_URL',
|
||||
],
|
||||
"returnSecureToken": true,
|
||||
}),
|
||||
);
|
||||
await _saveToken(result);
|
||||
}
|
||||
|
||||
@override
|
||||
Future forgotPassword(String email) async {
|
||||
final _url =
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key=${app.apiKey}';
|
||||
|
||||
var result = await http.post(
|
||||
_url,
|
||||
body: json.encode({
|
||||
'requestType': 'PASSWORD_RESET',
|
||||
"identifier": email,
|
||||
}),
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> login(String username, String password) async {
|
||||
final result = await http.post(
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=${app.apiKey}',
|
||||
body: json.encode({
|
||||
"email": username,
|
||||
"password": password,
|
||||
"returnSecureToken": true,
|
||||
}),
|
||||
);
|
||||
final token = await _saveToken(result);
|
||||
return _getUser(token);
|
||||
}
|
||||
|
||||
@override
|
||||
Future logout() async {
|
||||
onSave(null);
|
||||
_onAuthChanged.add(null);
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<AuthUser> onAuthChanged() {
|
||||
return _onAuthChanged.stream;
|
||||
}
|
||||
|
||||
@override
|
||||
Future sendEmailVerification() async {
|
||||
FirestoreJsonAccessToken token = await _loadToken();
|
||||
var result = await http.post(
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key=${app.apiKey}',
|
||||
body: json.encode({
|
||||
"idToken": token?.idToken,
|
||||
"requestType": 'VERIFY_EMAIL',
|
||||
}),
|
||||
);
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthUser> startAsGuest() async {
|
||||
final result = await http.post(
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=${app.apiKey}',
|
||||
body: json.encode({
|
||||
"returnSecureToken": true,
|
||||
}),
|
||||
);
|
||||
FirestoreJsonAccessToken token = await _saveToken(result);
|
||||
return _getUser(token);
|
||||
}
|
||||
|
||||
final Future<Map<String, dynamic>> Function() onLoad;
|
||||
|
||||
final Future Function(Map<String, dynamic>) onSave;
|
||||
|
||||
Future<FirestoreJsonAccessToken> _saveToken(http.Response result) async {
|
||||
final _data = json.decode(result.body);
|
||||
final token = FirestoreJsonAccessToken(_data, DateTime.now());
|
||||
await onSave(_data);
|
||||
return token;
|
||||
}
|
||||
|
||||
Future<AuthUser> _getUser(FirestoreJsonAccessToken token) async {
|
||||
http.Response result = await http.post(
|
||||
'https://identitytoolkit.googleapis.com/v1/accounts:lookup?key=${app.apiKey}',
|
||||
body: json.encode({
|
||||
"idToken": token.idToken,
|
||||
"returnSecureToken": true,
|
||||
}));
|
||||
final _users = List.from(json.decode(result.body)['users']);
|
||||
if (result != null)
|
||||
for (var item in _users) {
|
||||
final _user = FirebaseUser(item, token.idToken);
|
||||
if (_user.uid == token.localId) {
|
||||
final _auth = AuthUser(
|
||||
displayName: _user?.displayName,
|
||||
email: _user?.email,
|
||||
isAnonymous: _user?.isAnonymous ?? true,
|
||||
isEmailVerified: _user?.isEmailVerified ?? false,
|
||||
photoUrl: _user.photoUrl,
|
||||
uid: _user?.uid,
|
||||
);
|
||||
_onAuthChanged.add(_auth);
|
||||
return _auth;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<FirestoreJsonAccessToken> _loadToken() async {
|
||||
final _data = await onLoad();
|
||||
if (_data != null) {
|
||||
final token = FirestoreJsonAccessToken(_data, DateTime.now());
|
||||
return token;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginCustomToken(String token) {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
|
||||
@override
|
||||
Future loginGoogle({String idToken, String accessToken}) {
|
||||
throw 'Platform Not Supported';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export 'token.dart';
|
||||
export 'user.dart';
|
||||
@@ -0,0 +1,26 @@
|
||||
class FirestoreJsonAccessToken {
|
||||
FirestoreJsonAccessToken(this.json, this.createdAt);
|
||||
|
||||
final Map<String, dynamic> json;
|
||||
|
||||
String get refreshToken => json["refresh_token"];
|
||||
|
||||
final DateTime createdAt;
|
||||
|
||||
DateTime get expiresAt =>
|
||||
createdAt.add(new Duration(seconds: expiresInSeconds));
|
||||
|
||||
String get displayName => json['displayName'] as String;
|
||||
|
||||
String get email => json['email'] as String;
|
||||
|
||||
String get kind => json['kind'] as String;
|
||||
|
||||
String get idToken => json['idToken'];
|
||||
|
||||
String get localId => json['localId'] as String;
|
||||
|
||||
int get expiresInSeconds => int.tryParse(json["expiresIn"]);
|
||||
|
||||
bool get emailVerified => json['emailVerified'];
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
class FirebaseUser {
|
||||
FirebaseUser(this.json, this.idToken);
|
||||
|
||||
@override
|
||||
final Map<String, dynamic> json;
|
||||
|
||||
final String idToken;
|
||||
|
||||
String get displayName => json['displayName'];
|
||||
|
||||
String get email => json['email'];
|
||||
|
||||
String get photoUrl => json['photoUrl'];
|
||||
|
||||
String get uid => json['localId'];
|
||||
|
||||
bool get registered => json['registered'] ?? false;
|
||||
|
||||
List<ProviderInfo> get providerUserInfo {
|
||||
if (json['providerUserInfo'] == null) return null;
|
||||
return List.from(json['providerUserInfo']).map((i) {
|
||||
final _data = i as Map<String, dynamic>;
|
||||
return ProviderInfo(_data['providerId'], _data['federatedId']);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
bool get isAnonymous => email == null || email.isEmpty;
|
||||
|
||||
bool get isEmailVerified => json['emailVerified'];
|
||||
|
||||
String get passwordHash => json['passwordHash'];
|
||||
|
||||
double get passwordUpdatedAt => json['passwordUpdatedAt'];
|
||||
|
||||
DateTime get validSince => json['validSince'];
|
||||
|
||||
bool get disabled => json['disabled'];
|
||||
|
||||
DateTime get lastLoginAt => json['lastLoginAt'];
|
||||
|
||||
DateTime get createdAt => json['createdAt'];
|
||||
|
||||
bool get customAuth => json['customAuth'];
|
||||
}
|
||||
|
||||
class ProviderInfo {
|
||||
ProviderInfo(this.providerId, this.federatedId);
|
||||
|
||||
final String providerId, federatedId;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
class PathUtils {
|
||||
PathUtils._();
|
||||
|
||||
static Future<Directory> getDocumentDir() async {
|
||||
if (Platform.isMacOS || Platform.isLinux) {
|
||||
return Directory('${Platform.environment['HOME']}/.config');
|
||||
} else if (Platform.isWindows) {
|
||||
return Directory('${Platform.environment['UserProfile']}\\.config');
|
||||
}
|
||||
return await getApplicationDocumentsDirectory();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export 'data/blocs/blocs.dart';
|
||||
export 'data/classes/index.dart';
|
||||
export 'data/services/auth/auth.dart';
|
||||
export 'data/services/rest_api/client.dart';
|
||||
export 'data/services/rest_api/helpers/index.dart';
|
||||
@@ -0,0 +1,26 @@
|
||||
name: fb_auth
|
||||
description: A Web, Mobile Firebase Auth Plugin
|
||||
version: 1.2.0
|
||||
author: Rody Davis <rody.davis.jr@gmail.com>
|
||||
homepage: https://github.com/rodydavis/fb_auth
|
||||
issue_tracker: https://github.com/rodydavis/plugins/issues
|
||||
maintainer: Rody Davis (@rodydavis)
|
||||
environment:
|
||||
sdk: ">=2.2.2 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
bloc: ^2.0.0
|
||||
firebase: ^6.0.0
|
||||
firebase_auth: ^0.14.0+5
|
||||
flutter:
|
||||
sdk: flutter
|
||||
flutter_bloc: ^2.0.0
|
||||
http: ^0.12.0+2
|
||||
meta: ^1.7.0
|
||||
path_provider: ^1.4.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
flutter: null
|
||||