├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ ├── google-services.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── firebase_auth_demo │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── 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-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── firebase_app_id_file.json ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── settings.gradle ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── 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-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GoogleService-Info.plist │ ├── Info.plist │ └── Runner-Bridging-Header.h └── firebase_app_id_file.json ├── lib ├── firebase_options.dart ├── main.dart ├── screens │ ├── home_screen.dart │ ├── login_email_password_screen.dart │ ├── login_screen.dart │ ├── phone_screen.dart │ └── signup_email_password_screen.dart ├── services │ └── firebase_auth_methods.dart ├── utils │ ├── showOtpDialog.dart │ └── showSnackbar.dart └── widgets │ ├── custom_button.dart │ └── custom_textfield.dart ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Podfile ├── Podfile.lock ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements └── firebase_app_id_file.json ├── pubspec.lock ├── pubspec.yaml ├── screenshot.jpg ├── test └── widget_test.dart ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.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 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /.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: 7e9793dee1b85a243edd0e06cb1658e98b077561 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter Firebase Auth Demo 2 | 3 | Flutter + Firebase Auth Demo App that uses Google, Facebook, Email/Password Signup/Login, Email Verification and more! 4 | 5 | ## Features 6 | - Email/Password Signup 7 | - Email/Password Login 8 | - Email Verification 9 | - Google Sign In 10 | - Facebook Sign In 11 | - Phone Sign In 12 | 13 | ## YouTube 14 | I have created a tutorial based on this, do check it out on my channel [Rivaan Ranawat](https://youtu.be/u8H652UY-L8) 15 | 16 |

17 | Youtube Tutorial Image 18 |

