├── test
└── widget_test.dart
├── ios
├── Flutter
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── AppFrameworkInfo.plist
├── Runner
│ ├── Runner-Bridging-Header.h
│ ├── Assets.xcassets
│ │ ├── LaunchImage.imageset
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ ├── README.md
│ │ │ └── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ └── Contents.json
│ ├── AppDelegate.swift
│ ├── GoogleService-Info.plist
│ ├── Base.lproj
│ │ ├── Main.storyboard
│ │ └── LaunchScreen.storyboard
│ └── Info.plist
├── Runner.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── xcshareddata
│ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ └── project.pbxproj
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
├── RunnerTests
│ └── RunnerTests.swift
└── .gitignore
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── manifest.json
└── index.html
├── android
├── gradle.properties
├── app
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable-v21
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── values-night
│ │ │ │ │ └── styles.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── flutter_firebase
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── AndroidManifest.xml
│ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── google-services.json
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
└── build.gradle
├── lib
├── global
│ └── common
│ │ └── toast.dart
├── features
│ ├── app
│ │ └── splash_screen
│ │ │ └── splash_screen.dart
│ └── user_auth
│ │ ├── firebase_auth_implementation
│ │ └── firebase_auth_services.dart
│ │ └── presentation
│ │ ├── widgets
│ │ └── form_container_widget.dart
│ │ └── pages
│ │ ├── sign_up_page.dart
│ │ ├── home_page.dart
│ │ └── login_page.dart
└── main.dart
├── README.md
├── .gitignore
├── .metadata
├── pubspec.yaml
└── pubspec.lock
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/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/hassank185/Flutter-Firebase-Series/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hassank185/Flutter-Firebase-Series/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/flutter_firebase/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_firebase
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.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/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lib/global/common/toast.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:fluttertoast/fluttertoast.dart';
5 |
6 | void showToast({required String message}){
7 | Fluttertoast.showToast(
8 | msg: message,
9 | toastLength: Toast.LENGTH_SHORT,
10 | gravity: ToastGravity.BOTTOM,
11 | timeInSecForIosWeb: 1,
12 | backgroundColor: Colors.blue,
13 | textColor: Colors.white,
14 | fontSize: 16.0
15 | );
16 | }
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # flutter_firebase
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.4.2'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | classpath "com.google.gms:google-services:4.3.15"
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | rootProject.buildDir = '../build'
23 | subprojects {
24 | project.buildDir = "${rootProject.buildDir}/${project.name}"
25 | }
26 | subprojects {
27 | project.evaluationDependsOn(':app')
28 | }
29 |
30 | tasks.register("clean", Delete) {
31 | delete rootProject.buildDir
32 | }
33 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/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 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/lib/features/app/splash_screen/splash_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 |
4 | class SplashScreen extends StatefulWidget {
5 | final Widget? child;
6 | const SplashScreen({super.key, this.child});
7 |
8 | @override
9 | State createState() => _SplashScreenState();
10 | }
11 |
12 | class _SplashScreenState extends State {
13 |
14 | @override
15 | void initState() {
16 | Future.delayed(
17 | Duration(seconds: 3),(){
18 | Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => widget.child!), (route) => false);
19 | }
20 | );
21 | super.initState();
22 | }
23 |
24 |
25 | @override
26 | Widget build(BuildContext context) {
27 | return Scaffold(
28 | body: Center(
29 | child: Text(
30 | "Welcome To Flutter Firebase",
31 | style: TextStyle(
32 | color: Colors.blue,
33 | fontWeight: FontWeight.bold,
34 | ),
35 | ),
36 | ),
37 | );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "flutter_firebase",
3 | "short_name": "flutter_firebase",
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 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/ios/Runner/GoogleService-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CLIENT_ID
6 | 540215271818-3jpu0ibjl06r0qk7k4p0d2s1aiufjct9.apps.googleusercontent.com
7 | REVERSED_CLIENT_ID
8 | com.googleusercontent.apps.540215271818-3jpu0ibjl06r0qk7k4p0d2s1aiufjct9
9 | API_KEY
10 | AIzaSyBGNwXR0fx5RbqL2ZL3VYzMtqqDx84LwsM
11 | GCM_SENDER_ID
12 | 540215271818
13 | PLIST_VERSION
14 | 1
15 | BUNDLE_ID
16 | com.example.flutterFirebase
17 | PROJECT_ID
18 | flutter-firebase-9c136
19 | STORAGE_BUCKET
20 | flutter-firebase-9c136.appspot.com
21 | IS_ADS_ENABLED
22 |
23 | IS_ANALYTICS_ENABLED
24 |
25 | IS_APPINVITE_ENABLED
26 |
27 | IS_GCM_ENABLED
28 |
29 | IS_SIGNIN_ENABLED
30 |
31 | GOOGLE_APP_ID
32 | 1:540215271818:ios:74a50b3fd0ffb212862873
33 |
34 |
--------------------------------------------------------------------------------
/.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.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
18 | - platform: android
19 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
20 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
21 | - platform: ios
22 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
23 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
24 | - platform: web
25 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
26 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
27 |
28 | # User provided section
29 |
30 | # List of Local paths (relative to this file) that should be
31 | # ignored by the migrate tool.
32 | #
33 | # Files that are not part of the templates will be ignored by default.
34 | unmanaged_files:
35 | - 'lib/main.dart'
36 | - 'ios/Runner.xcodeproj/project.pbxproj'
37 |
--------------------------------------------------------------------------------
/android/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "540215271818",
4 | "project_id": "flutter-firebase-9c136",
5 | "storage_bucket": "flutter-firebase-9c136.appspot.com"
6 | },
7 | "client": [
8 | {
9 | "client_info": {
10 | "mobilesdk_app_id": "1:540215271818:android:bd26adbe54778a45862873",
11 | "android_client_info": {
12 | "package_name": "com.example.flutter_firebase"
13 | }
14 | },
15 | "oauth_client": [
16 | {
17 | "client_id": "540215271818-1a5pvogkun9iaaaq5e39o43hnlt7sum5.apps.googleusercontent.com",
18 | "client_type": 3
19 | }
20 | ],
21 | "api_key": [
22 | {
23 | "current_key": "AIzaSyCnOD3ETuQGVkPSiTSsiZewWPCGaJLe6mk"
24 | }
25 | ],
26 | "services": {
27 | "appinvite_service": {
28 | "other_platform_oauth_client": [
29 | {
30 | "client_id": "540215271818-1a5pvogkun9iaaaq5e39o43hnlt7sum5.apps.googleusercontent.com",
31 | "client_type": 3
32 | },
33 | {
34 | "client_id": "540215271818-3jpu0ibjl06r0qk7k4p0d2s1aiufjct9.apps.googleusercontent.com",
35 | "client_type": 2,
36 | "ios_info": {
37 | "bundle_id": "com.example.flutterFirebase"
38 | }
39 | }
40 | ]
41 | }
42 | }
43 | }
44 | ],
45 | "configuration_version": "1"
46 | }
--------------------------------------------------------------------------------
/lib/features/user_auth/firebase_auth_implementation/firebase_auth_services.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | import 'package:firebase_auth/firebase_auth.dart';
6 |
7 | import '../../../global/common/toast.dart';
8 |
9 |
10 | class FirebaseAuthService {
11 |
12 | FirebaseAuth _auth = FirebaseAuth.instance;
13 |
14 | Future signUpWithEmailAndPassword(String email, String password) async {
15 |
16 | try {
17 | UserCredential credential =await _auth.createUserWithEmailAndPassword(email: email, password: password);
18 | return credential.user;
19 | } on FirebaseAuthException catch (e) {
20 |
21 | if (e.code == 'email-already-in-use') {
22 | showToast(message: 'The email address is already in use.');
23 | } else {
24 | showToast(message: 'An error occurred: ${e.code}');
25 | }
26 | }
27 | return null;
28 |
29 | }
30 |
31 | Future signInWithEmailAndPassword(String email, String password) async {
32 |
33 | try {
34 | UserCredential credential =await _auth.signInWithEmailAndPassword(email: email, password: password);
35 | return credential.user;
36 | } on FirebaseAuthException catch (e) {
37 | if (e.code == 'user-not-found' || e.code == 'wrong-password') {
38 | showToast(message: 'Invalid email or password.');
39 | } else {
40 | showToast(message: 'An error occurred: ${e.code}');
41 | }
42 |
43 | }
44 | return null;
45 |
46 | }
47 |
48 |
49 |
50 |
51 | }
52 |
53 |
54 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_core/firebase_core.dart';
2 | import 'package:flutter/foundation.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:firebase_auth/firebase_auth.dart'; // Import Firebase Auth
5 | import 'package:flutter_firebase/features/app/splash_screen/splash_screen.dart';
6 | import 'package:flutter_firebase/features/user_auth/presentation/pages/home_page.dart';
7 | import 'package:flutter_firebase/features/user_auth/presentation/pages/login_page.dart';
8 | import 'package:flutter_firebase/features/user_auth/presentation/pages/sign_up_page.dart';
9 |
10 | Future main() async {
11 | WidgetsFlutterBinding.ensureInitialized();
12 | if (kIsWeb) {
13 | await Firebase.initializeApp(
14 | options: FirebaseOptions(
15 | apiKey: "AIzaSyCsHDQtI9DItQgSqwy45_y2xG9tDGxuER8",
16 | appId: "1:540215271818:web:8b22d4aee01acdce862873",
17 | messagingSenderId: "540215271818",
18 | projectId: "flutter-firebase-9c136",
19 | // Your web Firebase config options
20 | ),
21 | );
22 | } else {
23 | await Firebase.initializeApp();
24 | }
25 | runApp(MyApp());
26 | }
27 |
28 | class MyApp extends StatelessWidget {
29 | @override
30 | Widget build(BuildContext context) {
31 |
32 | return MaterialApp(
33 | debugShowCheckedModeBanner: false,
34 | title: 'Flutter Firebase',
35 | routes: {
36 | '/': (context) => SplashScreen(
37 | // Here, you can decide whether to show the LoginPage or HomePage based on user authentication
38 | child: LoginPage(),
39 | ),
40 | '/login': (context) => LoginPage(),
41 | '/signUp': (context) => SignUpPage(),
42 | '/home': (context) => HomePage(),
43 | },
44 | );
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Flutter Firebase
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_firebase
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 | CADisableMinimumFrameDurationOnPhone
47 |
48 | UIApplicationSupportsIndirectInputEvents
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | flutter_firebase
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/features/user_auth/presentation/widgets/form_container_widget.dart:
--------------------------------------------------------------------------------
1 |
2 |
3 | import 'package:flutter/material.dart';
4 |
5 |
6 | class FormContainerWidget extends StatefulWidget {
7 |
8 | final TextEditingController? controller;
9 | final Key? fieldKey;
10 | final bool? isPasswordField;
11 | final String? hintText;
12 | final String? labelText;
13 | final String? helperText;
14 | final FormFieldSetter? onSaved;
15 | final FormFieldValidator? validator;
16 | final ValueChanged? onFieldSubmitted;
17 | final TextInputType? inputType;
18 |
19 | const FormContainerWidget({
20 | this.controller,
21 | this.isPasswordField,
22 | this.fieldKey,
23 | this.hintText,
24 | this.labelText,
25 | this.helperText,
26 | this.onSaved,
27 | this.validator,
28 | this.onFieldSubmitted,
29 | this.inputType
30 | });
31 |
32 |
33 | @override
34 | _FormContainerWidgetState createState() => new _FormContainerWidgetState();
35 | }
36 |
37 | class _FormContainerWidgetState extends State {
38 |
39 | bool _obscureText = true;
40 |
41 |
42 | @override
43 | Widget build(BuildContext context) {
44 | return Container(
45 | width: double.infinity,
46 | clipBehavior: Clip.hardEdge,
47 | decoration: BoxDecoration(
48 | color: Colors.grey.withOpacity(.35),
49 | borderRadius: BorderRadius.circular(10),
50 | ),
51 | child: new TextFormField(
52 | style: TextStyle(color: Colors.black),
53 | controller: widget.controller,
54 | keyboardType: widget.inputType,
55 | key: widget.fieldKey,
56 | obscureText: widget.isPasswordField == true? _obscureText : false,
57 | onSaved: widget.onSaved,
58 | validator: widget.validator,
59 | onFieldSubmitted: widget.onFieldSubmitted,
60 | decoration: new InputDecoration(
61 | border: InputBorder.none,
62 | filled: true,
63 | hintText: widget.hintText,
64 | hintStyle: TextStyle(color: Colors.black45),
65 | suffixIcon: new GestureDetector(
66 | onTap: () {
67 | setState(() {
68 | _obscureText = !_obscureText;
69 | });
70 | },
71 | child:
72 | widget.isPasswordField==true? Icon(_obscureText ? Icons.visibility_off : Icons.visibility, color: _obscureText == false ? Colors.blue : Colors.grey,) : Text(""),
73 | ),
74 | ),
75 | ),
76 | );
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/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 | apply plugin: "com.google.gms.google-services"
28 |
29 | android {
30 | namespace "com.example.flutter_firebase"
31 | compileSdkVersion flutter.compileSdkVersion
32 | ndkVersion flutter.ndkVersion
33 |
34 | compileOptions {
35 | sourceCompatibility JavaVersion.VERSION_1_8
36 | targetCompatibility JavaVersion.VERSION_1_8
37 | }
38 |
39 | kotlinOptions {
40 | jvmTarget = '1.8'
41 | }
42 |
43 | sourceSets {
44 | main.java.srcDirs += 'src/main/kotlin'
45 | }
46 |
47 | defaultConfig {
48 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
49 | applicationId "com.example.flutter_firebase"
50 | // You can update the following values to match your application needs.
51 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
52 | minSdkVersion 21
53 | targetSdkVersion flutter.targetSdkVersion
54 | versionCode flutterVersionCode.toInteger()
55 | versionName flutterVersionName
56 | }
57 |
58 | buildTypes {
59 | release {
60 | // TODO: Add your own signing config for the release build.
61 | // Signing with the debug keys for now, so `flutter run --release` works.
62 | signingConfig signingConfigs.debug
63 | }
64 | }
65 | }
66 |
67 | flutter {
68 | source '../..'
69 | }
70 |
71 | dependencies {
72 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
73 | }
74 |
--------------------------------------------------------------------------------
/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.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
53 |
63 |
65 |
71 |
72 |
73 |
74 |
80 |
82 |
88 |
89 |
90 |
91 |
93 |
94 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutter_firebase
2 | description: A new Flutter project.
3 | # The following line prevents the package from being accidentally published to
4 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
6 |
7 | # The following defines the version and build number for your application.
8 | # A version number is three numbers separated by dots, like 1.2.43
9 | # followed by an optional build number separated by a +.
10 | # Both the version and the builder number may be overridden in flutter
11 | # build by specifying --build-name and --build-number, respectively.
12 | # In Android, build-name is used as versionName while build-number used as versionCode.
13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
15 | # Read more about iOS versioning at
16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17 | # In Windows, build-name is used as the major, minor, and patch parts
18 | # of the product and file versions while build-number is used as the build suffix.
19 | version: 1.0.0+1
20 |
21 | environment:
22 | sdk: '>=3.0.5 <4.0.0'
23 |
24 | # Dependencies specify other packages that your package needs in order to work.
25 | # To automatically upgrade your package dependencies to the latest versions
26 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
27 | # dependencies can be manually updated by changing the version numbers below to
28 | # the latest version available on pub.dev. To see which dependencies have newer
29 | # versions available, run `flutter pub outdated`.
30 | dependencies:
31 | flutter:
32 | sdk: flutter
33 |
34 |
35 | # The following adds the Cupertino Icons font to your application.
36 | # Use with the CupertinoIcons class for iOS style icons.
37 | cupertino_icons: ^1.0.2
38 | firebase_core: any
39 | cloud_firestore: ^4.8.2
40 | firebase_auth: ^4.6.3
41 | firebase_storage: ^11.2.4
42 | fluttertoast: ^8.2.2
43 | font_awesome_flutter: ^10.6.0
44 | google_sign_in: ^6.1.5
45 |
46 | dev_dependencies:
47 | flutter_test:
48 | sdk: flutter
49 |
50 | # The "flutter_lints" package below contains a set of recommended lints to
51 | # encourage good coding practices. The lint set provided by the package is
52 | # activated in the `analysis_options.yaml` file located at the root of your
53 | # package. See that file for information about deactivating specific lint
54 | # rules and activating additional ones.
55 | flutter_lints: ^2.0.0
56 |
57 | # For information on the generic Dart part of this file, see the
58 | # following page: https://dart.dev/tools/pub/pubspec
59 |
60 | # The following section is specific to Flutter packages.
61 | flutter:
62 |
63 | # The following line ensures that the Material Icons font is
64 | # included with your application, so that you can use the icons in
65 | # the material Icons class.
66 | uses-material-design: true
67 |
68 | # To add assets to your application, add an assets section, like this:
69 | # assets:
70 | # - images/a_dot_burr.jpeg
71 | # - images/a_dot_ham.jpeg
72 |
73 | # An image asset can refer to one or more resolution-specific "variants", see
74 | # https://flutter.dev/assets-and-images/#resolution-aware
75 |
76 | # For details regarding adding assets from package dependencies, see
77 | # https://flutter.dev/assets-and-images/#from-packages
78 |
79 | # To add custom fonts to your application, add a fonts section here,
80 | # in this "flutter" section. Each entry in this list should have a
81 | # "family" key with the font family name, and a "fonts" key with a
82 | # list giving the asset and other descriptors for the font. For
83 | # example:
84 | # fonts:
85 | # - family: Schyler
86 | # fonts:
87 | # - asset: fonts/Schyler-Regular.ttf
88 | # - asset: fonts/Schyler-Italic.ttf
89 | # style: italic
90 | # - family: Trajan Pro
91 | # fonts:
92 | # - asset: fonts/TrajanPro.ttf
93 | # - asset: fonts/TrajanPro_Bold.ttf
94 | # weight: 700
95 | #
96 | # For details regarding fonts from package dependencies,
97 | # see https://flutter.dev/custom-fonts/#from-packages
98 |
--------------------------------------------------------------------------------
/lib/features/user_auth/presentation/pages/sign_up_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_auth/firebase_auth.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter_firebase/features/user_auth/firebase_auth_implementation/firebase_auth_services.dart';
4 | import 'package:flutter_firebase/features/user_auth/presentation/pages/login_page.dart';
5 | import 'package:flutter_firebase/features/user_auth/presentation/widgets/form_container_widget.dart';
6 | import 'package:flutter_firebase/global/common/toast.dart';
7 |
8 | class SignUpPage extends StatefulWidget {
9 | const SignUpPage({super.key});
10 |
11 | @override
12 | State createState() => _SignUpPageState();
13 | }
14 |
15 | class _SignUpPageState extends State {
16 | final FirebaseAuthService _auth = FirebaseAuthService();
17 |
18 | TextEditingController _usernameController = TextEditingController();
19 | TextEditingController _emailController = TextEditingController();
20 | TextEditingController _passwordController = TextEditingController();
21 |
22 | bool isSigningUp = false;
23 |
24 | @override
25 | void dispose() {
26 | _usernameController.dispose();
27 | _emailController.dispose();
28 | _passwordController.dispose();
29 | super.dispose();
30 | }
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | return Scaffold(
35 | appBar: AppBar(
36 | automaticallyImplyLeading: false,
37 | title: Text("SignUp"),
38 | ),
39 | body: Center(
40 | child: Padding(
41 | padding: const EdgeInsets.symmetric(horizontal: 15),
42 | child: Column(
43 | mainAxisAlignment: MainAxisAlignment.center,
44 | children: [
45 | Text(
46 | "Sign Up",
47 | style: TextStyle(fontSize: 27, fontWeight: FontWeight.bold),
48 | ),
49 | SizedBox(
50 | height: 30,
51 | ),
52 | FormContainerWidget(
53 | controller: _usernameController,
54 | hintText: "Username",
55 | isPasswordField: false,
56 | ),
57 | SizedBox(
58 | height: 10,
59 | ),
60 | FormContainerWidget(
61 | controller: _emailController,
62 | hintText: "Email",
63 | isPasswordField: false,
64 | ),
65 | SizedBox(
66 | height: 10,
67 | ),
68 | FormContainerWidget(
69 | controller: _passwordController,
70 | hintText: "Password",
71 | isPasswordField: true,
72 | ),
73 | SizedBox(
74 | height: 30,
75 | ),
76 | GestureDetector(
77 | onTap: (){
78 | _signUp();
79 |
80 | },
81 | child: Container(
82 | width: double.infinity,
83 | height: 45,
84 | decoration: BoxDecoration(
85 | color: Colors.blue,
86 | borderRadius: BorderRadius.circular(10),
87 | ),
88 | child: Center(
89 | child: isSigningUp ? CircularProgressIndicator(color: Colors.white,):Text(
90 | "Sign Up",
91 | style: TextStyle(
92 | color: Colors.white, fontWeight: FontWeight.bold),
93 | )),
94 | ),
95 | ),
96 | SizedBox(
97 | height: 20,
98 | ),
99 | Row(
100 | mainAxisAlignment: MainAxisAlignment.center,
101 | children: [
102 | Text("Already have an account?"),
103 | SizedBox(
104 | width: 5,
105 | ),
106 | GestureDetector(
107 | onTap: () {
108 | Navigator.pushAndRemoveUntil(
109 | context,
110 | MaterialPageRoute(
111 | builder: (context) => LoginPage()),
112 | (route) => false);
113 | },
114 | child: Text(
115 | "Login",
116 | style: TextStyle(
117 | color: Colors.blue, fontWeight: FontWeight.bold),
118 | ))
119 | ],
120 | )
121 | ],
122 | ),
123 | ),
124 | ),
125 | );
126 | }
127 |
128 | void _signUp() async {
129 |
130 | setState(() {
131 | isSigningUp = true;
132 | });
133 |
134 | String username = _usernameController.text;
135 | String email = _emailController.text;
136 | String password = _passwordController.text;
137 |
138 | User? user = await _auth.signUpWithEmailAndPassword(email, password);
139 |
140 | setState(() {
141 | isSigningUp = false;
142 | });
143 | if (user != null) {
144 | showToast(message: "User is successfully created");
145 | Navigator.pushNamed(context, "/home");
146 | } else {
147 | showToast(message: "Some error happend");
148 | }
149 | }
150 | }
151 |
--------------------------------------------------------------------------------
/lib/features/user_auth/presentation/pages/home_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:ffi';
2 |
3 | import 'package:cloud_firestore/cloud_firestore.dart';
4 | import 'package:firebase_auth/firebase_auth.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:fluttertoast/fluttertoast.dart';
7 |
8 | import '../../../../global/common/toast.dart';
9 |
10 | class HomePage extends StatefulWidget {
11 | const HomePage({super.key});
12 |
13 | @override
14 | State createState() => _HomePageState();
15 | }
16 |
17 | class _HomePageState extends State {
18 | @override
19 | Widget build(BuildContext context) {
20 | return Scaffold(
21 | appBar: AppBar(
22 | automaticallyImplyLeading: false,
23 | title: Text("HomePage"),
24 | ),
25 | body: Center(
26 | child: Column(
27 | mainAxisAlignment: MainAxisAlignment.center,
28 | children: [
29 | GestureDetector(
30 | onTap: () {
31 | _createData(UserModel(
32 | username: "Henry",
33 | age: 21,
34 | adress: "London",
35 | ));
36 | },
37 | child: Container(
38 | height: 45,
39 | width: 100,
40 | decoration: BoxDecoration(
41 | color: Colors.blue,
42 | borderRadius: BorderRadius.circular(10)),
43 | child: Center(
44 | child: Text(
45 | "Create Data",
46 | style: TextStyle(
47 | color: Colors.white,
48 | fontWeight: FontWeight.bold,
49 | fontSize: 18),
50 | ),
51 | ),
52 | ),
53 | ),
54 | SizedBox(height: 10),
55 | StreamBuilder>(
56 | stream: _readData(),
57 | builder: (context, snapshot) {
58 | if(snapshot.connectionState == ConnectionState.waiting){
59 | return Center(child: CircularProgressIndicator(),);
60 | } if(snapshot.data!.isEmpty){
61 | return Center(child:Text("No Data Yet"));
62 | }
63 | final users = snapshot.data;
64 | return Padding(padding: EdgeInsets.all(8),
65 | child: Column(
66 | children: users!.map((user) {
67 | return ListTile(
68 | leading: GestureDetector(
69 | onTap: (){
70 | _deleteData(user.id!);
71 | },
72 | child: Icon(Icons.delete),
73 | ),
74 | trailing: GestureDetector(
75 | onTap: (){
76 | _updateData(
77 | UserModel(
78 | id: user.id,
79 | username: "John Wick",
80 | adress: "Pakistan",)
81 | );
82 | },
83 | child: Icon(Icons.update),
84 | ),
85 | title: Text(user.username!),
86 | subtitle: Text(user.adress!),
87 | );
88 | }).toList()
89 | ),);
90 | }
91 | ),
92 |
93 | GestureDetector(
94 | onTap: () {
95 | FirebaseAuth.instance.signOut();
96 | Navigator.pushNamed(context, "/login");
97 | showToast(message: "Successfully signed out");
98 | },
99 | child: Container(
100 | height: 45,
101 | width: 100,
102 | decoration: BoxDecoration(
103 | color: Colors.blue,
104 | borderRadius: BorderRadius.circular(10)),
105 | child: Center(
106 | child: Text(
107 | "Sign out",
108 | style: TextStyle(
109 | color: Colors.white,
110 | fontWeight: FontWeight.bold,
111 | fontSize: 18),
112 | ),
113 | ),
114 | ),
115 | )
116 | ],
117 | ),
118 | ));
119 | }
120 |
121 | Stream> _readData(){
122 | final userCollection = FirebaseFirestore.instance.collection("users");
123 |
124 | return userCollection.snapshots().map((qureySnapshot)
125 | => qureySnapshot.docs.map((e)
126 | => UserModel.fromSnapshot(e),).toList());
127 | }
128 |
129 | void _createData(UserModel userModel) {
130 | final userCollection = FirebaseFirestore.instance.collection("users");
131 |
132 | String id = userCollection.doc().id;
133 |
134 | final newUser = UserModel(
135 | username: userModel.username,
136 | age: userModel.age,
137 | adress: userModel.adress,
138 | id: id,
139 | ).toJson();
140 |
141 | userCollection.doc(id).set(newUser);
142 | }
143 |
144 | void _updateData(UserModel userModel) {
145 | final userCollection = FirebaseFirestore.instance.collection("users");
146 |
147 | final newData = UserModel(
148 | username: userModel.username,
149 | id: userModel.id,
150 | adress: userModel.adress,
151 | age: userModel.age,
152 | ).toJson();
153 |
154 | userCollection.doc(userModel.id).update(newData);
155 |
156 | }
157 |
158 | void _deleteData(String id) {
159 | final userCollection = FirebaseFirestore.instance.collection("users");
160 |
161 | userCollection.doc(id).delete();
162 |
163 | }
164 |
165 | }
166 |
167 | class UserModel{
168 | final String? username;
169 | final String? adress;
170 | final int? age;
171 | final String? id;
172 |
173 | UserModel({this.id,this.username, this.adress, this.age});
174 |
175 |
176 | static UserModel fromSnapshot(DocumentSnapshot