Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mergin signin and signout fix with rest of the code
  • Loading branch information
AKACHI-4 committed Jul 5, 2024
2 parents f972461 + caac7be commit ac2ca20
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 104 deletions.
23 changes: 15 additions & 8 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'com.android.application'
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
// END: FlutterFire Configuration
id 'org.jetbrains.kotlin.android'
id 'dev.flutter.flutter-gradle-plugin'
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
Expand All @@ -28,7 +33,7 @@ if (flutterVersionName == null) {
}

android {
namespace "app.guardiancare.guardiancare"
namespace 'app.guardiancare.guardiancare'
compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

Expand All @@ -46,10 +51,7 @@ android {
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "app.guardiancare.guardiancare"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
applicationId 'app.guardiancare.guardiancare'
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
Expand Down Expand Up @@ -80,4 +82,9 @@ flutter {

dependencies {
implementation 'com.android.support:multidex:2.0.1'
implementation 'com.google.firebase:firebase-analytics:21.2.0'
implementation 'com.google.firebase:firebase-crashlytics:18.3.4'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
124 changes: 38 additions & 86 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,115 +15,67 @@
},
"oauth_client": [
{
"client_id": "331315801686-f57icrckmccqe3mu1airrgtpvho4lcva.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBiK-huaMXXmnI4M0LxYNtH5NasP1o1iHQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "331315801686-f57icrckmccqe3mu1airrgtpvho4lcva.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "331315801686-4h0llgi3p79eam8n5bt5vhm735plbg7h.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.guardiancare.guardiancare"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:331315801686:android:2ccec823b12f12427595f7",
"android_client_info": {
"package_name": "com.example.ucs"
}
},
"oauth_client": [
"client_id": "331315801686-01tinu5ukqe35u4ivvn3fqo4ju59pp1d.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "44c08d8c3d262ccba519a90bf3555cf4713be50c"
}
},
{
"client_id": "331315801686-f57icrckmccqe3mu1airrgtpvho4lcva.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
"client_id": "331315801686-1mr3s7qkrhj9uqtn9bi7dhh0fnp9r20d.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "c5a62fbad0d38a905555529aee88a55e09d3ac55"
}
},
{
"current_key": "AIzaSyBiK-huaMXXmnI4M0LxYNtH5NasP1o1iHQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "331315801686-f57icrckmccqe3mu1airrgtpvho4lcva.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "331315801686-4h0llgi3p79eam8n5bt5vhm735plbg7h.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.guardiancare.guardiancare"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:331315801686:android:28c596f9e2e592e17595f7",
"android_client_info": {
"package_name": "com.guardiancare.guardiancare"
}
},
"oauth_client": [
"client_id": "331315801686-348dmi3hq6pkotld4f5ndq89l04d74r6.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "3d3c6dc81ac1e959dae5e226eca38d758cda23a9"
}
},
{
"client_id": "331315801686-4co8knverqologscscu70sip0c3iqqd3.apps.googleusercontent.com",
"client_id": "331315801686-45b6j5md37mdnpjd0fmi036rlsds3fr0.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.guardiancare.guardiancare",
"certificate_hash": "21a63e65aafc7011f53f23e2076c891aa943fbc0"
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "1ff1b2310812f56cb08db52113d40d136e2f33b1"
}
},
{
"client_id": "331315801686-95ag4s3qkqlgacimplnj2gpbdg1b5iev.apps.googleusercontent.com",
"client_id": "331315801686-a2d1llf9i6q5qcpuc8bvco11ngkk3ucg.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.guardiancare.guardiancare",
"certificate_hash": "9f253fc9da6f895b1d78051273a33370900d1118"
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "d88ff7a0965f19b02e4eef63799967a851c6e235"
}
},
{
"client_id": "331315801686-al98jeqqnufj60dif1e6skoh2hpfquse.apps.googleusercontent.com",
"client_id": "331315801686-icgufka35bicphhga5a30bvemf7mj3ki.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.guardiancare.guardiancare",
"certificate_hash": "7427b8c9a0b1f394ebb9d939763c94314591d442"
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "6117135182100722aef74ae2bf2c0f904a8449c7"
}
},
{
"client_id": "331315801686-dkbnrs9hrrppo95p6ovpk094utqc7ncq.apps.googleusercontent.com",
"client_id": "331315801686-k5rmmmd9gtkipjp5eltfilg7a68pj8uc.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.guardiancare.guardiancare",
"certificate_hash": "f7dba5844f617ff67f814b06709eca1b81fb7e27"
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "628ad8b2af1f7844cb1bab9d30223eb7ccb05c1b"
}
},
{
"client_id": "331315801686-gsul9057gnn6ua2gv4ukp58ruqgs6j2j.apps.googleusercontent.com",
"client_id": "331315801686-kssmlf97can4tdm5ivh2v54dg3atljjl.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.guardiancare.guardiancare",
"certificate_hash": "6117135182100722aef74ae2bf2c0f904a8449c7"
"package_name": "app.guardiancare.guardiancare",
"certificate_hash": "9f253fc9da6f895b1d78051273a33370900d1118"
}
},
{
Expand All @@ -144,10 +96,10 @@
"client_type": 3
},
{
"client_id": "331315801686-4h0llgi3p79eam8n5bt5vhm735plbg7h.apps.googleusercontent.com",
"client_id": "331315801686-0hcdvdo15e87a8lmqnartjpuea9lr2jl.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.guardiancare.guardiancare"
"bundle_id": "app.guardiancare.guardiancare"
}
}
]
Expand Down
4 changes: 4 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
id "com.google.firebase.crashlytics" version "2.8.1" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}

