This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Record non fatal errors | |
| Future<void> reportNonFatalError(String error, String method, String reason, | |
| {dynamic exception, StackTrace stack}) async { | |
| FirebaseCrashlytics.instance.setCustomKey('ERROR', error); | |
| FirebaseCrashlytics.instance.setCustomKey('METHOD', method); | |
| FirebaseCrashlytics.instance.setCustomKey('REASON', reason); | |
| FirebaseCrashlytics.instance.log(reason); | |
| await FirebaseCrashlytics.instance.recordError( | |
| exception != null ? exception : Error(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:firebase_crashlytics/firebase_crashlytics.dart'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:firebase_core/firebase_core.dart'; | |
| class Wrapper extends StatefulWidget { | |
| // This widget is the root of your application. | |
| @override | |
| _WrapperState createState() => _WrapperState(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| main() { | |
| WidgetsFlutterBinding.ensureInitialized(); | |
| runZonedGuarded(() { | |
| runApp(Wrapper()); | |
| }, (error, stackTrace) { | |
| print('runZonedGuarded: Caught error in my root zone.'); | |
| FirebaseCrashlytics.instance.recordError(error, stackTrace); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.piumi.currentlocation | |
| import android.Manifest | |
| import android.content.pm.PackageManager | |
| import android.location.Location | |
| import android.os.Bundle | |
| import android.support.v4.app.ActivityCompat | |
| import android.support.v7.app.AppCompatActivity | |
| import android.widget.Toast | |
| import com.example.piumi.location.R |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.piumi.location | |
| import android.Manifest | |
| import android.content.Context | |
| import android.content.Intent | |
| import android.content.pm.PackageManager | |
| import android.location.* | |
| import android.os.* | |
| import android.provider.Settings | |
| import android.support.v4.content.ContextCompat |