diff --git a/android/app/build.gradle b/android/app/build.gradle index 64fea2d0..953f94e2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -87,6 +87,7 @@ android { signingConfig signingConfigs.release minifyEnabled true useProguard true + multiDexEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -100,4 +101,8 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.amap.api:3dmap:latest.integration' implementation 'com.amap.api:location:latest.integration' + implementation 'com.android.support:multidex:1.0.3' } + +apply plugin: 'com.google.gms.google-services' +apply plugin: 'com.google.firebase.crashlytics' diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 00000000..74eeca7d --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "767907767238", + "project_id": "akucommunity-46aa5", + "storage_bucket": "akucommunity-46aa5.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:767907767238:android:73ba965a47818e4d9cc8c7", + "android_client_info": { + "package_name": "com.akuCommunity.app" + } + }, + "oauth_client": [ + { + "client_id": "767907767238-gqote713f3ff3v8sqh29qtjr50sf7680.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCPwYm-8vZnPTLXrv6v68IxKM4jmsmZY5o" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "767907767238-gqote713f3ff3v8sqh29qtjr50sf7680.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 df82a280..d3b97fbe 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -11,6 +11,8 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.5' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1' } } diff --git a/lib/main.dart b/lib/main.dart index 3388faab..2e492037 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,6 @@ import 'package:akuCommunity/constants/config.dart'; +import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -21,6 +23,15 @@ import 'package:akuCommunity/utils/headers.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); + FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); + Future.delayed(Duration(seconds: 5), () { + FirebaseCrashlytics.instance.log("Higgs-Boson detected! Bailing out"); + }); + + FlutterError.onError = (detail) { + FirebaseCrashlytics.instance.recordFlutterError(detail); + }; SystemChrome.setSystemUIOverlayStyle( SystemUiOverlayStyle( statusBarColor: Colors.transparent, @@ -83,7 +94,6 @@ class _MyAppState extends State { }, child: ScreenUtilInit( designSize: Size(750, 1334), - allowFontScaling: true, builder: () => GetMaterialApp( onGenerateTitle: (context) => S.of(context).appName, debugShowCheckedModeBanner: false, diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index ab6ae718..b67830e1 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -114,7 +114,7 @@ class _SettingsPageState extends State { // ), // ), _buildTile( - title: '关于小蜜蜂智慧社区', + title: null, onTap: () => Get.to(() => AboutPage()), ), //TODO 邀请注册 diff --git a/pubspec.lock b/pubspec.lock index 467febbc..566235ca 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -142,7 +142,7 @@ packages: name: crypto url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.0" + version: "3.0.1" cupertino_icons: dependency: "direct main" description: @@ -156,7 +156,7 @@ packages: name: decimal url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.0" + version: "1.0.0+1" device_info: dependency: transitive description: @@ -170,7 +170,7 @@ packages: name: device_info_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.1" dio: dependency: "direct main" description: @@ -200,7 +200,7 @@ packages: source: hosted version: "6.1.0" firebase_core: - dependency: transitive + dependency: "direct main" description: name: firebase_core url: "https://pub.flutter-io.cn" @@ -278,7 +278,7 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.1" flutter_rating_bar: dependency: "direct main" description: @@ -292,14 +292,14 @@ packages: name: flutter_screenutil url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.0-nullsafety.11" + version: "5.0.0" flutter_slidable: dependency: "direct main" description: name: flutter_slidable url: "https://pub.flutter-io.cn" source: hosted - version: "0.6.0-nullsafety.0" + version: "0.6.0" flutter_test: dependency: "direct dev" description: flutter @@ -316,14 +316,14 @@ packages: name: fluwx url: "https://pub.flutter-io.cn" source: hosted - version: "3.3.0" + version: "3.4.1" get: dependency: "direct main" description: name: get url: "https://pub.flutter-io.cn" source: hosted - version: "4.0.0-nullsafety.2" + version: "4.1.4" glob: dependency: transitive description: @@ -351,7 +351,7 @@ packages: name: hive url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.2" hive_flutter: dependency: "direct main" description: @@ -379,7 +379,7 @@ packages: name: image_picker url: "https://pub.flutter-io.cn" source: hosted - version: "0.7.3" + version: "0.7.4" image_picker_for_web: dependency: transitive description: @@ -393,14 +393,14 @@ packages: name: image_picker_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.1" import_sorter: dependency: "direct dev" description: name: import_sorter url: "https://pub.flutter-io.cn" source: hosted - version: "4.4.2" + version: "4.4.3" intl: dependency: "direct main" description: @@ -498,7 +498,7 @@ packages: name: path_provider_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0" + version: "2.0.1" path_provider_windows: dependency: transitive description: @@ -526,7 +526,7 @@ packages: name: permission_handler_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "3.1.1" + version: "3.1.2" platform: dependency: transitive description: @@ -554,7 +554,7 @@ packages: name: process url: "https://pub.flutter-io.cn" source: hosted - version: "4.1.1" + version: "4.2.1" provider: dependency: "direct main" description: @@ -640,7 +640,7 @@ packages: name: shimmer url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.0-nullsafety.0" + version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -736,7 +736,7 @@ packages: name: url_launcher url: "https://pub.flutter-io.cn" source: hosted - version: "6.0.2" + version: "6.0.3" url_launcher_linux: dependency: transitive description: @@ -785,7 +785,7 @@ packages: name: velocity_x url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.0" + version: "2.6.1" vxstate: dependency: transitive description: @@ -799,7 +799,7 @@ packages: name: win32 url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.4" + version: "2.0.5" xdg_directories: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 5cd7a881..18cbc645 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,6 +62,7 @@ dependencies: amap_flutter_location: ^1.0.1 amap_flutter_base: ^1.0.2 animated_text_kit: ^4.1.1 + firebase_core: ^1.0.3 firebase_crashlytics: ^2.0.0