├── firebase.json
├── functions
├── .gitignore
├── package.json
├── index.js
└── kakao.js
├── test
└── firebase_auth_simplify_test.dart
├── example
├── ios
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ └── .gitignore
├── asset
│ └── icon.png
├── android
│ ├── gradle.properties
│ ├── .gitignore
│ ├── app
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── values
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ └── drawable
│ │ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── build.gradle
├── .metadata
├── README.md
├── .gitignore
├── lib
│ ├── user_credential_provider.dart
│ ├── main.dart
│ ├── landing_page.dart
│ └── login_page.dart
├── test
│ └── widget_test.dart
├── pubspec.yaml
└── pubspec.lock
├── .firebaserc
├── screenshots
├── link.PNG
└── signin.PNG
├── lib
├── src
│ ├── api
│ │ ├── base_auth_api.dart
│ │ ├── firebase_email_auth_api.dart
│ │ ├── firebase_phone_auth_api.dart
│ │ ├── firebase_google_auth_api.dart
│ │ ├── firebase_facebook_auth_api.dart
│ │ ├── firebase_apple_auth_api.dart
│ │ └── firebase_kakao_auth_api.dart
│ └── firebase_auth_provider.dart
└── firebase_auth_simplify.dart
├── .metadata
├── .github
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── pubspec.yaml
├── LICENSE
├── .gitignore
├── CHANGELOG.md
├── pubspec.lock
└── README.md
/firebase.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/functions/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/test/firebase_auth_simplify_test.dart:
--------------------------------------------------------------------------------
1 | void main() {}
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "default": "fir-auth-simplify-28bbc"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/screenshots/link.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/screenshots/link.PNG
--------------------------------------------------------------------------------
/example/asset/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/asset/icon.png
--------------------------------------------------------------------------------
/screenshots/signin.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/screenshots/signin.PNG
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fysoul17/firebase_auth_simplify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/lib/src/api/base_auth_api.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 |
3 | abstract class BaseAuthAPI {
4 | Future signUp();
5 | Future signIn();
6 | Future signOut();
7 | Future linkWith(User user);
8 | Future unlinkFrom(User user);
9 | }
10 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 27321ebbad34b0a3fafe99fac037102196d655ff
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 27321ebbad34b0a3fafe99fac037102196d655ff
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | 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.
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10 | GeneratedPluginRegistrant.registerWith(flutterEngine);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/firebase_auth_simplify.dart:
--------------------------------------------------------------------------------
1 | library firebase_auth_simplify;
2 |
3 | export 'src/firebase_auth_provider.dart';
4 | export 'src/api/base_auth_api.dart';
5 |
6 | export 'src/api/firebase_email_auth_api.dart';
7 | export 'src/api/firebase_google_auth_api.dart';
8 | export 'src/api/firebase_kakao_auth_api.dart';
9 | export 'src/api/firebase_facebook_auth_api.dart';
10 | export 'src/api/firebase_apple_auth_api.dart';
11 | export 'src/api/firebase_phone_auth_api.dart';
12 | export 'package:firebase_auth/firebase_auth.dart';
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/functions/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "functions",
3 | "description": "Cloud Functions for Firebase",
4 | "scripts": {
5 | "serve": "firebase serve --only functions",
6 | "shell": "firebase functions:shell",
7 | "start": "npm run shell",
8 | "deploy": "firebase deploy --only functions",
9 | "logs": "firebase functions:log"
10 | },
11 | "engines": {
12 | "node": "10"
13 | },
14 | "dependencies": {
15 | "firebase-admin": "^8.6.0",
16 | "firebase-functions": "^3.3.0",
17 | "request": "^2.88.0",
18 | "request-promise": "^4.2.5"
19 | },
20 | "devDependencies": {
21 | "firebase-functions-test": "^0.1.6"
22 | },
23 | "private": true
24 | }
25 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Flutter Doctor -v**
27 |
28 | **Additional context**
29 | Add any other context about the problem here.
30 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: firebase_auth_simplify
2 | description: A high-level framework of Firebase Auth package that wraps several lines of codes to one line in order to easily use sign-in and out function.
3 | version: 2.1.1
4 | homepage: https://github.com/fysoul17/firebase_auth_simplify
5 |
6 | environment:
7 | sdk: ">=2.1.0 <3.0.0"
8 |
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 |
13 | firebase_core: ^0.7.0
14 | firebase_auth: ^0.20.0
15 | cloud_functions: ^0.9.0
16 |
17 | provider: ^4.3.1
18 |
19 | google_sign_in: ^4.5.1
20 | kakao_flutter_sdk: ^0.6.0-beta.1
21 | flutter_facebook_login: ^3.0.0
22 | http: ^0.12.0+4 # Used for fetching profiles from Facebook GraphAPI
23 | sign_in_with_apple: ^2.5.4
24 | crypto: ^2.1.5
25 |
26 | dev_dependencies:
27 | flutter_test:
28 | sdk: flutter
29 |
30 | flutter:
31 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | // Add the google services classpath
12 | classpath 'com.google.gms:google-services:4.3.3'
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | google()
19 | jcenter()
20 | }
21 | }
22 |
23 | rootProject.buildDir = '../build'
24 | subprojects {
25 | project.buildDir = "${rootProject.buildDir}/${project.name}"
26 | }
27 | subprojects {
28 | project.evaluationDependsOn(':app')
29 | }
30 |
31 | task clean(type: Delete) {
32 | delete rootProject.buildDir
33 | }
34 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/lib/user_credential_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/foundation.dart';
3 | import 'package:provider/provider.dart';
4 |
5 | class UserCredentialProvider extends ChangeNotifier {
6 | static UserCredentialProvider of(BuildContext context,
7 | {bool listen = true}) =>
8 | Provider.of(context, listen: listen);
9 |
10 | String _email;
11 | String get email => _email;
12 | set email(String email) {
13 | _email = email;
14 | notifyListeners();
15 | }
16 |
17 | String _password;
18 | String get password => _password;
19 | set password(String pw) {
20 | _password = pw;
21 | notifyListeners();
22 | }
23 |
24 | String _phoneNumber;
25 | String get phoneNumber => _phoneNumber;
26 | set phoneNumber(String phoneNumber) {
27 | _phoneNumber = phoneNumber;
28 | notifyListeners();
29 | }
30 |
31 | String _code;
32 | String get code => _code;
33 | set code(String code) {
34 | _code = code;
35 | notifyListeners();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Terry Kwon
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:example/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/functions/index.js:
--------------------------------------------------------------------------------
1 | const functions = require("firebase-functions");
2 | const kakao = require("./kakao");
3 |
4 | const admin = require("firebase-admin");
5 | admin.initializeApp();
6 |
7 | exports.verifyKakaoToken = functions.https.onCall(async (data, context) => {
8 | const token = data.token;
9 | if (!token) return { error: "There is no token provided." };
10 |
11 | console.log(`Verifying Kakao token: ${token}`);
12 |
13 | return kakao
14 | .createFirebaseToken(token)
15 | .then(firebaseToken => {
16 | console.log(`Returning firebase token to user: ${firebaseToken}`);
17 | return { token: firebaseToken };
18 | })
19 | .catch(e => {
20 | return { error: e.message };
21 | });
22 | });
23 |
24 | exports.linkWithKakao = functions.https.onCall(async (data, context) => {
25 | const token = data.token;
26 | if (!token) return { error: "There is no token provided." };
27 |
28 | console.log(`Linking with Kakao token: ${token}`);
29 |
30 | return kakao
31 | .linkToCurrentUser(token, context.auth.uid)
32 | .then(userRecord => {
33 | console.log(`Returning user: ${userRecord}`);
34 | return { userRecord: userRecord };
35 | })
36 | .catch(e => {
37 | return { error: e.message };
38 | });
39 | });
40 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: A new Flutter project.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # In Android, build-name is used as versionName while build-number used as versionCode.
10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 | # Read more about iOS versioning at
13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 | version: 1.0.0+1
15 |
16 | environment:
17 | sdk: ">=2.1.0 <3.0.0"
18 |
19 | dependencies:
20 | flutter:
21 | sdk: flutter
22 |
23 | # The following adds the Cupertino Icons font to your application.
24 | # Use with the CupertinoIcons class for iOS style icons.
25 | cupertino_icons: ^0.1.2
26 |
27 | firebase_auth_simplify:
28 | path: ../
29 |
30 | provider: ^4.0.2
31 |
32 | dev_dependencies:
33 | flutter_test:
34 | sdk: flutter
35 |
36 | # For information on the generic Dart part of this file, see the
37 | # following page: https://dart.dev/tools/pub/pubspec
38 |
39 | # The following section is specific to Flutter.
40 | flutter:
41 | # The following line ensures that the Material Icons font is
42 | # included with your application, so that you can use the icons in
43 | # the material Icons class.
44 | uses-material-design: true
45 |
46 | assets:
47 | - asset/
48 |
--------------------------------------------------------------------------------
/lib/src/api/firebase_email_auth_api.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter/services.dart';
4 | import 'base_auth_api.dart';
5 |
6 | class FirebaseEmailAuthAPI implements BaseAuthAPI {
7 | FirebaseEmailAuthAPI({
8 | @required this.email,
9 | @required this.password,
10 | });
11 |
12 | final String email;
13 | final String password;
14 |
15 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
16 |
17 | @override
18 | Future signUp() async {
19 | print("sign up with $email and $password");
20 | try {
21 | return await _firebaseAuth.createUserWithEmailAndPassword(
22 | email: email, password: password);
23 | } catch (e) {
24 | return Future.error(e);
25 | }
26 | }
27 |
28 | @override
29 | Future signIn() async {
30 | print("sign in with $email and $password");
31 | try {
32 | final authResult = await _firebaseAuth.signInWithEmailAndPassword(
33 | email: email, password: password);
34 | assert(authResult.user.uid == _firebaseAuth.currentUser.uid);
35 |
36 | return authResult;
37 | } catch (e) {
38 | return Future.error(e);
39 | }
40 | }
41 |
42 | @override
43 | Future signOut() {
44 | return _firebaseAuth.signOut();
45 | }
46 |
47 | @override
48 | Future linkWith(User user) {
49 | throw PlatformException(
50 | code: "UNSUPPORTED_FUNCTION",
51 | message: "e-mail sign-in does not support linking and unlinking");
52 | }
53 |
54 | @override
55 | Future unlinkFrom(User user) async {
56 | throw PlatformException(
57 | code: "UNSUPPORTED_FUNCTION",
58 | message: "e-mail sign-in does not support linking and unlinking");
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
76 | example/android/app/google-services.json
77 | example/android/app/src/main/res/values/kakao_strings.xml
78 | example/android/app/src/main/res/values/strings.xml
79 | example/ios/Runner/Info.plist
80 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:kakao_flutter_sdk/auth.dart';
4 |
5 | import 'package:firebase_core/firebase_core.dart';
6 | import 'package:firebase_auth/firebase_auth.dart';
7 | import 'package:provider/provider.dart';
8 |
9 | import 'login_page.dart';
10 | import 'landing_page.dart';
11 | import 'user_credential_provider.dart';
12 |
13 | void main() async {
14 | WidgetsFlutterBinding.ensureInitialized();
15 |
16 | KakaoContext.clientId = "YOUR_NATIVE_APP_KEY";
17 |
18 | await Firebase.initializeApp();
19 |
20 | runApp(MyApp());
21 | }
22 |
23 | class MyApp extends StatelessWidget {
24 | @override
25 | Widget build(BuildContext context) {
26 | return MaterialApp(
27 | title: 'Flutter Demo',
28 | theme: ThemeData(
29 | primarySwatch: Colors.blue,
30 | ),
31 | home: AppPage(),
32 | );
33 | }
34 | }
35 |
36 | class AppPage extends StatelessWidget {
37 | @override
38 | Widget build(BuildContext context) {
39 | print(">>> Build [App] Page");
40 |
41 | return Scaffold(
42 | appBar: AppBar(title: Text("Firebase Auth Example")),
43 | body: _buildBody(),
44 | );
45 | }
46 |
47 | Widget _buildBody() {
48 | return StreamBuilder(
49 | stream: FirebaseAuth.instance.authStateChanges(),
50 | builder: (_, snapshot) {
51 | if (snapshot.connectionState == ConnectionState.active) {
52 | if (snapshot.data == null) {
53 | return ChangeNotifierProvider(
54 | create: (_) => UserCredentialProvider(),
55 | child: LoginPage(),
56 | );
57 | } else {
58 | return ChangeNotifierProvider(
59 | create: (_) => UserCredentialProvider(),
60 | child: LandingPage(),
61 | );
62 | }
63 | } else {
64 | return _buildLoadingIndicator();
65 | }
66 | },
67 | );
68 | }
69 |
70 | Widget _buildLoadingIndicator() {
71 | return Center(
72 | child: SizedBox(
73 | child: CircularProgressIndicator(),
74 | height: 25,
75 | width: 25,
76 | ),
77 | );
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | // Add this line for google services
26 | apply plugin: 'com.google.gms.google-services'
27 |
28 | apply plugin: 'kotlin-android'
29 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
30 |
31 | android {
32 | compileSdkVersion 28
33 |
34 | sourceSets {
35 | main.java.srcDirs += 'src/main/kotlin'
36 | }
37 |
38 | lintOptions {
39 | disable 'InvalidPackage'
40 | }
41 |
42 | defaultConfig {
43 | applicationId "com.gixgames.app.flutter.firebaseauthsimplify"
44 | minSdkVersion 21
45 | targetSdkVersion 28
46 | versionCode flutterVersionCode.toInteger()
47 | versionName flutterVersionName
48 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
49 | }
50 |
51 | buildTypes {
52 | release {
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
64 | implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
65 | testImplementation 'junit:junit:4.12'
66 | androidTestImplementation 'androidx.test:runner:1.1.1'
67 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
68 | }
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
9 |
10 |
14 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
44 |
45 |
49 |
50 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/lib/src/api/firebase_phone_auth_api.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:flutter/services.dart';
3 | import 'base_auth_api.dart';
4 |
5 | class FirebasePhoneAuthAPI implements BaseAuthAPI {
6 | FirebasePhoneAuthAPI();
7 |
8 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
9 |
10 | AuthCredential _credential;
11 | String _verificationId;
12 |
13 | Future verifyNumber(String phoneNumber,
14 | {bool signInOnAutoRetrieval = true,
15 | int timeoutSeconds = 30,
16 | PhoneCodeSent codeSent,
17 | PhoneCodeAutoRetrievalTimeout codeAutoRetrievalTimeout,
18 | PhoneVerificationCompleted verificationCompleted,
19 | PhoneVerificationFailed verificationFailed}) async {
20 | assert(phoneNumber != null && phoneNumber.length > 1);
21 |
22 | _firebaseAuth.verifyPhoneNumber(
23 | phoneNumber: phoneNumber,
24 | timeout: Duration(seconds: timeoutSeconds),
25 | codeSent: (String verificationId, [int forceResendingToken]) {
26 | _verificationId = verificationId;
27 |
28 | codeSent(verificationId, forceResendingToken);
29 | },
30 | codeAutoRetrievalTimeout: (String verificationId) {
31 | _verificationId = verificationId;
32 |
33 | codeAutoRetrievalTimeout(verificationId);
34 | },
35 | verificationCompleted: (AuthCredential phoneAuthCredential) {
36 | _credential = phoneAuthCredential;
37 |
38 | verificationCompleted(phoneAuthCredential);
39 | if (signInOnAutoRetrieval) {
40 | signIn();
41 | }
42 | },
43 | verificationFailed: (FirebaseAuthException error) {
44 | print(error.code);
45 | print(error.message);
46 |
47 | verificationFailed(error);
48 | },
49 | );
50 | }
51 |
52 | AuthCredential submitVerificationCode(String code) {
53 | assert(_verificationId != null);
54 | assert(code != null && code.length == 6);
55 |
56 | _credential = PhoneAuthProvider.credential(
57 | verificationId: _verificationId,
58 | smsCode: code,
59 | );
60 |
61 | return _credential;
62 | }
63 |
64 | @override
65 | Future signUp() async {
66 | throw PlatformException(
67 | code: "UNSUPPORTED_FUNCTION",
68 | message: "Phone Signin does not need sign up.");
69 | }
70 |
71 | @override
72 | Future signIn() async {
73 | try {
74 | UserCredential result =
75 | await _firebaseAuth.signInWithCredential(_credential);
76 | assert(result.user.uid == _firebaseAuth.currentUser.uid);
77 | return result;
78 | } catch (e) {
79 | return Future.error(e);
80 | }
81 | }
82 |
83 | @override
84 | Future signOut() {
85 | return _firebaseAuth.signOut();
86 | }
87 |
88 | @override
89 | Future linkWith(User user) async {
90 | try {
91 | return (await user.linkWithCredential(_credential)).user;
92 | } catch (e) {
93 | return Future.error(e);
94 | }
95 | }
96 |
97 | @override
98 | Future unlinkFrom(User user) async {
99 | try {
100 | await user.unlink("phone");
101 | } catch (e) {
102 | throw Future.error(e);
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/lib/src/api/firebase_google_auth_api.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:firebase_auth_simplify/src/api/base_auth_api.dart';
3 | import 'package:flutter/services.dart';
4 | import 'package:google_sign_in/google_sign_in.dart';
5 |
6 | class FirebaseGoogleAuthAPI implements BaseAuthAPI {
7 | FirebaseGoogleAuthAPI({this.scopes});
8 |
9 | final List scopes;
10 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
11 | GoogleSignIn _googleSignIn;
12 | GoogleSignInAccount account;
13 |
14 | @override
15 | Future signIn() async {
16 | try {
17 | final authResult =
18 | await _firebaseAuth.signInWithCredential(await _getCredential());
19 | assert(authResult.user.uid == _firebaseAuth.currentUser.uid);
20 |
21 | // When sign in is done, update email info.
22 | await authResult.user.updateEmail(account.email);
23 |
24 | return authResult;
25 | } catch (e) {
26 | return Future.error(e);
27 | }
28 | }
29 |
30 | Future _getCredential() async {
31 | try {
32 | _googleSignIn =
33 | scopes == null ? GoogleSignIn() : GoogleSignIn(scopes: scopes);
34 |
35 | // NOTE: signIn() does the work automatically.
36 | // GoogleSignInAccount account = await _googleSignIn.signInSilently();
37 |
38 | // NOTE: In debug mode, it will throw an exception when user cancel the sign in process, even if it just have to give us 'null'.
39 | // It is a VM debugger issue which doesn't correctly detects it.
40 | // Do not bother for having unhandled exception in debug mode. It will work on release mode. Just check if it is null for user canceled action.
41 | //
42 | // More info: https://github.com/flutter/flutter/issues/26705#issuecomment-507791687
43 | account = await _googleSignIn.signIn();
44 |
45 | // User canceld.
46 | if (account == null) return null;
47 |
48 | final GoogleSignInAuthentication auth = await account.authentication;
49 | return GoogleAuthProvider.credential(
50 | accessToken: auth.accessToken,
51 | idToken: auth.idToken,
52 | );
53 | } catch (e) {
54 | return Future.error(e);
55 | }
56 | }
57 |
58 | /// Google API does not need sign up.
59 | @override
60 | Future signUp() {
61 | throw PlatformException(
62 | code: "UNSUPPORTED_FUNCTION",
63 | message: "Google Signin does not need sign up.");
64 | }
65 |
66 | @override
67 | Future signOut() {
68 | _googleSignIn ??= GoogleSignIn();
69 | return _googleSignIn.signOut();
70 | }
71 |
72 | @override
73 | Future linkWith(User user) async {
74 | try {
75 | /// NOTE: As mentioned above in _getCredential function, we cannot catch exception here. Need to wait for google_sign package to solve this issue (or dart team).
76 | /// This only happens in Debug mode.
77 | return (await user.linkWithCredential(await _getCredential())).user;
78 | } catch (e) {
79 | if (_googleSignIn != null) _googleSignIn.signOut();
80 | return Future.error(e);
81 | }
82 | }
83 |
84 | @override
85 | Future unlinkFrom(User user) async {
86 | try {
87 | await user.unlink("google.com");
88 | } catch (e) {
89 | throw Future.error(e);
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 | KAKAO_APP_KEY
46 | afb19754a1d9f6ffd3441ad737c39311
47 |
48 | LSApplicationQueriesSchemes
49 |
50 | kakaoafb19754a1d9f6ffd3441ad737c39311
51 | kakaokompassauth
52 | storykompassauth
53 | kakaolink
54 | kakaotalk-5.9.7
55 |
56 |
57 | CFBundleURLTypes
58 |
59 |
64 |
65 | CFBundleTypeRole
66 | Editor
67 | CFBundleURLName
68 |
69 | CFBundleURLSchemes
70 |
71 | kakao0123456789abcdefghijklmn
72 |
73 |
74 |
75 | CFBundleURLSchemes
76 |
77 |
81 | fb479673482974182
82 |
83 |
84 |
85 |
86 | FacebookAppID
87 |
88 |
89 | 479673482974182
90 | FacebookDisplayName
91 |
92 |
93 | Flutter Firebase Auth Simplify
94 |
95 | LSApplicationQueriesSchemes
96 |
97 | fbapi
98 | fb-messenger-share-api
99 | fbauth2
100 | fbshareextension
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/lib/src/api/firebase_facebook_auth_api.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'package:firebase_auth/firebase_auth.dart';
4 | import 'package:flutter/services.dart';
5 | import 'package:flutter_facebook_login/flutter_facebook_login.dart';
6 | import 'package:http/http.dart' as http;
7 |
8 | import 'base_auth_api.dart';
9 |
10 | class FirebaseFacebookAuthAPI implements BaseAuthAPI {
11 | FirebaseFacebookAuthAPI({
12 | this.webViewOnly = false,
13 | });
14 |
15 | final bool webViewOnly;
16 |
17 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
18 |
19 | FacebookLogin _facebookLogin = FacebookLogin();
20 |
21 | String token;
22 |
23 | @override
24 | Future signIn() async {
25 | try {
26 | final authResult =
27 | await _firebaseAuth.signInWithCredential(await _getCredential());
28 | assert(authResult.user.uid == _firebaseAuth.currentUser.uid);
29 |
30 | // When sign in is done, update email info.
31 | final graphResponse = await http.get(
32 | 'https://graph.facebook.com/v2.12/me?fields=email&access_token=$token');
33 | final profile = jsonDecode(graphResponse.body);
34 |
35 | if (profile['email'] == null) {
36 | throw PlatformException(
37 | code: "EMAIL_NOT_PROVIDED",
38 | message: "e-mail must be provided to use the app.");
39 | }
40 |
41 | await authResult.user.updateEmail(profile['email']);
42 |
43 | return authResult;
44 | } catch (e) {
45 | print(e);
46 | return Future.error(e);
47 | }
48 | }
49 |
50 | Future _getCredential() async {
51 | final FacebookLoginResult result = await _signInProvider();
52 |
53 | if (result.status == FacebookLoginStatus.cancelledByUser) {
54 | return Future.error(PlatformException(
55 | code: "FACEBOOK_CANCELLED_BY_USER",
56 | message: "Facebook sign-in is cancelled by user."));
57 | } else if (result.status == FacebookLoginStatus.error) {
58 | return Future.error(PlatformException(
59 | code: "FACEBOOK_SIGN_IN_FAILED", message: result.errorMessage));
60 | }
61 |
62 | token = result.accessToken.token;
63 |
64 | return FacebookAuthProvider.credential(token);
65 | }
66 |
67 | Future _signInProvider() async {
68 | if (webViewOnly) {
69 | _facebookLogin.loginBehavior = FacebookLoginBehavior.webViewOnly;
70 | }
71 |
72 | return await _facebookLogin.logIn(['email']);
73 | }
74 |
75 | @override
76 | Future signOut() {
77 | _facebookLogin ??= FacebookLogin();
78 | return _facebookLogin.logOut();
79 | }
80 |
81 | @override
82 | Future linkWith(User user) async {
83 | try {
84 | return (await user.linkWithCredential(await _getCredential())).user;
85 | } catch (e) {
86 | if (_facebookLogin != null) _facebookLogin.logOut();
87 | return Future.error(e);
88 | }
89 | }
90 |
91 | /// Facebook API does not need sign up.
92 | @override
93 | Future signUp() {
94 | throw PlatformException(
95 | code: "UNSUPPORTED_FUNCTION",
96 | message: "Facebook Signin does not need sign up.");
97 | }
98 |
99 | @override
100 | Future unlinkFrom(User user) async {
101 | try {
102 | await user.unlink("facebook.com");
103 | } catch (e) {
104 | throw Future.error(e);
105 | }
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/lib/src/api/firebase_apple_auth_api.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 | import 'dart:convert';
3 | import 'dart:io';
4 |
5 | import 'package:flutter/services.dart';
6 |
7 | import 'package:firebase_auth/firebase_auth.dart';
8 | import 'package:firebase_auth_simplify/src/api/base_auth_api.dart';
9 | import 'package:crypto/crypto.dart';
10 | import 'package:sign_in_with_apple/sign_in_with_apple.dart';
11 |
12 | class FirebaseAppleAuthAPI implements BaseAuthAPI {
13 | FirebaseAppleAuthAPI({
14 | this.scopes,
15 | this.webAuthOptions,
16 | });
17 |
18 | final List scopes;
19 | final WebAuthenticationOptions webAuthOptions;
20 |
21 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
22 |
23 | @override
24 | Future signIn() async {
25 | try {
26 | final authResult = await _firebaseAuth.signInWithCredential(await _getCredential());
27 | assert(authResult.user.uid == _firebaseAuth.currentUser.uid);
28 |
29 | // When sign in is done, update email info.
30 | await authResult.user.updateEmail(authResult.user.email);
31 |
32 | return authResult;
33 | } catch (e) {
34 | return Future.error(e);
35 | }
36 | }
37 |
38 | Future _getCredential() async {
39 | try {
40 | final _scopes = scopes ??
41 | [
42 | AppleIDAuthorizationScopes.email,
43 | AppleIDAuthorizationScopes.fullName,
44 | ];
45 |
46 | final nonce = _createNonce(32);
47 | final nativeAppleCred = Platform.isIOS
48 | ? await SignInWithApple.getAppleIDCredential(
49 | scopes: _scopes,
50 | nonce: sha256.convert(utf8.encode(nonce)).toString(),
51 | )
52 | : await SignInWithApple.getAppleIDCredential(
53 | scopes: _scopes,
54 | webAuthenticationOptions: webAuthOptions,
55 | nonce: sha256.convert(utf8.encode(nonce)).toString(),
56 | );
57 |
58 | final credential = OAuthCredential(
59 | providerId: "apple.com", // MUST be "apple.com"
60 | signInMethod: "oauth", // MUST be "oauth"
61 | accessToken: nativeAppleCred.identityToken, // propagate Apple ID token to BOTH accessToken and idToken parameters
62 | idToken: nativeAppleCred.identityToken,
63 | rawNonce: nonce,
64 | );
65 |
66 | return credential;
67 | } catch (e) {
68 | return Future.error(e);
69 | }
70 | }
71 |
72 | String _createNonce(int length) {
73 | final random = Random();
74 | final charCodes = List.generate(length, (_) {
75 | int codeUnit;
76 |
77 | switch (random.nextInt(3)) {
78 | case 0:
79 | codeUnit = random.nextInt(10) + 48;
80 | break;
81 | case 1:
82 | codeUnit = random.nextInt(26) + 65;
83 | break;
84 | case 2:
85 | codeUnit = random.nextInt(26) + 97;
86 | break;
87 | }
88 |
89 | return codeUnit;
90 | });
91 |
92 | return String.fromCharCodes(charCodes);
93 | }
94 |
95 | /// Apple API does not need sign up.
96 | @override
97 | Future signUp() {
98 | throw PlatformException(code: "UNSUPPORTED_FUNCTION", message: "Apple Signin does not need sign up.");
99 | }
100 |
101 | @override
102 | Future signOut() {
103 | return Future.value();
104 | }
105 |
106 | @override
107 | Future linkWith(User user) async {
108 | try {
109 | return (await user.linkWithCredential(await _getCredential())).user;
110 | } catch (e) {
111 | return Future.error(e);
112 | }
113 | }
114 |
115 | @override
116 | Future unlinkFrom(User user) async {
117 | try {
118 | await user.unlink("apple.com");
119 | } catch (e) {
120 | throw Future.error(e);
121 | }
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [2.1.1] - 27/Jan/2021
2 |
3 | - Removed firebase analytics
4 |
5 | ## [2.1.0] - 26/Jan/2021
6 |
7 | - Updated firebase versions and Kakao SDK.
8 |
9 | ## [2.0.5] - 24/Nov/2020
10 |
11 | - Added emailRequired parameter for Kakao Login. Setting true will force Kakao sign-in to have email.
12 |
13 | ## [2.0.4] - 24/Nov/2020
14 |
15 | - Removed debug print.
16 |
17 | ## [2.0.3] - 24/Nov/2020
18 |
19 | - Kakao bug fix.
20 |
21 | ## [2.0.2] - 24/Nov/2020
22 |
23 | - Added await for other login methods' email updates.
24 |
25 | ## [2.0.1] - 23/Nov/2020
26 |
27 | - Fixed bug by adding await as updating email from Kakao login was not respecting 'Future' return.
28 |
29 | ## [2.0.0] - 10/Nov/2020
30 |
31 | - Refactored to allow new verison of firebase packages as the firebase core version has critical changes since version 0.5.0
32 |
33 | ## [1.3.0] - 05/Oct/2020
34 |
35 | - Update kaka_flutter_sdk version to support Flutter 1.22.0 error
36 |
37 | ## [1.2.0] - 25/Sep/2020
38 |
39 | - Supporting Apple sign in.
40 |
41 | ## [1.1.2] - 13/Aug/2020
42 |
43 | - Removed codes that uses existing token for Kakao login.
44 |
45 | ## [1.1.1] - 12/Aug/2020
46 |
47 | - Reverted retrieveToken() function to private. We can use AccessTokenStore.instance.fromStore() to fetch access token after logged in.
48 |
49 | ## [1.1.0] - 12/Aug/2020
50 |
51 | - Made retrieveToken() function public so that we can use it for other Kakao APIs.
52 |
53 | ## [1.0.0] - 11/Aug/2020
54 |
55 | - Switched Kakao SDK to the official package.
56 |
57 | ## [0.6.4] - 29/Jul/2020
58 |
59 | - Added exception code on missing email for facebook auth.
60 |
61 | ## [0.6.3] - 29/Jul/2020
62 |
63 | - Fixed typo of Kakao exception code.
64 |
65 | ## [0.6.2] - 20/Jul/2020
66 |
67 | - Updated fierbase pacakge versions.
68 |
69 | ## [0.6.1] - 21/Apr/2020
70 |
71 | - Updated getUserClaim() function to check null on user data.
72 |
73 | ## [0.6.0] - 20/Apr/2020
74 |
75 | - Added unlink feature.
76 |
77 | ## [0.5.0] - 15/Apr/2020
78 |
79 | - Fixed 'com.google.firebase.messaging.FirebaseMessagingService is inaccessible' erorr by updating firebase_auth package version.
80 |
81 | ## [0.4.4] - 2/Feb/2020
82 |
83 | - Bug Fix.
84 |
85 | ## [0.4.3] - 1/Feb/2020
86 |
87 | - Update document
88 |
89 | ## [0.4.2] - 30/Jan/2020
90 |
91 | - Added information about app crash regarding Facebook package issue
92 |
93 | ## [0.4.1] - 30/Jan/2020
94 |
95 | - Added example screenshots
96 |
97 | ## [0.4.0] - 29/Jan/2020
98 |
99 | - Added Phone authentication
100 | - Added Phone authentication example
101 | - Added assertion for sign-in logic
102 |
103 | ## [0.3.3] - 29/Jan/2020
104 |
105 | - Fixed bug that Kakao sign-in links automatically with existing e-mail. It will throw an error and only can be linked by using link function.
106 | - Kakao sign-in will throw a new exception in regards to above issue.
107 | - Added try-catch block for email authentication. It will now catch error correctly.
108 | - Fixed bug at example code. It will now trim the white space before sending to the server.
109 | - Fixed bug at example code. Sign-in/out dialog will be disappear as expected when sign-in/out is succeeded.
110 |
111 | ## [0.3.2] - 29/Jan/2020
112 |
113 | - Minor bug fix
114 |
115 | ## [0.3.1] - 29/Jan/2020
116 |
117 | - Added getUserClaim function so that we can get claim data from provider
118 | - Changed logic of signing-out from 3rd party providers
119 |
120 | ## [0.3.0] - 28/Jan/2020
121 |
122 | - Updated cloud function for verifiying/creating Kakao token
123 | - Changed logic of Kakao sign in
124 | - Refactoring Kakao sign in
125 | - Refactoring other sign ins
126 | - Added linking function
127 | - Made email and password as a required field
128 |
129 | ## [0.2.0] - 27/Jan/2020
130 |
131 | - Supporting Facebook sign in
132 |
133 | ## [0.1.0] - 27/Jan/2020
134 |
135 | - Supporting Kakao sign in
136 |
137 | ## [0.0.1] - 25/Jan/2020
138 |
139 | - Initial release with Firebase email and Gmail support
140 |
--------------------------------------------------------------------------------
/lib/src/firebase_auth_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:firebase_auth_simplify/firebase_auth_simplify.dart';
3 | import 'package:firebase_auth_simplify/src/api/base_auth_api.dart';
4 |
5 | class FirebaseAuthProvider {
6 | /// Private constructor
7 | FirebaseAuthProvider._();
8 |
9 | /// Provides an instance of this class
10 | static final FirebaseAuthProvider instance = FirebaseAuthProvider._();
11 |
12 | final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
13 |
14 | Stream get onAuthStateChanged => _firebaseAuth.authStateChanges();
15 |
16 | User currentUser() {
17 | return _firebaseAuth.currentUser;
18 | }
19 |
20 | Future