19 | 20 | ## Feedback 21 | 22 | If you have any feedback, please reach out to me at namanrivaan@gmail.com or on Instagram at optimalcoding. 23 | 24 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /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 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.firebase_auth_demo" 47 | minSdkVersion 21 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | multiDexEnabled true 52 | } 53 | 54 | buildTypes { 55 | release { 56 | // TODO: Add your own signing config for the release build. 57 | // Signing with the debug keys for now, so `flutter run --release` works. 58 | signingConfig signingConfigs.debug 59 | } 60 | } 61 | } 62 | 63 | flutter { 64 | source '../..' 65 | } 66 | 67 | dependencies { 68 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 69 | } 70 | -------------------------------------------------------------------------------- /android/app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "599030350718", 4 | "project_id": "fir-auth-demo-ec48c", 5 | "storage_bucket": "fir-auth-demo-ec48c.appspot.com" 6 | }, 7 | "client": [ 8 | { 9 | "client_info": { 10 | "mobilesdk_app_id": "1:599030350718:android:bff62dc1dc7685abb6292f", 11 | "android_client_info": { 12 | "package_name": "com.example.firebase_auth_demo" 13 | } 14 | }, 15 | "oauth_client": [ 16 | { 17 | "client_id": "599030350718-9mv5oeembdgpfappbvv29bk0b35eilb4.apps.googleusercontent.com", 18 | "client_type": 1, 19 | "android_info": { 20 | "package_name": "com.example.firebase_auth_demo", 21 | "certificate_hash": "9b0130d7f8e1680cda2341fd2d5d4c923ee5aec1" 22 | } 23 | }, 24 | { 25 | "client_id": "599030350718-bp2hrnft0up7334m5135n1eq4ks0ij7g.apps.googleusercontent.com", 26 | "client_type": 3 27 | } 28 | ], 29 | "api_key": [ 30 | { 31 | "current_key": "AIzaSyB1CD3E2g-zmUoWqK1Le_RNEpPbpb5TrDc" 32 | } 33 | ], 34 | "services": { 35 | "appinvite_service": { 36 | "other_platform_oauth_client": [ 37 | { 38 | "client_id": "599030350718-bp2hrnft0up7334m5135n1eq4ks0ij7g.apps.googleusercontent.com", 39 | "client_type": 3 40 | }, 41 | { 42 | "client_id": "599030350718-rt5diuiggpna5fmco6k05teqm2km0f66.apps.googleusercontent.com", 43 | "client_type": 2, 44 | "ios_info": { 45 | "bundle_id": "com.example.firebaseAuthDemo" 46 | } 47 | } 48 | ] 49 | } 50 | } 51 | } 52 | ], 53 | "configuration_version": "1" 54 | } -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 16 | 19 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 42 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | 57 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/firebase_auth_demo/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.firebase_auth_demo 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Firebase Auth Demo 4 | 1129634001214960 5 | fb1129634001214960 6 | 14938167ac2897e38652822cd91f5b8d 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/firebase_app_id_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_generated_by": "FlutterFire CLI", 3 | "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", 4 | "GOOGLE_APP_ID": "1:599030350718:android:bff62dc1dc7685abb6292f", 5 | "FIREBASE_PROJECT_ID": "fir-auth-demo-ec48c", 6 | "GCM_SENDER_ID": "599030350718" 7 | } -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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-6.7-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AppAuth (1.5.0): 3 | - AppAuth/Core (= 1.5.0) 4 | - AppAuth/ExternalUserAgent (= 1.5.0) 5 | - AppAuth/Core (1.5.0) 6 | - AppAuth/ExternalUserAgent (1.5.0): 7 | - AppAuth/Core 8 | - FBAEMKit (13.0.0): 9 | - FBSDKCoreKit_Basics (= 13.0.0) 10 | - FBSDKCoreKit (13.0.0): 11 | - FBAEMKit (= 13.0.0) 12 | - FBSDKCoreKit_Basics (= 13.0.0) 13 | - FBSDKCoreKit_Basics (13.0.0) 14 | - FBSDKLoginKit (13.0.0): 15 | - FBSDKCoreKit (= 13.0.0) 16 | - Firebase/Auth (8.14.0): 17 | - Firebase/CoreOnly 18 | - FirebaseAuth (~> 8.14.0) 19 | - Firebase/CoreOnly (8.14.0): 20 | - FirebaseCore (= 8.14.0) 21 | - firebase_auth (3.3.12): 22 | - Firebase/Auth (= 8.14.0) 23 | - firebase_core 24 | - Flutter 25 | - firebase_core (1.14.0): 26 | - Firebase/CoreOnly (= 8.14.0) 27 | - Flutter 28 | - FirebaseAuth (8.14.0): 29 | - FirebaseCore (~> 8.0) 30 | - GoogleUtilities/AppDelegateSwizzler (~> 7.7) 31 | - GoogleUtilities/Environment (~> 7.7) 32 | - GTMSessionFetcher/Core (~> 1.5) 33 | - FirebaseCore (8.14.0): 34 | - FirebaseCoreDiagnostics (~> 8.0) 35 | - GoogleUtilities/Environment (~> 7.7) 36 | - GoogleUtilities/Logger (~> 7.7) 37 | - FirebaseCoreDiagnostics (8.14.0): 38 | - GoogleDataTransport (~> 9.1) 39 | - GoogleUtilities/Environment (~> 7.7) 40 | - GoogleUtilities/Logger (~> 7.7) 41 | - nanopb (~> 2.30908.0) 42 | - Flutter (1.0.0) 43 | - flutter_facebook_auth (4.1.2): 44 | - FBSDKCoreKit (~> 13.0.0) 45 | - FBSDKLoginKit (~> 13.0.0) 46 | - Flutter 47 | - google_sign_in (0.0.1): 48 | - Flutter 49 | - GoogleSignIn (~> 5.0) 50 | - GoogleDataTransport (9.1.2): 51 | - GoogleUtilities/Environment (~> 7.2) 52 | - nanopb (~> 2.30908.0) 53 | - PromisesObjC (< 3.0, >= 1.2) 54 | - GoogleSignIn (5.0.2): 55 | - AppAuth (~> 1.2) 56 | - GTMAppAuth (~> 1.0) 57 | - GTMSessionFetcher/Core (~> 1.1) 58 | - GoogleUtilities/AppDelegateSwizzler (7.7.0): 59 | - GoogleUtilities/Environment 60 | - GoogleUtilities/Logger 61 | - GoogleUtilities/Network 62 | - GoogleUtilities/Environment (7.7.0): 63 | - PromisesObjC (< 3.0, >= 1.2) 64 | - GoogleUtilities/Logger (7.7.0): 65 | - GoogleUtilities/Environment 66 | - GoogleUtilities/Network (7.7.0): 67 | - GoogleUtilities/Logger 68 | - "GoogleUtilities/NSData+zlib" 69 | - GoogleUtilities/Reachability 70 | - "GoogleUtilities/NSData+zlib (7.7.0)" 71 | - GoogleUtilities/Reachability (7.7.0): 72 | - GoogleUtilities/Logger 73 | - GTMAppAuth (1.2.3): 74 | - AppAuth/Core (~> 1.4) 75 | - GTMSessionFetcher/Core (~> 1.5) 76 | - GTMSessionFetcher/Core (1.7.1) 77 | - nanopb (2.30908.0): 78 | - nanopb/decode (= 2.30908.0) 79 | - nanopb/encode (= 2.30908.0) 80 | - nanopb/decode (2.30908.0) 81 | - nanopb/encode (2.30908.0) 82 | - PromisesObjC (2.0.0) 83 | 84 | DEPENDENCIES: 85 | - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) 86 | - firebase_core (from `.symlinks/plugins/firebase_core/ios`) 87 | - Flutter (from `Flutter`) 88 | - flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`) 89 | - google_sign_in (from `.symlinks/plugins/google_sign_in/ios`) 90 | 91 | SPEC REPOS: 92 | trunk: 93 | - AppAuth 94 | - FBAEMKit 95 | - FBSDKCoreKit 96 | - FBSDKCoreKit_Basics 97 | - FBSDKLoginKit 98 | - Firebase 99 | - FirebaseAuth 100 | - FirebaseCore 101 | - FirebaseCoreDiagnostics 102 | - GoogleDataTransport 103 | - GoogleSignIn 104 | - GoogleUtilities 105 | - GTMAppAuth 106 | - GTMSessionFetcher 107 | - nanopb 108 | - PromisesObjC 109 | 110 | EXTERNAL SOURCES: 111 | firebase_auth: 112 | :path: ".symlinks/plugins/firebase_auth/ios" 113 | firebase_core: 114 | :path: ".symlinks/plugins/firebase_core/ios" 115 | Flutter: 116 | :path: Flutter 117 | flutter_facebook_auth: 118 | :path: ".symlinks/plugins/flutter_facebook_auth/ios" 119 | google_sign_in: 120 | :path: ".symlinks/plugins/google_sign_in/ios" 121 | 122 | SPEC CHECKSUMS: 123 | AppAuth: 80317d99ac7ff2801a2f18ff86b48cd315ed465d 124 | FBAEMKit: 11a0bcdc7a88e26ed764bcf56372afc6cbbbdcd9 125 | FBSDKCoreKit: 00e1e751257e1005304fa29cb683d2dfe008f41a 126 | FBSDKCoreKit_Basics: 96ec2ddb67a032e54f0754ea3d59db6f84f42389 127 | FBSDKLoginKit: 66ff4ddf372d9c3fc360e65ae048a47a482c29b9 128 | Firebase: 7e8fe528c161b9271d365217a74c16aaf834578e 129 | firebase_auth: 363370737d33bad09a838cd109f7589bc48533cd 130 | firebase_core: b0b382f1497ab407aceb25e41e3036c8798c1609 131 | FirebaseAuth: c5fde343630090253d3af7e2d35697b414b40202 132 | FirebaseCore: b84a44ee7ba999e0f9f76d198a9c7f60a797b848 133 | FirebaseCoreDiagnostics: fd0c8490f34287229c1d6c103d3a55f81ec85712 134 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a 135 | flutter_facebook_auth: c0a8473f857cf44b0a27bfe752facf1d5fedd863 136 | google_sign_in: f669f45933dad48cd218dc3e189726bced3d19f4 137 | GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940 138 | GoogleSignIn: 7137d297ddc022a7e0aa4619c86d72c909fa7213 139 | GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1 140 | GTMAppAuth: 987526d41b07efb1bedda5e936fe0cb718a03113 141 | GTMSessionFetcher: 4577a4cc914a5a07c40a8a0ad0acc22080418c2d 142 | nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 143 | PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58 144 | 145 | PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d 146 | 147 | COCOAPODS: 1.11.2 148 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 5A44924187159490FEAC3CFF /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C3F728CDB90BC6FE40710E3 /* Pods_Runner.framework */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 7E4F6F7228006AC600579975 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 7E4F6F7128006AC600579975 /* GoogleService-Info.plist */; }; 15 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 16 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 17 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXCopyFilesBuildPhase section */ 21 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 22 | isa = PBXCopyFilesBuildPhase; 23 | buildActionMask = 2147483647; 24 | dstPath = ""; 25 | dstSubfolderSpec = 10; 26 | files = ( 27 | ); 28 | name = "Embed Frameworks"; 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXCopyFilesBuildPhase section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 17766C3D76DD5E5013D6F249 /* 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 = ""; }; 37 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 38 | 3C3F728CDB90BC6FE40710E3 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 40 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 41 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 42 | 7E4F6F7128006AC600579975 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 43 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 44 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 45 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 47 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 48 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 49 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | AB82943AF787B74C5C4F731E /* 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 = ""; }; 51 | DF11F9BB05E7D28E7ADFB065 /* 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 = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 5A44924187159490FEAC3CFF /* Pods_Runner.framework in Frameworks */, 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | 0F9483635D3E6C6DBD1B9CF5 /* Pods */ = { 67 | isa = PBXGroup; 68 | children = ( 69 | DF11F9BB05E7D28E7ADFB065 /* Pods-Runner.debug.xcconfig */, 70 | 17766C3D76DD5E5013D6F249 /* Pods-Runner.release.xcconfig */, 71 | AB82943AF787B74C5C4F731E /* Pods-Runner.profile.xcconfig */, 72 | ); 73 | path = Pods; 74 | sourceTree = ""; 75 | }; 76 | 9740EEB11CF90186004384FC /* Flutter */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 80 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 81 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 82 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 83 | ); 84 | name = Flutter; 85 | sourceTree = ""; 86 | }; 87 | 97C146E51CF9000F007C117D = { 88 | isa = PBXGroup; 89 | children = ( 90 | 9740EEB11CF90186004384FC /* Flutter */, 91 | 97C146F01CF9000F007C117D /* Runner */, 92 | 97C146EF1CF9000F007C117D /* Products */, 93 | 0F9483635D3E6C6DBD1B9CF5 /* Pods */, 94 | D5A30A809CBE61EB9A3BDFD2 /* Frameworks */, 95 | ); 96 | sourceTree = ""; 97 | }; 98 | 97C146EF1CF9000F007C117D /* Products */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146EE1CF9000F007C117D /* Runner.app */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 97C146F01CF9000F007C117D /* Runner */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 7E4F6F7128006AC600579975 /* GoogleService-Info.plist */, 110 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 111 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 112 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 113 | 97C147021CF9000F007C117D /* Info.plist */, 114 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 115 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 116 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 117 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 118 | ); 119 | path = Runner; 120 | sourceTree = ""; 121 | }; 122 | D5A30A809CBE61EB9A3BDFD2 /* Frameworks */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 3C3F728CDB90BC6FE40710E3 /* Pods_Runner.framework */, 126 | ); 127 | name = Frameworks; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | 97C146ED1CF9000F007C117D /* Runner */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 136 | buildPhases = ( 137 | BA3EAE18F2B605C9A3356C68 /* [CP] Check Pods Manifest.lock */, 138 | 9740EEB61CF901F6004384FC /* Run Script */, 139 | 97C146EA1CF9000F007C117D /* Sources */, 140 | 97C146EB1CF9000F007C117D /* Frameworks */, 141 | 97C146EC1CF9000F007C117D /* Resources */, 142 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 143 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 144 | BAA2D14DE6C31F15D178B2F2 /* [CP] Embed Pods Frameworks */, 145 | 139EEE7A194C353C746F99D0 /* [CP] Copy Pods Resources */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | ); 151 | name = Runner; 152 | productName = Runner; 153 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 154 | productType = "com.apple.product-type.application"; 155 | }; 156 | /* End PBXNativeTarget section */ 157 | 158 | /* Begin PBXProject section */ 159 | 97C146E61CF9000F007C117D /* Project object */ = { 160 | isa = PBXProject; 161 | attributes = { 162 | LastUpgradeCheck = 1300; 163 | ORGANIZATIONNAME = ""; 164 | TargetAttributes = { 165 | 97C146ED1CF9000F007C117D = { 166 | CreatedOnToolsVersion = 7.3.1; 167 | LastSwiftMigration = 1100; 168 | }; 169 | }; 170 | }; 171 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 172 | compatibilityVersion = "Xcode 9.3"; 173 | developmentRegion = en; 174 | hasScannedForEncodings = 0; 175 | knownRegions = ( 176 | en, 177 | Base, 178 | ); 179 | mainGroup = 97C146E51CF9000F007C117D; 180 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 181 | projectDirPath = ""; 182 | projectRoot = ""; 183 | targets = ( 184 | 97C146ED1CF9000F007C117D /* Runner */, 185 | ); 186 | }; 187 | /* End PBXProject section */ 188 | 189 | /* Begin PBXResourcesBuildPhase section */ 190 | 97C146EC1CF9000F007C117D /* Resources */ = { 191 | isa = PBXResourcesBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 195 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 196 | 7E4F6F7228006AC600579975 /* GoogleService-Info.plist in Resources */, 197 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 198 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXResourcesBuildPhase section */ 203 | 204 | /* Begin PBXShellScriptBuildPhase section */ 205 | 139EEE7A194C353C746F99D0 /* [CP] Copy Pods Resources */ = { 206 | isa = PBXShellScriptBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | ); 210 | inputFileListPaths = ( 211 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", 212 | ); 213 | name = "[CP] Copy Pods Resources"; 214 | outputFileListPaths = ( 215 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | shellPath = /bin/sh; 219 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; 220 | showEnvVarsInLog = 0; 221 | }; 222 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 223 | isa = PBXShellScriptBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | inputPaths = ( 228 | ); 229 | name = "Thin Binary"; 230 | outputPaths = ( 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | shellPath = /bin/sh; 234 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 235 | }; 236 | 9740EEB61CF901F6004384FC /* Run Script */ = { 237 | isa = PBXShellScriptBuildPhase; 238 | buildActionMask = 2147483647; 239 | files = ( 240 | ); 241 | inputPaths = ( 242 | ); 243 | name = "Run Script"; 244 | outputPaths = ( 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | shellPath = /bin/sh; 248 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 249 | }; 250 | BA3EAE18F2B605C9A3356C68 /* [CP] Check Pods Manifest.lock */ = { 251 | isa = PBXShellScriptBuildPhase; 252 | buildActionMask = 2147483647; 253 | files = ( 254 | ); 255 | inputFileListPaths = ( 256 | ); 257 | inputPaths = ( 258 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 259 | "${PODS_ROOT}/Manifest.lock", 260 | ); 261 | name = "[CP] Check Pods Manifest.lock"; 262 | outputFileListPaths = ( 263 | ); 264 | outputPaths = ( 265 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | shellPath = /bin/sh; 269 | 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"; 270 | showEnvVarsInLog = 0; 271 | }; 272 | BAA2D14DE6C31F15D178B2F2 /* [CP] Embed Pods Frameworks */ = { 273 | isa = PBXShellScriptBuildPhase; 274 | buildActionMask = 2147483647; 275 | files = ( 276 | ); 277 | inputFileListPaths = ( 278 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 279 | ); 280 | name = "[CP] Embed Pods Frameworks"; 281 | outputFileListPaths = ( 282 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | shellPath = /bin/sh; 286 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 287 | showEnvVarsInLog = 0; 288 | }; 289 | /* End PBXShellScriptBuildPhase section */ 290 | 291 | /* Begin PBXSourcesBuildPhase section */ 292 | 97C146EA1CF9000F007C117D /* Sources */ = { 293 | isa = PBXSourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 297 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXVariantGroup section */ 304 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 97C146FB1CF9000F007C117D /* Base */, 308 | ); 309 | name = Main.storyboard; 310 | sourceTree = ""; 311 | }; 312 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 97C147001CF9000F007C117D /* Base */, 316 | ); 317 | name = LaunchScreen.storyboard; 318 | sourceTree = ""; 319 | }; 320 | /* End PBXVariantGroup section */ 321 | 322 | /* Begin XCBuildConfiguration section */ 323 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | ALWAYS_SEARCH_USER_PATHS = NO; 327 | CLANG_ANALYZER_NONNULL = YES; 328 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 329 | CLANG_CXX_LIBRARY = "libc++"; 330 | CLANG_ENABLE_MODULES = YES; 331 | CLANG_ENABLE_OBJC_ARC = YES; 332 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 333 | CLANG_WARN_BOOL_CONVERSION = YES; 334 | CLANG_WARN_COMMA = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_EMPTY_BODY = YES; 339 | CLANG_WARN_ENUM_CONVERSION = YES; 340 | CLANG_WARN_INFINITE_RECURSION = YES; 341 | CLANG_WARN_INT_CONVERSION = YES; 342 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 343 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 344 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 345 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 346 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 347 | CLANG_WARN_STRICT_PROTOTYPES = YES; 348 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 349 | CLANG_WARN_UNREACHABLE_CODE = YES; 350 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 351 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 352 | COPY_PHASE_STRIP = NO; 353 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 354 | ENABLE_NS_ASSERTIONS = NO; 355 | ENABLE_STRICT_OBJC_MSGSEND = YES; 356 | GCC_C_LANGUAGE_STANDARD = gnu99; 357 | GCC_NO_COMMON_BLOCKS = YES; 358 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 359 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 360 | GCC_WARN_UNDECLARED_SELECTOR = YES; 361 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 362 | GCC_WARN_UNUSED_FUNCTION = YES; 363 | GCC_WARN_UNUSED_VARIABLE = YES; 364 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 365 | MTL_ENABLE_DEBUG_INFO = NO; 366 | SDKROOT = iphoneos; 367 | SUPPORTED_PLATFORMS = iphoneos; 368 | TARGETED_DEVICE_FAMILY = "1,2"; 369 | VALIDATE_PRODUCT = YES; 370 | }; 371 | name = Profile; 372 | }; 373 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 374 | isa = XCBuildConfiguration; 375 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 376 | buildSettings = { 377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 378 | CLANG_ENABLE_MODULES = YES; 379 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 380 | DEVELOPMENT_TEAM = FQR55V88G5; 381 | ENABLE_BITCODE = NO; 382 | INFOPLIST_FILE = Runner/Info.plist; 383 | LD_RUNPATH_SEARCH_PATHS = ( 384 | "$(inherited)", 385 | "@executable_path/Frameworks", 386 | ); 387 | PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseAuthDemo; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 390 | SWIFT_VERSION = 5.0; 391 | VERSIONING_SYSTEM = "apple-generic"; 392 | }; 393 | name = Profile; 394 | }; 395 | 97C147031CF9000F007C117D /* Debug */ = { 396 | isa = XCBuildConfiguration; 397 | buildSettings = { 398 | ALWAYS_SEARCH_USER_PATHS = NO; 399 | CLANG_ANALYZER_NONNULL = YES; 400 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 401 | CLANG_CXX_LIBRARY = "libc++"; 402 | CLANG_ENABLE_MODULES = YES; 403 | CLANG_ENABLE_OBJC_ARC = YES; 404 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 405 | CLANG_WARN_BOOL_CONVERSION = YES; 406 | CLANG_WARN_COMMA = YES; 407 | CLANG_WARN_CONSTANT_CONVERSION = YES; 408 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 409 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 410 | CLANG_WARN_EMPTY_BODY = YES; 411 | CLANG_WARN_ENUM_CONVERSION = YES; 412 | CLANG_WARN_INFINITE_RECURSION = YES; 413 | CLANG_WARN_INT_CONVERSION = YES; 414 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 415 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 416 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 417 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 418 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 419 | CLANG_WARN_STRICT_PROTOTYPES = YES; 420 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 421 | CLANG_WARN_UNREACHABLE_CODE = YES; 422 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 423 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 424 | COPY_PHASE_STRIP = NO; 425 | DEBUG_INFORMATION_FORMAT = dwarf; 426 | ENABLE_STRICT_OBJC_MSGSEND = YES; 427 | ENABLE_TESTABILITY = YES; 428 | GCC_C_LANGUAGE_STANDARD = gnu99; 429 | GCC_DYNAMIC_NO_PIC = NO; 430 | GCC_NO_COMMON_BLOCKS = YES; 431 | GCC_OPTIMIZATION_LEVEL = 0; 432 | GCC_PREPROCESSOR_DEFINITIONS = ( 433 | "DEBUG=1", 434 | "$(inherited)", 435 | ); 436 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 437 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 438 | GCC_WARN_UNDECLARED_SELECTOR = YES; 439 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 440 | GCC_WARN_UNUSED_FUNCTION = YES; 441 | GCC_WARN_UNUSED_VARIABLE = YES; 442 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 443 | MTL_ENABLE_DEBUG_INFO = YES; 444 | ONLY_ACTIVE_ARCH = YES; 445 | SDKROOT = iphoneos; 446 | TARGETED_DEVICE_FAMILY = "1,2"; 447 | }; 448 | name = Debug; 449 | }; 450 | 97C147041CF9000F007C117D /* Release */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ALWAYS_SEARCH_USER_PATHS = NO; 454 | CLANG_ANALYZER_NONNULL = YES; 455 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 456 | CLANG_CXX_LIBRARY = "libc++"; 457 | CLANG_ENABLE_MODULES = YES; 458 | CLANG_ENABLE_OBJC_ARC = YES; 459 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 460 | CLANG_WARN_BOOL_CONVERSION = YES; 461 | CLANG_WARN_COMMA = YES; 462 | CLANG_WARN_CONSTANT_CONVERSION = YES; 463 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 464 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 465 | CLANG_WARN_EMPTY_BODY = YES; 466 | CLANG_WARN_ENUM_CONVERSION = YES; 467 | CLANG_WARN_INFINITE_RECURSION = YES; 468 | CLANG_WARN_INT_CONVERSION = YES; 469 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 470 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 471 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 472 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 473 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 474 | CLANG_WARN_STRICT_PROTOTYPES = YES; 475 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 476 | CLANG_WARN_UNREACHABLE_CODE = YES; 477 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 478 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 479 | COPY_PHASE_STRIP = NO; 480 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 481 | ENABLE_NS_ASSERTIONS = NO; 482 | ENABLE_STRICT_OBJC_MSGSEND = YES; 483 | GCC_C_LANGUAGE_STANDARD = gnu99; 484 | GCC_NO_COMMON_BLOCKS = YES; 485 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 486 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 487 | GCC_WARN_UNDECLARED_SELECTOR = YES; 488 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 489 | GCC_WARN_UNUSED_FUNCTION = YES; 490 | GCC_WARN_UNUSED_VARIABLE = YES; 491 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 492 | MTL_ENABLE_DEBUG_INFO = NO; 493 | SDKROOT = iphoneos; 494 | SUPPORTED_PLATFORMS = iphoneos; 495 | SWIFT_COMPILATION_MODE = wholemodule; 496 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 497 | TARGETED_DEVICE_FAMILY = "1,2"; 498 | VALIDATE_PRODUCT = YES; 499 | }; 500 | name = Release; 501 | }; 502 | 97C147061CF9000F007C117D /* Debug */ = { 503 | isa = XCBuildConfiguration; 504 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 505 | buildSettings = { 506 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 507 | CLANG_ENABLE_MODULES = YES; 508 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 509 | DEVELOPMENT_TEAM = FQR55V88G5; 510 | ENABLE_BITCODE = NO; 511 | INFOPLIST_FILE = Runner/Info.plist; 512 | LD_RUNPATH_SEARCH_PATHS = ( 513 | "$(inherited)", 514 | "@executable_path/Frameworks", 515 | ); 516 | PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseAuthDemo; 517 | PRODUCT_NAME = "$(TARGET_NAME)"; 518 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 519 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 520 | SWIFT_VERSION = 5.0; 521 | VERSIONING_SYSTEM = "apple-generic"; 522 | }; 523 | name = Debug; 524 | }; 525 | 97C147071CF9000F007C117D /* Release */ = { 526 | isa = XCBuildConfiguration; 527 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 528 | buildSettings = { 529 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 530 | CLANG_ENABLE_MODULES = YES; 531 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 532 | DEVELOPMENT_TEAM = FQR55V88G5; 533 | ENABLE_BITCODE = NO; 534 | INFOPLIST_FILE = Runner/Info.plist; 535 | LD_RUNPATH_SEARCH_PATHS = ( 536 | "$(inherited)", 537 | "@executable_path/Frameworks", 538 | ); 539 | PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseAuthDemo; 540 | PRODUCT_NAME = "$(TARGET_NAME)"; 541 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 542 | SWIFT_VERSION = 5.0; 543 | VERSIONING_SYSTEM = "apple-generic"; 544 | }; 545 | name = Release; 546 | }; 547 | /* End XCBuildConfiguration section */ 548 | 549 | /* Begin XCConfigurationList section */ 550 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 97C147031CF9000F007C117D /* Debug */, 554 | 97C147041CF9000F007C117D /* Release */, 555 | 249021D3217E4FDB00AE95B9 /* Profile */, 556 | ); 557 | defaultConfigurationIsVisible = 0; 558 | defaultConfigurationName = Release; 559 | }; 560 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 561 | isa = XCConfigurationList; 562 | buildConfigurations = ( 563 | 97C147061CF9000F007C117D /* Debug */, 564 | 97C147071CF9000F007C117D /* Release */, 565 | 249021D4217E4FDB00AE95B9 /* Profile */, 566 | ); 567 | defaultConfigurationIsVisible = 0; 568 | defaultConfigurationName = Release; 569 | }; 570 | /* End XCConfigurationList section */ 571 | }; 572 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 573 | } 574 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CLIENT_ID 6 | 599030350718-rt5diuiggpna5fmco6k05teqm2km0f66.apps.googleusercontent.com 7 | REVERSED_CLIENT_ID 8 | com.googleusercontent.apps.599030350718-rt5diuiggpna5fmco6k05teqm2km0f66 9 | ANDROID_CLIENT_ID 10 | 599030350718-9mv5oeembdgpfappbvv29bk0b35eilb4.apps.googleusercontent.com 11 | API_KEY 12 | AIzaSyC9wBMEJ1WDl8WkUoxHqIVqPLvwClaTYxs 13 | GCM_SENDER_ID 14 | 599030350718 15 | PLIST_VERSION 16 | 1 17 | BUNDLE_ID 18 | com.example.firebaseAuthDemo 19 | PROJECT_ID 20 | fir-auth-demo-ec48c 21 | STORAGE_BUCKET 22 | fir-auth-demo-ec48c.appspot.com 23 | IS_ADS_ENABLED 24 | 25 | IS_ANALYTICS_ENABLED 26 | 27 | IS_APPINVITE_ENABLED 28 | 29 | IS_GCM_ENABLED 30 | 31 | IS_SIGNIN_ENABLED 32 | 33 | GOOGLE_APP_ID 34 | 1:599030350718:ios:d4aadf3cf97a599eb6292f 35 | 36 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Firebase Auth Demo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | firebase_auth_demo 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CFBundleURLTypes 47 | 48 | 49 | CFBundleTypeRole 50 | Editor 51 | CFBundleURLSchemes 52 | 53 | fb1129634001214960 54 | com.googleusercontent.apps.599030350718-rt5diuiggpna5fmco6k05teqm2km0f66 55 | 56 | 57 | 58 | FacebookAppID 59 | 1129634001214960 60 | FacebookClientToken 61 | 14938167ac2897e38652822cd91f5b8d 62 | FacebookDisplayName 63 | Firebase Auth Demo 64 | 65 | 66 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /ios/firebase_app_id_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_generated_by": "FlutterFire CLI", 3 | "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", 4 | "GOOGLE_APP_ID": "1:599030350718:ios:d4aadf3cf97a599eb6292f", 5 | "FIREBASE_PROJECT_ID": "fir-auth-demo-ec48c", 6 | "GCM_SENDER_ID": "599030350718" 7 | } -------------------------------------------------------------------------------- /lib/firebase_options.dart: -------------------------------------------------------------------------------- 1 | // File generated by FlutterFire CLI. 2 | // ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members 3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; 4 | import 'package:flutter/foundation.dart' 5 | show defaultTargetPlatform, kIsWeb, TargetPlatform; 6 | 7 | /// Default [FirebaseOptions] for use with your Firebase apps. 8 | /// 9 | /// Example: 10 | /// ```dart 11 | /// import 'firebase_options.dart'; 12 | /// // ... 13 | /// await Firebase.initializeApp( 14 | /// options: DefaultFirebaseOptions.currentPlatform, 15 | /// ); 16 | /// ``` 17 | class DefaultFirebaseOptions { 18 | static FirebaseOptions get currentPlatform { 19 | if (kIsWeb) { 20 | return web; 21 | } 22 | switch (defaultTargetPlatform) { 23 | case TargetPlatform.android: 24 | return android; 25 | case TargetPlatform.iOS: 26 | return ios; 27 | case TargetPlatform.macOS: 28 | return macos; 29 | default: 30 | throw UnsupportedError( 31 | 'DefaultFirebaseOptions are not supported for this platform.', 32 | ); 33 | } 34 | } 35 | 36 | static const FirebaseOptions web = FirebaseOptions( 37 | apiKey: 'AIzaSyC_ubN3n0_aJZAugjyEeVWPy-CwD1H5nK4', 38 | appId: '1:599030350718:web:ca91f6b1d6769be8b6292f', 39 | messagingSenderId: '599030350718', 40 | projectId: 'fir-auth-demo-ec48c', 41 | authDomain: 'fir-auth-demo-ec48c.firebaseapp.com', 42 | storageBucket: 'fir-auth-demo-ec48c.appspot.com', 43 | ); 44 | 45 | static const FirebaseOptions android = FirebaseOptions( 46 | apiKey: 'AIzaSyB1CD3E2g-zmUoWqK1Le_RNEpPbpb5TrDc', 47 | appId: '1:599030350718:android:bff62dc1dc7685abb6292f', 48 | messagingSenderId: '599030350718', 49 | projectId: 'fir-auth-demo-ec48c', 50 | storageBucket: 'fir-auth-demo-ec48c.appspot.com', 51 | ); 52 | 53 | static const FirebaseOptions ios = FirebaseOptions( 54 | apiKey: 'AIzaSyC9wBMEJ1WDl8WkUoxHqIVqPLvwClaTYxs', 55 | appId: '1:599030350718:ios:d4aadf3cf97a599eb6292f', 56 | messagingSenderId: '599030350718', 57 | projectId: 'fir-auth-demo-ec48c', 58 | storageBucket: 'fir-auth-demo-ec48c.appspot.com', 59 | iosClientId: '599030350718-rt5diuiggpna5fmco6k05teqm2km0f66.apps.googleusercontent.com', 60 | iosBundleId: 'com.example.firebaseAuthDemo', 61 | ); 62 | 63 | static const FirebaseOptions macos = FirebaseOptions( 64 | apiKey: 'AIzaSyC9wBMEJ1WDl8WkUoxHqIVqPLvwClaTYxs', 65 | appId: '1:599030350718:ios:d4aadf3cf97a599eb6292f', 66 | messagingSenderId: '599030350718', 67 | projectId: 'fir-auth-demo-ec48c', 68 | storageBucket: 'fir-auth-demo-ec48c.appspot.com', 69 | iosClientId: '599030350718-rt5diuiggpna5fmco6k05teqm2km0f66.apps.googleusercontent.com', 70 | iosBundleId: 'com.example.firebaseAuthDemo', 71 | ); 72 | } 73 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:firebase_auth_demo/firebase_options.dart'; 3 | import 'package:firebase_auth_demo/screens/home_screen.dart'; 4 | import 'package:firebase_auth_demo/screens/login_email_password_screen.dart'; 5 | import 'package:firebase_auth_demo/screens/login_screen.dart'; 6 | import 'package:firebase_auth_demo/screens/phone_screen.dart'; 7 | import 'package:firebase_auth_demo/screens/signup_email_password_screen.dart'; 8 | import 'package:firebase_auth_demo/services/firebase_auth_methods.dart'; 9 | import 'package:firebase_core/firebase_core.dart'; 10 | import 'package:flutter/foundation.dart'; 11 | import 'package:flutter/material.dart'; 12 | import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; 13 | import 'package:provider/provider.dart'; 14 | 15 | void main() async { 16 | WidgetsFlutterBinding.ensureInitialized(); 17 | await Firebase.initializeApp( 18 | options: DefaultFirebaseOptions.currentPlatform, 19 | ); 20 | if (kIsWeb) { 21 | FacebookAuth.i.webInitialize( 22 | appId: "1129634001214960", // Replace with your app id 23 | cookie: true, 24 | xfbml: true, 25 | version: "v12.0", 26 | ); 27 | } 28 | runApp(const MyApp()); 29 | } 30 | 31 | class MyApp extends StatelessWidget { 32 | const MyApp({Key? key}) : super(key: key); 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return MultiProvider( 37 | providers: [ 38 | Provider( 39 | create: (_) => FirebaseAuthMethods(FirebaseAuth.instance), 40 | ), 41 | StreamProvider( 42 | create: (context) => context.read().authState, 43 | initialData: null, 44 | ), 45 | ], 46 | child: MaterialApp( 47 | title: 'Flutter Firebase Auth Demo', 48 | theme: ThemeData( 49 | primarySwatch: Colors.blue, 50 | ), 51 | home: const AuthWrapper(), 52 | routes: { 53 | EmailPasswordSignup.routeName: (context) => 54 | const EmailPasswordSignup(), 55 | EmailPasswordLogin.routeName: (context) => const EmailPasswordLogin(), 56 | PhoneScreen.routeName: (context) => const PhoneScreen(), 57 | }, 58 | ), 59 | ); 60 | } 61 | } 62 | 63 | class AuthWrapper extends StatelessWidget { 64 | const AuthWrapper({Key? key}) : super(key: key); 65 | 66 | @override 67 | Widget build(BuildContext context) { 68 | final firebaseUser = context.watch(); 69 | 70 | if (firebaseUser != null) { 71 | return const HomeScreen(); 72 | } 73 | return const LoginScreen(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/screens/home_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth_demo/services/firebase_auth_methods.dart'; 2 | import 'package:firebase_auth_demo/widgets/custom_button.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class HomeScreen extends StatelessWidget { 7 | const HomeScreen({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final user = context.read().user; 12 | 13 | return Scaffold( 14 | body: Column( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | children: [ 17 | // when user signs anonymously or with phone, there is no email 18 | if (!user.isAnonymous && user.phoneNumber == null) Text(user.email!), 19 | if (!user.isAnonymous && user.phoneNumber == null) 20 | Text(user.providerData[0].providerId), 21 | // display phone number only when user's phone number is not null 22 | if (user.phoneNumber != null) Text(user.phoneNumber!), 23 | // uid is always available for every sign in method 24 | Text(user.uid), 25 | // display the button only when the user email is not verified 26 | // or isnt an anonymous user 27 | if (!user.emailVerified && !user.isAnonymous) 28 | CustomButton( 29 | onTap: () { 30 | context 31 | .read() 32 | .sendEmailVerification(context); 33 | }, 34 | text: 'Verify Email', 35 | ), 36 | CustomButton( 37 | onTap: () { 38 | context.read().signOut(context); 39 | }, 40 | text: 'Sign Out', 41 | ), 42 | CustomButton( 43 | onTap: () { 44 | context.read().deleteAccount(context); 45 | }, 46 | text: 'Delete Account', 47 | ), 48 | ], 49 | ), 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/screens/login_email_password_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth_demo/services/firebase_auth_methods.dart'; 2 | import 'package:firebase_auth_demo/widgets/custom_textfield.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class EmailPasswordLogin extends StatefulWidget { 7 | static String routeName = '/login-email-password'; 8 | const EmailPasswordLogin({Key? key}) : super(key: key); 9 | 10 | @override 11 | _EmailPasswordLoginState createState() => _EmailPasswordLoginState(); 12 | } 13 | 14 | class _EmailPasswordLoginState extends State { 15 | final TextEditingController emailController = TextEditingController(); 16 | final TextEditingController passwordController = TextEditingController(); 17 | 18 | void loginUser() { 19 | context.read().loginWithEmail( 20 | email: emailController.text, 21 | password: passwordController.text, 22 | context: context, 23 | ); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | body: Column( 30 | mainAxisAlignment: MainAxisAlignment.center, 31 | children: [ 32 | const Text( 33 | "Login", 34 | style: TextStyle(fontSize: 30), 35 | ), 36 | SizedBox(height: MediaQuery.of(context).size.height * 0.08), 37 | Container( 38 | margin: const EdgeInsets.symmetric(horizontal: 20), 39 | child: CustomTextField( 40 | controller: emailController, 41 | hintText: 'Enter your email', 42 | ), 43 | ), 44 | const SizedBox(height: 20), 45 | Container( 46 | margin: const EdgeInsets.symmetric(horizontal: 20), 47 | child: CustomTextField( 48 | controller: passwordController, 49 | hintText: 'Enter your password', 50 | ), 51 | ), 52 | const SizedBox(height: 40), 53 | ElevatedButton( 54 | onPressed: loginUser, 55 | style: ButtonStyle( 56 | backgroundColor: MaterialStateProperty.all(Colors.blue), 57 | textStyle: MaterialStateProperty.all( 58 | const TextStyle(color: Colors.white), 59 | ), 60 | minimumSize: MaterialStateProperty.all( 61 | Size(MediaQuery.of(context).size.width / 2.5, 50), 62 | ), 63 | ), 64 | child: const Text( 65 | "Login", 66 | style: TextStyle(color: Colors.white, fontSize: 16), 67 | ), 68 | ), 69 | ], 70 | ), 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/screens/login_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth_demo/screens/login_email_password_screen.dart'; 2 | import 'package:firebase_auth_demo/screens/phone_screen.dart'; 3 | import 'package:firebase_auth_demo/screens/signup_email_password_screen.dart'; 4 | import 'package:firebase_auth_demo/services/firebase_auth_methods.dart'; 5 | import 'package:firebase_auth_demo/widgets/custom_button.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:provider/provider.dart'; 8 | 9 | class LoginScreen extends StatefulWidget { 10 | const LoginScreen({Key? key}) : super(key: key); 11 | 12 | @override 13 | State createState() => _LoginScreenState(); 14 | } 15 | 16 | class _LoginScreenState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | body: SafeArea( 21 | child: Column( 22 | children: [ 23 | CustomButton( 24 | onTap: () { 25 | Navigator.pushNamed(context, EmailPasswordSignup.routeName); 26 | }, 27 | text: 'Email/Password Sign Up', 28 | ), 29 | CustomButton( 30 | onTap: () { 31 | Navigator.pushNamed(context, EmailPasswordLogin.routeName); 32 | }, 33 | text: 'Email/Password Login', 34 | ), 35 | CustomButton( 36 | onTap: () { 37 | Navigator.pushNamed(context, PhoneScreen.routeName); 38 | }, 39 | text: 'Phone Sign In'), 40 | CustomButton( 41 | onTap: () { 42 | context.read().signInWithGoogle(context); 43 | }, 44 | text: 'Google Sign In', 45 | ), 46 | CustomButton( 47 | onTap: () { 48 | context.read().signInWithFacebook(context); 49 | }, 50 | text: 'Facebook Sign In', 51 | ), 52 | CustomButton( 53 | onTap: () { 54 | context.read().signInAnonymously(context); 55 | }, 56 | text: 'Anonymous Sign In', 57 | ), 58 | ], 59 | ), 60 | ), 61 | ); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /lib/screens/phone_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth_demo/services/firebase_auth_methods.dart'; 2 | import 'package:firebase_auth_demo/widgets/custom_button.dart'; 3 | import 'package:firebase_auth_demo/widgets/custom_textfield.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:provider/provider.dart'; 6 | 7 | class PhoneScreen extends StatefulWidget { 8 | static String routeName = '/phone'; 9 | const PhoneScreen({Key? key}) : super(key: key); 10 | 11 | @override 12 | State createState() => _PhoneScreenState(); 13 | } 14 | 15 | class _PhoneScreenState extends State { 16 | final TextEditingController phoneController = TextEditingController(); 17 | 18 | @override 19 | void dispose() { 20 | super.dispose(); 21 | phoneController.dispose(); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | body: Column( 28 | mainAxisAlignment: MainAxisAlignment.center, 29 | children: [ 30 | CustomTextField( 31 | controller: phoneController, 32 | hintText: 'Enter phone number', 33 | ), 34 | CustomButton( 35 | onTap: () { 36 | context 37 | .read() 38 | .phoneSignIn(context, phoneController.text); 39 | }, 40 | text: 'OK', 41 | ), 42 | ], 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/screens/signup_email_password_screen.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth_demo/services/firebase_auth_methods.dart'; 2 | import 'package:firebase_auth_demo/widgets/custom_textfield.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | 6 | class EmailPasswordSignup extends StatefulWidget { 7 | static String routeName = '/signup-email-password'; 8 | const EmailPasswordSignup({Key? key}) : super(key: key); 9 | 10 | @override 11 | _EmailPasswordSignupState createState() => _EmailPasswordSignupState(); 12 | } 13 | 14 | class _EmailPasswordSignupState extends State { 15 | final TextEditingController emailController = TextEditingController(); 16 | final TextEditingController passwordController = TextEditingController(); 17 | 18 | void signUpUser() async { 19 | context.read().signUpWithEmail( 20 | email: emailController.text, 21 | password: passwordController.text, 22 | context: context, 23 | ); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | body: Column( 30 | mainAxisAlignment: MainAxisAlignment.center, 31 | children: [ 32 | const Text( 33 | "Sign Up", 34 | style: TextStyle(fontSize: 30), 35 | ), 36 | SizedBox(height: MediaQuery.of(context).size.height * 0.08), 37 | Container( 38 | margin: const EdgeInsets.symmetric(horizontal: 20), 39 | child: CustomTextField( 40 | controller: emailController, 41 | hintText: 'Enter your email', 42 | ), 43 | ), 44 | const SizedBox(height: 20), 45 | Container( 46 | margin: const EdgeInsets.symmetric(horizontal: 20), 47 | child: CustomTextField( 48 | controller: passwordController, 49 | hintText: 'Enter your password', 50 | ), 51 | ), 52 | const SizedBox(height: 40), 53 | ElevatedButton( 54 | onPressed: signUpUser, 55 | style: ButtonStyle( 56 | backgroundColor: MaterialStateProperty.all(Colors.blue), 57 | textStyle: MaterialStateProperty.all( 58 | const TextStyle(color: Colors.white), 59 | ), 60 | minimumSize: MaterialStateProperty.all( 61 | Size(MediaQuery.of(context).size.width / 2.5, 50), 62 | ), 63 | ), 64 | child: const Text( 65 | "Sign Up", 66 | style: TextStyle(color: Colors.white, fontSize: 16), 67 | ), 68 | ), 69 | ], 70 | ), 71 | ); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /lib/services/firebase_auth_methods.dart: -------------------------------------------------------------------------------- 1 | import 'package:firebase_auth/firebase_auth.dart'; 2 | import 'package:firebase_auth_demo/utils/showOTPDialog.dart'; 3 | import 'package:firebase_auth_demo/utils/showSnackbar.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; 7 | import 'package:google_sign_in/google_sign_in.dart'; 8 | 9 | class FirebaseAuthMethods { 10 | final FirebaseAuth _auth; 11 | FirebaseAuthMethods(this._auth); 12 | 13 | // FOR EVERY FUNCTION HERE 14 | // POP THE ROUTE USING: Navigator.of(context).pushNamedAndRemoveUntil('/', (Route route) => false); 15 | 16 | // GET USER DATA 17 | // using null check operator since this method should be called only 18 | // when the user is logged in 19 | User get user => _auth.currentUser!; 20 | 21 | // STATE PERSISTENCE STREAM 22 | Stream get authState => FirebaseAuth.instance.authStateChanges(); 23 | // OTHER WAYS (depends on use case): 24 | // Stream get authState => FirebaseAuth.instance.userChanges(); 25 | // Stream get authState => FirebaseAuth.instance.idTokenChanges(); 26 | // KNOW MORE ABOUT THEM HERE: https://firebase.flutter.dev/docs/auth/start#auth-state 27 | 28 | // EMAIL SIGN UP 29 | Future signUpWithEmail({ 30 | required String email, 31 | required String password, 32 | required BuildContext context, 33 | }) async { 34 | try { 35 | await _auth.createUserWithEmailAndPassword( 36 | email: email, 37 | password: password, 38 | ); 39 | await sendEmailVerification(context); 40 | } on FirebaseAuthException catch (e) { 41 | // if you want to display your own custom error message 42 | if (e.code == 'weak-password') { 43 | print('The password provided is too weak.'); 44 | } else if (e.code == 'email-already-in-use') { 45 | print('The account already exists for that email.'); 46 | } 47 | showSnackBar( 48 | context, e.message!); // Displaying the usual firebase error message 49 | } 50 | } 51 | 52 | // EMAIL LOGIN 53 | Future loginWithEmail({ 54 | required String email, 55 | required String password, 56 | required BuildContext context, 57 | }) async { 58 | try { 59 | await _auth.signInWithEmailAndPassword( 60 | email: email, 61 | password: password, 62 | ); 63 | if (!user.emailVerified) { 64 | await sendEmailVerification(context); 65 | // restrict access to certain things using provider 66 | // transition to another page instead of home screen 67 | } 68 | } on FirebaseAuthException catch (e) { 69 | showSnackBar(context, e.message!); // Displaying the error message 70 | } 71 | } 72 | 73 | // EMAIL VERIFICATION 74 | Future sendEmailVerification(BuildContext context) async { 75 | try { 76 | _auth.currentUser!.sendEmailVerification(); 77 | showSnackBar(context, 'Email verification sent!'); 78 | } on FirebaseAuthException catch (e) { 79 | showSnackBar(context, e.message!); // Display error message 80 | } 81 | } 82 | 83 | // GOOGLE SIGN IN 84 | Future signInWithGoogle(BuildContext context) async { 85 | try { 86 | if (kIsWeb) { 87 | GoogleAuthProvider googleProvider = GoogleAuthProvider(); 88 | 89 | googleProvider 90 | .addScope('https://www.googleapis.com/auth/contacts.readonly'); 91 | 92 | await _auth.signInWithPopup(googleProvider); 93 | } else { 94 | final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn(); 95 | 96 | final GoogleSignInAuthentication? googleAuth = 97 | await googleUser?.authentication; 98 | 99 | if (googleAuth?.accessToken != null && googleAuth?.idToken != null) { 100 | // Create a new credential 101 | final credential = GoogleAuthProvider.credential( 102 | accessToken: googleAuth?.accessToken, 103 | idToken: googleAuth?.idToken, 104 | ); 105 | UserCredential userCredential = 106 | await _auth.signInWithCredential(credential); 107 | 108 | // if you want to do specific task like storing information in firestore 109 | // only for new users using google sign in (since there are no two options 110 | // for google sign in and google sign up, only one as of now), 111 | // do the following: 112 | 113 | // if (userCredential.user != null) { 114 | // if (userCredential.additionalUserInfo!.isNewUser) {} 115 | // } 116 | } 117 | } 118 | } on FirebaseAuthException catch (e) { 119 | showSnackBar(context, e.message!); // Displaying the error message 120 | } 121 | } 122 | 123 | // ANONYMOUS SIGN IN 124 | Future signInAnonymously(BuildContext context) async { 125 | try { 126 | await _auth.signInAnonymously(); 127 | } on FirebaseAuthException catch (e) { 128 | showSnackBar(context, e.message!); // Displaying the error message 129 | } 130 | } 131 | 132 | // FACEBOOK SIGN IN 133 | Future signInWithFacebook(BuildContext context) async { 134 | try { 135 | final LoginResult loginResult = await FacebookAuth.instance.login(); 136 | 137 | final OAuthCredential facebookAuthCredential = 138 | FacebookAuthProvider.credential(loginResult.accessToken!.token); 139 | 140 | await _auth.signInWithCredential(facebookAuthCredential); 141 | } on FirebaseAuthException catch (e) { 142 | showSnackBar(context, e.message!); // Displaying the error message 143 | } 144 | } 145 | 146 | // PHONE SIGN IN 147 | Future phoneSignIn( 148 | BuildContext context, 149 | String phoneNumber, 150 | ) async { 151 | TextEditingController codeController = TextEditingController(); 152 | if (kIsWeb) { 153 | // !!! Works only on web !!! 154 | ConfirmationResult result = 155 | await _auth.signInWithPhoneNumber(phoneNumber); 156 | 157 | // Diplay Dialog Box To accept OTP 158 | showOTPDialog( 159 | codeController: codeController, 160 | context: context, 161 | onPressed: () async { 162 | PhoneAuthCredential credential = PhoneAuthProvider.credential( 163 | verificationId: result.verificationId, 164 | smsCode: codeController.text.trim(), 165 | ); 166 | 167 | await _auth.signInWithCredential(credential); 168 | Navigator.of(context).pop(); // Remove the dialog box 169 | }, 170 | ); 171 | } else { 172 | // FOR ANDROID, IOS 173 | await _auth.verifyPhoneNumber( 174 | phoneNumber: phoneNumber, 175 | // Automatic handling of the SMS code 176 | verificationCompleted: (PhoneAuthCredential credential) async { 177 | // !!! works only on android !!! 178 | await _auth.signInWithCredential(credential); 179 | }, 180 | // Displays a message when verification fails 181 | verificationFailed: (e) { 182 | showSnackBar(context, e.message!); 183 | }, 184 | // Displays a dialog box when OTP is sent 185 | codeSent: ((String verificationId, int? resendToken) async { 186 | showOTPDialog( 187 | codeController: codeController, 188 | context: context, 189 | onPressed: () async { 190 | PhoneAuthCredential credential = PhoneAuthProvider.credential( 191 | verificationId: verificationId, 192 | smsCode: codeController.text.trim(), 193 | ); 194 | 195 | // !!! Works only on Android, iOS !!! 196 | await _auth.signInWithCredential(credential); 197 | Navigator.of(context).pop(); // Remove the dialog box 198 | }, 199 | ); 200 | }), 201 | codeAutoRetrievalTimeout: (String verificationId) { 202 | // Auto-resolution timed out... 203 | }, 204 | ); 205 | } 206 | } 207 | 208 | // SIGN OUT 209 | Future signOut(BuildContext context) async { 210 | try { 211 | await _auth.signOut(); 212 | } on FirebaseAuthException catch (e) { 213 | showSnackBar(context, e.message!); // Displaying the error message 214 | } 215 | } 216 | 217 | // DELETE ACCOUNT 218 | Future deleteAccount(BuildContext context) async { 219 | try { 220 | await _auth.currentUser!.delete(); 221 | } on FirebaseAuthException catch (e) { 222 | showSnackBar(context, e.message!); // Displaying the error message 223 | // if an error of requires-recent-login is thrown, make sure to log 224 | // in user again and then delete account. 225 | } 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /lib/utils/showOtpDialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void showOTPDialog({ 4 | required BuildContext context, 5 | required TextEditingController codeController, 6 | required VoidCallback onPressed, 7 | }) { 8 | showDialog( 9 | context: context, 10 | barrierDismissible: false, 11 | builder: (context) => AlertDialog( 12 | title: const Text("Enter OTP"), 13 | content: Column( 14 | mainAxisSize: MainAxisSize.min, 15 | children: [ 16 | TextField( 17 | controller: codeController, 18 | ), 19 | ], 20 | ), 21 | actions: [ 22 | TextButton( 23 | child: const Text("Done"), 24 | onPressed: onPressed, 25 | ) 26 | ], 27 | ), 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /lib/utils/showSnackbar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | void showSnackBar(BuildContext context, String text) { 4 | ScaffoldMessenger.of(context).showSnackBar( 5 | SnackBar( 6 | content: Text(text), 7 | ), 8 | ); 9 | } 10 | -------------------------------------------------------------------------------- /lib/widgets/custom_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomButton extends StatelessWidget { 4 | const CustomButton({ 5 | Key? key, 6 | required this.onTap, 7 | required this.text, 8 | }) : super(key: key); 9 | final String text; 10 | final VoidCallback onTap; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return ElevatedButton( 15 | style: ElevatedButton.styleFrom( 16 | minimumSize: const Size(double.infinity, 40), 17 | ), 18 | onPressed: onTap, 19 | child: Text(text), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/widgets/custom_textfield.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomTextField extends StatelessWidget { 4 | final TextEditingController controller; 5 | final String hintText; 6 | 7 | const CustomTextField({ 8 | Key? key, 9 | required this.controller, 10 | required this.hintText, 11 | }) : super(key: key); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return TextField( 16 | controller: controller, 17 | decoration: InputDecoration( 18 | border: OutlineInputBorder( 19 | borderRadius: BorderRadius.circular(8), 20 | borderSide: const BorderSide(color: Colors.transparent, width: 0), 21 | ), 22 | enabledBorder: OutlineInputBorder( 23 | borderRadius: BorderRadius.circular(8), 24 | borderSide: const BorderSide(color: Colors.transparent, width: 0), 25 | ), 26 | contentPadding: 27 | const EdgeInsets.symmetric(horizontal: 16, vertical: 14), 28 | filled: true, 29 | fillColor: const Color(0xffF5F6FA), 30 | hintText: hintText, 31 | hintStyle: const TextStyle( 32 | fontSize: 14, 33 | fontWeight: FontWeight.w400, 34 | ), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import firebase_auth 9 | import firebase_core 10 | 11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 12 | FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) 13 | FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) 14 | } 15 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.12' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Firebase/Auth (8.14.0): 3 | - Firebase/CoreOnly 4 | - FirebaseAuth (~> 8.14.0) 5 | - Firebase/CoreOnly (8.14.0): 6 | - FirebaseCore (= 8.14.0) 7 | - firebase_auth (3.3.12): 8 | - Firebase/Auth (~> 8.14.0) 9 | - Firebase/CoreOnly (~> 8.14.0) 10 | - firebase_core 11 | - FlutterMacOS 12 | - firebase_core (1.14.0): 13 | - Firebase/CoreOnly (~> 8.14.0) 14 | - FlutterMacOS 15 | - FirebaseAuth (8.14.0): 16 | - FirebaseCore (~> 8.0) 17 | - GoogleUtilities/AppDelegateSwizzler (~> 7.7) 18 | - GoogleUtilities/Environment (~> 7.7) 19 | - GTMSessionFetcher/Core (~> 1.5) 20 | - FirebaseCore (8.14.0): 21 | - FirebaseCoreDiagnostics (~> 8.0) 22 | - GoogleUtilities/Environment (~> 7.7) 23 | - GoogleUtilities/Logger (~> 7.7) 24 | - FirebaseCoreDiagnostics (8.14.0): 25 | - GoogleDataTransport (~> 9.1) 26 | - GoogleUtilities/Environment (~> 7.7) 27 | - GoogleUtilities/Logger (~> 7.7) 28 | - nanopb (~> 2.30908.0) 29 | - FlutterMacOS (1.0.0) 30 | - GoogleDataTransport (9.1.2): 31 | - GoogleUtilities/Environment (~> 7.2) 32 | - nanopb (~> 2.30908.0) 33 | - PromisesObjC (< 3.0, >= 1.2) 34 | - GoogleUtilities/AppDelegateSwizzler (7.7.0): 35 | - GoogleUtilities/Environment 36 | - GoogleUtilities/Logger 37 | - GoogleUtilities/Network 38 | - GoogleUtilities/Environment (7.7.0): 39 | - PromisesObjC (< 3.0, >= 1.2) 40 | - GoogleUtilities/Logger (7.7.0): 41 | - GoogleUtilities/Environment 42 | - GoogleUtilities/Network (7.7.0): 43 | - GoogleUtilities/Logger 44 | - "GoogleUtilities/NSData+zlib" 45 | - GoogleUtilities/Reachability 46 | - "GoogleUtilities/NSData+zlib (7.7.0)" 47 | - GoogleUtilities/Reachability (7.7.0): 48 | - GoogleUtilities/Logger 49 | - GTMSessionFetcher/Core (1.7.1) 50 | - nanopb (2.30908.0): 51 | - nanopb/decode (= 2.30908.0) 52 | - nanopb/encode (= 2.30908.0) 53 | - nanopb/decode (2.30908.0) 54 | - nanopb/encode (2.30908.0) 55 | - PromisesObjC (2.0.0) 56 | 57 | DEPENDENCIES: 58 | - firebase_auth (from `Flutter/ephemeral/.symlinks/plugins/firebase_auth/macos`) 59 | - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) 60 | - FlutterMacOS (from `Flutter/ephemeral`) 61 | 62 | SPEC REPOS: 63 | trunk: 64 | - Firebase 65 | - FirebaseAuth 66 | - FirebaseCore 67 | - FirebaseCoreDiagnostics 68 | - GoogleDataTransport 69 | - GoogleUtilities 70 | - GTMSessionFetcher 71 | - nanopb 72 | - PromisesObjC 73 | 74 | EXTERNAL SOURCES: 75 | firebase_auth: 76 | :path: Flutter/ephemeral/.symlinks/plugins/firebase_auth/macos 77 | firebase_core: 78 | :path: Flutter/ephemeral/.symlinks/plugins/firebase_core/macos 79 | FlutterMacOS: 80 | :path: Flutter/ephemeral 81 | 82 | SPEC CHECKSUMS: 83 | Firebase: 7e8fe528c161b9271d365217a74c16aaf834578e 84 | firebase_auth: c8026dc7c04e4c1532f1ccc1a72affbacb043c9c 85 | firebase_core: 1b221df9828666916f22bae151f1b6d139c84e5a 86 | FirebaseAuth: c5fde343630090253d3af7e2d35697b414b40202 87 | FirebaseCore: b84a44ee7ba999e0f9f76d198a9c7f60a797b848 88 | FirebaseCoreDiagnostics: fd0c8490f34287229c1d6c103d3a55f81ec85712 89 | FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424 90 | GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940 91 | GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1 92 | GTMSessionFetcher: 4577a4cc914a5a07c40a8a0ad0acc22080418c2d 93 | nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 94 | PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58 95 | 96 | PODFILE CHECKSUM: c7161fcf45d4fd9025dc0f48a76d6e64e52f8176 97 | 98 | COCOAPODS: 1.11.2 99 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = firebase_auth_demo 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.firebaseAuthDemo 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | com.apple.security.network.client 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macos/firebase_app_id_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_generated_by": "FlutterFire CLI", 3 | "purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", 4 | "GOOGLE_APP_ID": "1:599030350718:ios:d4aadf3cf97a599eb6292f", 5 | "FIREBASE_PROJECT_ID": "fir-auth-demo-ec48c", 6 | "GCM_SENDER_ID": "599030350718" 7 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.8.2" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.2.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.3.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0" 46 | cupertino_icons: 47 | dependency: "direct main" 48 | description: 49 | name: cupertino_icons 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.4" 53 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.2.0" 60 | firebase_auth: 61 | dependency: "direct main" 62 | description: 63 | name: firebase_auth 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "3.3.12" 67 | firebase_auth_platform_interface: 68 | dependency: transitive 69 | description: 70 | name: firebase_auth_platform_interface 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "6.2.2" 74 | firebase_auth_web: 75 | dependency: transitive 76 | description: 77 | name: firebase_auth_web 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "3.3.10" 81 | firebase_core: 82 | dependency: "direct main" 83 | description: 84 | name: firebase_core 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.14.0" 88 | firebase_core_platform_interface: 89 | dependency: transitive 90 | description: 91 | name: firebase_core_platform_interface 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "4.2.5" 95 | firebase_core_web: 96 | dependency: transitive 97 | description: 98 | name: firebase_core_web 99 | url: "https://pub.dartlang.org" 100 | source: hosted 101 | version: "1.6.1" 102 | flutter: 103 | dependency: "direct main" 104 | description: flutter 105 | source: sdk 106 | version: "0.0.0" 107 | flutter_facebook_auth: 108 | dependency: "direct main" 109 | description: 110 | name: flutter_facebook_auth 111 | url: "https://pub.dartlang.org" 112 | source: hosted 113 | version: "4.1.2" 114 | flutter_facebook_auth_platform_interface: 115 | dependency: transitive 116 | description: 117 | name: flutter_facebook_auth_platform_interface 118 | url: "https://pub.dartlang.org" 119 | source: hosted 120 | version: "3.0.1" 121 | flutter_facebook_auth_web: 122 | dependency: transitive 123 | description: 124 | name: flutter_facebook_auth_web 125 | url: "https://pub.dartlang.org" 126 | source: hosted 127 | version: "3.0.0+1" 128 | flutter_lints: 129 | dependency: "direct dev" 130 | description: 131 | name: flutter_lints 132 | url: "https://pub.dartlang.org" 133 | source: hosted 134 | version: "1.0.4" 135 | flutter_test: 136 | dependency: "direct dev" 137 | description: flutter 138 | source: sdk 139 | version: "0.0.0" 140 | flutter_web_plugins: 141 | dependency: transitive 142 | description: flutter 143 | source: sdk 144 | version: "0.0.0" 145 | google_sign_in: 146 | dependency: "direct main" 147 | description: 148 | name: google_sign_in 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "5.2.4" 152 | google_sign_in_platform_interface: 153 | dependency: transitive 154 | description: 155 | name: google_sign_in_platform_interface 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "2.1.2" 159 | google_sign_in_web: 160 | dependency: transitive 161 | description: 162 | name: google_sign_in_web 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "0.10.0+5" 166 | http_parser: 167 | dependency: transitive 168 | description: 169 | name: http_parser 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "4.0.0" 173 | intl: 174 | dependency: transitive 175 | description: 176 | name: intl 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "0.17.0" 180 | js: 181 | dependency: transitive 182 | description: 183 | name: js 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "0.6.3" 187 | lints: 188 | dependency: transitive 189 | description: 190 | name: lints 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.0.1" 194 | matcher: 195 | dependency: transitive 196 | description: 197 | name: matcher 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.12.11" 201 | material_color_utilities: 202 | dependency: transitive 203 | description: 204 | name: material_color_utilities 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "0.1.3" 208 | meta: 209 | dependency: transitive 210 | description: 211 | name: meta 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "1.7.0" 215 | nested: 216 | dependency: transitive 217 | description: 218 | name: nested 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.0.0" 222 | path: 223 | dependency: transitive 224 | description: 225 | name: path 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "1.8.0" 229 | plugin_platform_interface: 230 | dependency: transitive 231 | description: 232 | name: plugin_platform_interface 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "2.1.2" 236 | provider: 237 | dependency: "direct main" 238 | description: 239 | name: provider 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "6.0.2" 243 | quiver: 244 | dependency: transitive 245 | description: 246 | name: quiver 247 | url: "https://pub.dartlang.org" 248 | source: hosted 249 | version: "3.0.1+1" 250 | sky_engine: 251 | dependency: transitive 252 | description: flutter 253 | source: sdk 254 | version: "0.0.99" 255 | source_span: 256 | dependency: transitive 257 | description: 258 | name: source_span 259 | url: "https://pub.dartlang.org" 260 | source: hosted 261 | version: "1.8.1" 262 | stack_trace: 263 | dependency: transitive 264 | description: 265 | name: stack_trace 266 | url: "https://pub.dartlang.org" 267 | source: hosted 268 | version: "1.10.0" 269 | stream_channel: 270 | dependency: transitive 271 | description: 272 | name: stream_channel 273 | url: "https://pub.dartlang.org" 274 | source: hosted 275 | version: "2.1.0" 276 | string_scanner: 277 | dependency: transitive 278 | description: 279 | name: string_scanner 280 | url: "https://pub.dartlang.org" 281 | source: hosted 282 | version: "1.1.0" 283 | term_glyph: 284 | dependency: transitive 285 | description: 286 | name: term_glyph 287 | url: "https://pub.dartlang.org" 288 | source: hosted 289 | version: "1.2.0" 290 | test_api: 291 | dependency: transitive 292 | description: 293 | name: test_api 294 | url: "https://pub.dartlang.org" 295 | source: hosted 296 | version: "0.4.8" 297 | typed_data: 298 | dependency: transitive 299 | description: 300 | name: typed_data 301 | url: "https://pub.dartlang.org" 302 | source: hosted 303 | version: "1.3.0" 304 | vector_math: 305 | dependency: transitive 306 | description: 307 | name: vector_math 308 | url: "https://pub.dartlang.org" 309 | source: hosted 310 | version: "2.1.1" 311 | sdks: 312 | dart: ">=2.16.1 <3.0.0" 313 | flutter: ">=2.5.0" 314 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: firebase_auth_demo 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.16.1 <3.0.0" 22 | 23 | # Dependencies specify other packages that your package needs in order to work. 24 | # To automatically upgrade your package dependencies to the latest versions 25 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 26 | # dependencies can be manually updated by changing the version numbers below to 27 | # the latest version available on pub.dev. To see which dependencies have newer 28 | # versions available, run `flutter pub outdated`. 29 | dependencies: 30 | cupertino_icons: ^1.0.2 31 | firebase_auth: ^3.3.12 32 | firebase_core: ^1.14.0 33 | flutter: 34 | sdk: flutter 35 | flutter_facebook_auth: ^4.1.2 36 | google_sign_in: ^5.2.4 37 | provider: ^6.0.2 38 | 39 | dev_dependencies: 40 | flutter_lints: ^1.0.0 41 | flutter_test: 42 | sdk: flutter 43 | 44 | # For information on the generic Dart part of this file, see the 45 | # following page: https://dart.dev/tools/pub/pubspec 46 | # The following section is specific to Flutter. 47 | flutter: 48 | 49 | # The following line ensures that the Material Icons font is 50 | # included with your application, so that you can use the icons in 51 | # the material Icons class. 52 | uses-material-design: true 53 | # To add assets to your application, add an assets section, like this: 54 | # assets: 55 | # - images/a_dot_burr.jpeg 56 | # - images/a_dot_ham.jpeg 57 | # An image asset can refer to one or more resolution-specific "variants", see 58 | # https://flutter.dev/assets-and-images/#resolution-aware. 59 | # For details regarding adding assets from package dependencies, see 60 | # https://flutter.dev/assets-and-images/#from-packages 61 | # To add custom fonts to your application, add a fonts section here, 62 | # in this "flutter" section. Each entry in this list should have a 63 | # "family" key with the font family name, and a "fonts" key with a 64 | # list giving the asset and other descriptors for the font. For 65 | # example: 66 | # fonts: 67 | # - family: Schyler 68 | # fonts: 69 | # - asset: fonts/Schyler-Regular.ttf 70 | # - asset: fonts/Schyler-Italic.ttf 71 | # style: italic 72 | # - family: Trajan Pro 73 | # fonts: 74 | # - asset: fonts/TrajanPro.ttf 75 | # - asset: fonts/TrajanPro_Bold.ttf 76 | # weight: 700 77 | # 78 | # For details regarding fonts from package dependencies, 79 | # see https://flutter.dev/custom-fonts/#from-packages 80 | -------------------------------------------------------------------------------- /screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/screenshot.jpg -------------------------------------------------------------------------------- /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:firebase_auth_demo/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(const 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 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | firebase_auth_demo 45 | 46 | 47 | 48 | 51 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firebase_auth_demo", 3 | "short_name": "firebase_auth_demo", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(firebase_auth_demo LANGUAGES CXX) 3 | 4 | set(BINARY_NAME "firebase_auth_demo") 5 | 6 | cmake_policy(SET CMP0063 NEW) 7 | 8 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 9 | 10 | # Configure build options. 11 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 12 | if(IS_MULTICONFIG) 13 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 14 | CACHE STRING "" FORCE) 15 | else() 16 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 17 | set(CMAKE_BUILD_TYPE "Debug" CACHE 18 | STRING "Flutter build mode" FORCE) 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 20 | "Debug" "Profile" "Release") 21 | endif() 22 | endif() 23 | 24 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 25 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 26 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 27 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 28 | 29 | # Use Unicode for all projects. 30 | add_definitions(-DUNICODE -D_UNICODE) 31 | 32 | # Compilation settings that should be applied to most targets. 33 | function(APPLY_STANDARD_SETTINGS TARGET) 34 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 35 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 36 | target_compile_options(${TARGET} PRIVATE /EHsc) 37 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 38 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 39 | endfunction() 40 | 41 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 42 | 43 | # Flutter library and tool build rules. 44 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 45 | 46 | # Application build 47 | add_subdirectory("runner") 48 | 49 | # Generated plugin build rules, which manage building the plugins and adding 50 | # them to the application. 51 | include(flutter/generated_plugins.cmake) 52 | 53 | 54 | # === Installation === 55 | # Support files are copied into place next to the executable, so that it can 56 | # run in place. This is done instead of making a separate bundle (as on Linux) 57 | # so that building and running from within Visual Studio will work. 58 | set(BUILD_BUNDLE_DIR "$") 59 | # Make the "install" step default, as it's required to run. 60 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 61 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 62 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 63 | endif() 64 | 65 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 66 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 67 | 68 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 69 | COMPONENT Runtime) 70 | 71 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 72 | COMPONENT Runtime) 73 | 74 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 75 | COMPONENT Runtime) 76 | 77 | if(PLUGIN_BUNDLED_LIBRARIES) 78 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 79 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 80 | COMPONENT Runtime) 81 | endif() 82 | 83 | # Fully re-copy the assets directory on each build to avoid having stale files 84 | # from a previous install. 85 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 86 | install(CODE " 87 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 88 | " COMPONENT Runtime) 89 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 90 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 91 | 92 | # Install the AOT library on non-Debug builds only. 93 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 94 | CONFIGURATIONS Profile;Release 95 | COMPONENT Runtime) 96 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 11 | 12 | # === Flutter Library === 13 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 14 | 15 | # Published to parent scope for install step. 16 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 17 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 18 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 19 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 20 | 21 | list(APPEND FLUTTER_LIBRARY_HEADERS 22 | "flutter_export.h" 23 | "flutter_windows.h" 24 | "flutter_messenger.h" 25 | "flutter_plugin_registrar.h" 26 | "flutter_texture_registrar.h" 27 | ) 28 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 29 | add_library(flutter INTERFACE) 30 | target_include_directories(flutter INTERFACE 31 | "${EPHEMERAL_DIR}" 32 | ) 33 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 34 | add_dependencies(flutter flutter_assemble) 35 | 36 | # === Wrapper === 37 | list(APPEND CPP_WRAPPER_SOURCES_CORE 38 | "core_implementations.cc" 39 | "standard_codec.cc" 40 | ) 41 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 42 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 43 | "plugin_registrar.cc" 44 | ) 45 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 46 | list(APPEND CPP_WRAPPER_SOURCES_APP 47 | "flutter_engine.cc" 48 | "flutter_view_controller.cc" 49 | ) 50 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 51 | 52 | # Wrapper sources needed for a plugin. 53 | add_library(flutter_wrapper_plugin STATIC 54 | ${CPP_WRAPPER_SOURCES_CORE} 55 | ${CPP_WRAPPER_SOURCES_PLUGIN} 56 | ) 57 | apply_standard_settings(flutter_wrapper_plugin) 58 | set_target_properties(flutter_wrapper_plugin PROPERTIES 59 | POSITION_INDEPENDENT_CODE ON) 60 | set_target_properties(flutter_wrapper_plugin PROPERTIES 61 | CXX_VISIBILITY_PRESET hidden) 62 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 63 | target_include_directories(flutter_wrapper_plugin PUBLIC 64 | "${WRAPPER_ROOT}/include" 65 | ) 66 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 67 | 68 | # Wrapper sources needed for the runner. 69 | add_library(flutter_wrapper_app STATIC 70 | ${CPP_WRAPPER_SOURCES_CORE} 71 | ${CPP_WRAPPER_SOURCES_APP} 72 | ) 73 | apply_standard_settings(flutter_wrapper_app) 74 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 75 | target_include_directories(flutter_wrapper_app PUBLIC 76 | "${WRAPPER_ROOT}/include" 77 | ) 78 | add_dependencies(flutter_wrapper_app flutter_assemble) 79 | 80 | # === Flutter tool backend === 81 | # _phony_ is a non-existent file to force this command to run every time, 82 | # since currently there's no way to get a full input/output list from the 83 | # flutter tool. 84 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 85 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 86 | add_custom_command( 87 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 88 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 89 | ${CPP_WRAPPER_SOURCES_APP} 90 | ${PHONY_OUTPUT} 91 | COMMAND ${CMAKE_COMMAND} -E env 92 | ${FLUTTER_TOOL_ENVIRONMENT} 93 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 94 | windows-x64 $ 95 | VERBATIM 96 | ) 97 | add_custom_target(flutter_assemble DEPENDS 98 | "${FLUTTER_LIBRARY}" 99 | ${FLUTTER_LIBRARY_HEADERS} 100 | ${CPP_WRAPPER_SOURCES_CORE} 101 | ${CPP_WRAPPER_SOURCES_PLUGIN} 102 | ${CPP_WRAPPER_SOURCES_APP} 103 | ) 104 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | set(PLUGIN_BUNDLED_LIBRARIES) 9 | 10 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 11 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 12 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 13 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 14 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 15 | endforeach(plugin) 16 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "utils.cpp" 8 | "win32_window.cpp" 9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 10 | "Runner.rc" 11 | "runner.exe.manifest" 12 | ) 13 | apply_standard_settings(${BINARY_NAME}) 14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 17 | add_dependencies(${BINARY_NAME} flutter_assemble) 18 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #ifdef FLUTTER_BUILD_NUMBER 64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0 67 | #endif 68 | 69 | #ifdef FLUTTER_BUILD_NAME 70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "firebase_auth_demo" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "firebase_auth_demo" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "firebase_auth_demo.exe" "\0" 98 | VALUE "ProductName", "firebase_auth_demo" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"firebase_auth_demo", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RivaanRanawat/flutter-firebase-auth/0045daeb15f1ff8e6d89d89abd9809947d99b337/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | if (!window) { 126 | return false; 127 | } 128 | 129 | return OnCreate(); 130 | } 131 | 132 | // static 133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 134 | UINT const message, 135 | WPARAM const wparam, 136 | LPARAM const lparam) noexcept { 137 | if (message == WM_NCCREATE) { 138 | auto window_struct = reinterpret_cast(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(window_struct->lpCreateParams); 143 | EnableFullDpiSupportIfAvailable(window); 144 | that->window_handle_ = window; 145 | } else if (Win32Window* that = GetThisFromHandle(window)) { 146 | return that->MessageHandler(window, message, wparam, lparam); 147 | } 148 | 149 | return DefWindowProc(window, message, wparam, lparam); 150 | } 151 | 152 | LRESULT 153 | Win32Window::MessageHandler(HWND hwnd, 154 | UINT const message, 155 | WPARAM const wparam, 156 | LPARAM const lparam) noexcept { 157 | switch (message) { 158 | case WM_DESTROY: 159 | window_handle_ = nullptr; 160 | Destroy(); 161 | if (quit_on_close_) { 162 | PostQuitMessage(0); 163 | } 164 | return 0; 165 | 166 | case WM_DPICHANGED: { 167 | auto newRectSize = reinterpret_cast(lparam); 168 | LONG newWidth = newRectSize->right - newRectSize->left; 169 | LONG newHeight = newRectSize->bottom - newRectSize->top; 170 | 171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 173 | 174 | return 0; 175 | } 176 | case WM_SIZE: { 177 | RECT rect = GetClientArea(); 178 | if (child_content_ != nullptr) { 179 | // Size and position the child window. 180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 181 | rect.bottom - rect.top, TRUE); 182 | } 183 | return 0; 184 | } 185 | 186 | case WM_ACTIVATE: 187 | if (child_content_ != nullptr) { 188 | SetFocus(child_content_); 189 | } 190 | return 0; 191 | } 192 | 193 | return DefWindowProc(window_handle_, message, wparam, lparam); 194 | } 195 | 196 | void Win32Window::Destroy() { 197 | OnDestroy(); 198 | 199 | if (window_handle_) { 200 | DestroyWindow(window_handle_); 201 | window_handle_ = nullptr; 202 | } 203 | if (g_active_window_count == 0) { 204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 205 | } 206 | } 207 | 208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 209 | return reinterpret_cast( 210 | GetWindowLongPtr(window, GWLP_USERDATA)); 211 | } 212 | 213 | void Win32Window::SetChildContent(HWND content) { 214 | child_content_ = content; 215 | SetParent(content, window_handle_); 216 | RECT frame = GetClientArea(); 217 | 218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 219 | frame.bottom - frame.top, true); 220 | 221 | SetFocus(child_content_); 222 | } 223 | 224 | RECT Win32Window::GetClientArea() { 225 | RECT frame; 226 | GetClientRect(window_handle_, &frame); 227 | return frame; 228 | } 229 | 230 | HWND Win32Window::GetHandle() { 231 | return window_handle_; 232 | } 233 | 234 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 235 | quit_on_close_ = quit_on_close; 236 | } 237 | 238 | bool Win32Window::OnCreate() { 239 | // No-op; provided for subclasses. 240 | return true; 241 | } 242 | 243 | void Win32Window::OnDestroy() { 244 | // No-op; provided for subclasses. 245 | } 246 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | --------------------------------------------------------------------------------