Expand Down
1 change: 1 addition & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"guardiancare-a210f","appId":"1:331315801686:android:51cee5c22ec4493e7595f7","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"guardiancare-a210f","configurations":{"android":"1:331315801686:android:51cee5c22ec4493e7595f7","ios":"1:331315801686:ios:f9b6693b41daae0d7595f7","macos":"1:331315801686:ios:f9b6693b41daae0d7595f7","web":"1:331315801686:web:2a2609fb7d0ec4187595f7","windows":"1:331315801686:web:890d5aa832db1f5a7595f7"}}}}}}
29 changes: 19 additions & 10 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ class DefaultFirebaseOptions {
case TargetPlatform.macOS:
return macos;
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
return windows;
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
Expand Down Expand Up @@ -70,20 +67,32 @@ class DefaultFirebaseOptions {
projectId: 'guardiancare-a210f',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
androidClientId: '331315801686-4co8knverqologscscu70sip0c3iqqd3.apps.googleusercontent.com',
androidClientId: '331315801686-01tinu5ukqe35u4ivvn3fqo4ju59pp1d.apps.googleusercontent.com',
iosClientId: '331315801686-0hcdvdo15e87a8lmqnartjpuea9lr2jl.apps.googleusercontent.com',
iosBundleId: 'app.guardiancare.guardiancare',
);

static const FirebaseOptions macos = FirebaseOptions(
apiKey: 'AIzaSyDwCbSP-Qw1bRg5BvVco5x0VqxoBMAtLgs',
appId: '1:331315801686:ios:fc27e7a4f68823717595f7',
appId: '1:331315801686:ios:f9b6693b41daae0d7595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
androidClientId: '331315801686-4co8knverqologscscu70sip0c3iqqd3.apps.googleusercontent.com',
iosClientId: '331315801686-s5blibsu54lp96ti29kvqeas6ko7jk5u.apps.googleusercontent.com',
iosBundleId: 'app.guardiancare.guardiancare.RunnerTests',
androidClientId: '331315801686-01tinu5ukqe35u4ivvn3fqo4ju59pp1d.apps.googleusercontent.com',
iosClientId: '331315801686-0hcdvdo15e87a8lmqnartjpuea9lr2jl.apps.googleusercontent.com',
iosBundleId: 'app.guardiancare.guardiancare',
);
}

static const FirebaseOptions windows = FirebaseOptions(
apiKey: 'AIzaSyBJKvh4ZXb3npq8cL9-mk-kDlSIUO6VppU',
appId: '1:331315801686:web:890d5aa832db1f5a7595f7',
messagingSenderId: '331315801686',
projectId: 'guardiancare-a210f',
authDomain: 'guardiancare-a210f.firebaseapp.com',
databaseURL: 'https://guardiancare-a210f-default-rtdb.asia-southeast1.firebasedatabase.app',
storageBucket: 'guardiancare-a210f.appspot.com',
measurementId: 'G-LDQKT44KB4',
);

}
16 changes: 16 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'dart:ui';

import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/material.dart';
import 'package:guardiancare/src/features/authentication/screens/loginPage.dart';
import 'package:guardiancare/src/routing/Pages.dart';
Expand All @@ -9,6 +12,19 @@ import 'firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

// Pass all uncaught "fatal" errors from the framework to Crashlytics
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;

// Pass all uncaught errors from the framework to Crashlytics
FlutterError.onError = (errorDetails) {
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
};
// Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics
PlatformDispatcher.instance.onError = (error, stack) {
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
return true;
};
runApp(const GuardianCareApp());
}

Expand Down
4 changes: 4 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import FlutterMacOS
import Foundation

import cloud_firestore
import firebase_analytics
import firebase_auth
import firebase_core
import firebase_crashlytics
import flutter_inappwebview_macos
import google_sign_in_ios
import path_provider_foundation
Expand All @@ -17,8 +19,10 @@ import video_player_avfoundation

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
FLTFirebaseAnalyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAnalyticsPlugin"))
FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseCrashlyticsPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCrashlyticsPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
Expand Down
40 changes: 40 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.0"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
sha256: "726596f4ac3352978238274c33234435e61bdb811484ea3d6a2b857bf47a2715"
url: "https://pub.dev"
source: hosted
version: "11.1.0"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
sha256: db445c727aa38038f91a3c6f6873d045a6740c79d03c0b6c61959e0c6ecfd771
url: "https://pub.dev"
source: hosted
version: "4.1.0"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
sha256: "49a8a5ca0bf7fd7541e4b0915b8eb99816edc7a610d5078b89ae013a813fd567"
url: "https://pub.dev"
source: hosted
version: "0.5.8"
firebase_auth:
dependency: "direct main"
description:
Expand Down Expand Up @@ -265,6 +289,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.17.2"
firebase_crashlytics:
dependency: "direct main"
description:
name: firebase_crashlytics
sha256: "54c06fa45585ed77e978b049f8e488db7677313d5dc808c54d24384a6e5bf0c8"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
firebase_crashlytics_platform_interface:
dependency: transitive
description:
name: firebase_crashlytics_platform_interface
sha256: "8ec63ebefe9233d3cdc744f75d5b88cf16b6241d8680e6284c2d272bcb0a10af"
url: "https://pub.dev"
source: hosted
version: "3.6.38"
fixnum:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ dependencies:
intl: ^0.19.0
flutter_launcher_icons: ^0.13.1
google_sign_in: ^6.2.1
firebase_crashlytics: ^4.0.2
firebase_analytics: ^11.1.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit ac2ca20

Please sign in to comment.