Skip to content

Commit

Permalink
added crashanalytics
Browse files Browse the repository at this point in the history
  • Loading branch information
babanomania committed Sep 20, 2020
1 parent c03d8cc commit ff0ed2e
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ app.*.map.json
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

android/key.properties
android/app/release/*
android/app/release/*
android/app/google-services.json
4 changes: 3 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'

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

android {
compileSdkVersion 28
compileSdkVersion 29

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down Expand Up @@ -74,4 +75,5 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics:17.5.0'
}
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand Down
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import 'package:CleanHabits/pages/SelectTopic.dart';
import 'package:CleanHabits/pages/TodayView.dart';
import 'package:CleanHabits/pages/NewHabit.dart';
import 'package:CleanHabits/pages/Welcome.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/services.dart';
import 'package:flutter/material.dart';

Expand Down Expand Up @@ -97,10 +99,15 @@ class _MyAppState extends State<MyApp> {

@override
Widget build(BuildContext context) {
var analytics = FirebaseAnalytics();

return loading
? Loading()
: MaterialApp(
theme: _theme(context),
navigatorObservers: [
FirebaseAnalyticsObserver(analytics: analytics),
],
initialRoute: widget.sp.initDone ? '/' : '/welcome',
routes: {
'/': (context) => TodayView(),
Expand Down
84 changes: 84 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,55 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.1"
firebase:
dependency: transitive
description:
name: firebase
url: "https://pub.dartlang.org"
source: hosted
version: "7.3.0"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.0"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
firebase_core:
dependency: transitive
description:
name: firebase_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -135,13 +184,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.8"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.2"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.4"
intl:
dependency: "direct main"
description:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -198,6 +268,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.0"
platform:
dependency: transitive
description:
Expand All @@ -219,6 +296,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.13"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
settings_ui:
dependency: "direct main"
description:
Expand Down
5 changes: 3 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CleanHabits
description: The Minimal, Clean, Habit Tracker

publish_to: "none"
version: 1.2.20200919+4
version: 1.3.20200920+5

environment:
sdk: ">=2.7.0 <3.0.0"
Expand All @@ -17,12 +17,13 @@ dependencies:
charts_flutter: ^0.9.0
flutter_slidable: ^0.5.7
heatmap_calendar: ^1.2.8
firebase_analytics: ^6.0.0
sk_onboarding_screen: 1.0.1
font_awesome_flutter: ^8.8.1
flutter_calendar_carousel: ^1.4.12
flutter_staggered_animations: ^0.1.2
flutter_local_notifications: ^1.4.4+4
shared_preferences: ">=0.5.7+3 <2.0.0"
font_awesome_flutter: ^8.8.1

flutter:
sdk: flutter
Expand Down

0 comments on commit ff0ed2e

Please sign in to comment.