diff options
| author | Rishi-k-s <rishikrishna.sr@gmail.com> | 2021-08-17 11:19:06 +0530 |
|---|---|---|
| committer | Rishi-k-s <rishikrishna.sr@gmail.com> | 2021-08-17 11:19:06 +0530 |
| commit | 03e05633f7ae79d17a1182c52adcefa7517c19b9 (patch) | |
| tree | 4dd0b94c97a5e7e31e31ed1457d7cfbef18543e8 | |
| parent | db7fffc598ab8ebfbd1d938f04bb9182f88a819a (diff) | |
build grable update
| -rw-r--r-- | android/app/build.gradle | 6 | ||||
| -rw-r--r-- | android/app/google-services.json | 39 | ||||
| -rw-r--r-- | android/build.gradle | 1 | ||||
| -rw-r--r-- | lib/auth/LoginPage.dart | 2 | ||||
| -rw-r--r-- | lib/dataSecrets.dart | 7 | ||||
| -rw-r--r-- | lib/main.dart | 8 |
6 files changed, 52 insertions, 11 deletions
diff --git a/android/app/build.gradle b/android/app/build.gradle index 3463a01..eae4c93 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -22,6 +22,7 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' +apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" @@ -35,8 +36,9 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.healthtastic" - minSdkVersion 16 + minSdkVersion 24 targetSdkVersion 30 + multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -56,4 +58,6 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation platform('com.google.firebase:firebase-bom:28.3.1') + implementation "androidx.multidex:multidex:2.0.0" } diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 0000000..d124dc9 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "183839496109", + "project_id": "healthtastic-79d5d", + "storage_bucket": "healthtastic-79d5d.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:183839496109:android:4275c3189369d78e53b324", + "android_client_info": { + "package_name": "com.example.healthtastic" + } + }, + "oauth_client": [ + { + "client_id": "183839496109-1j13765dfv5hrl24qd2t5ioggj7hr3kf.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDgJs5VmJKMGtSOFje-PTEiJoX7_hlFeks" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "183839496109-1j13765dfv5hrl24qd2t5ioggj7hr3kf.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +}
\ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 9b6ed06..e5e3e98 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,6 +7,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.google.gms:google-services:4.3.10' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/lib/auth/LoginPage.dart b/lib/auth/LoginPage.dart index 793666d..0638187 100644 --- a/lib/auth/LoginPage.dart +++ b/lib/auth/LoginPage.dart @@ -1,5 +1,3 @@ -import 'dart:html'; - import 'package:flutter/material.dart'; import 'package:healthtastic/auth/RegisterPage.dart'; import '../services/authService.dart'; diff --git a/lib/dataSecrets.dart b/lib/dataSecrets.dart index 1fd6201..297ba52 100644 --- a/lib/dataSecrets.dart +++ b/lib/dataSecrets.dart @@ -1,8 +1,7 @@ -// import 'dart:io' show Platform; +import 'dart:io' show Platform; class Secret { static const WEB_CLIENT_ID = "183839496109-1j13765dfv5hrl24qd2t5ioggj7hr3kf.apps.googleusercontent.com"; - // static const ANDROID_CLIENT_ID = "<enter your Android client secret>"; - // static const IOS_CLIENT_ID = "<enter your iOS client secret>"; - static String getId() => Secret.WEB_CLIENT_ID; + static const ANDROID_CLIENT_ID = "183839496109-t0aumqpqkv23jdajc11ln8kjlcaij2f9.apps.googleusercontent.com"; + static String getId() => Platform.isAndroid ? Secret.ANDROID_CLIENT_ID : Secret.WEB_CLIENT_ID; } diff --git a/lib/main.dart b/lib/main.dart index 3e5737e..5dcc00d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,11 +9,11 @@ import 'package:googleapis/calendar/v3.dart' as cal; import 'package:url_launcher/url_launcher.dart'; import 'gogl cal/calhelper.dart'; import 'dataSecrets.dart'; -// import 'dart:io' show Platform; +import 'dart:io' show Platform; -void main() async { - WidgetsFlutterBinding.ensureInitialized; - await Firebase.initializeApp; +Future<void> main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); var _clientID = new ClientId(Secret.getId(), ""); const _scopes = const [cal.CalendarApi.calendarScope]; |
