diff --git a/01-setting-up-your-environment/projects/final/packages/monitoring/lib/monitoring.dart b/01-setting-up-your-environment/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/01-setting-up-your-environment/projects/final/packages/monitoring/lib/monitoring.dart +++ b/01-setting-up-your-environment/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/01-setting-up-your-environment/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/01-setting-up-your-environment/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/01-setting-up-your-environment/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/01-setting-up-your-environment/projects/starter/packages/monitoring/lib/monitoring.dart b/01-setting-up-your-environment/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/01-setting-up-your-environment/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/01-setting-up-your-environment/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/01-setting-up-your-environment/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/01-setting-up-your-environment/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/01-setting-up-your-environment/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/02-mastering-the-repository-pattern/projects/final/packages/monitoring/lib/monitoring.dart b/02-mastering-the-repository-pattern/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/02-mastering-the-repository-pattern/projects/final/packages/monitoring/lib/monitoring.dart +++ b/02-mastering-the-repository-pattern/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/02-mastering-the-repository-pattern/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/02-mastering-the-repository-pattern/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/02-mastering-the-repository-pattern/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/02-mastering-the-repository-pattern/projects/starter/packages/monitoring/lib/monitoring.dart b/02-mastering-the-repository-pattern/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/02-mastering-the-repository-pattern/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/02-mastering-the-repository-pattern/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/02-mastering-the-repository-pattern/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/02-mastering-the-repository-pattern/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/02-mastering-the-repository-pattern/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/03-managing-state-with-cubits-and-the-bloc-library/projects/challenge/packages/monitoring/lib/monitoring.dart b/03-managing-state-with-cubits-and-the-bloc-library/projects/challenge/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/03-managing-state-with-cubits-and-the-bloc-library/projects/challenge/packages/monitoring/lib/monitoring.dart +++ b/03-managing-state-with-cubits-and-the-bloc-library/projects/challenge/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/03-managing-state-with-cubits-and-the-bloc-library/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart b/03-managing-state-with-cubits-and-the-bloc-library/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/03-managing-state-with-cubits-and-the-bloc-library/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/03-managing-state-with-cubits-and-the-bloc-library/projects/final/packages/monitoring/lib/monitoring.dart b/03-managing-state-with-cubits-and-the-bloc-library/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/03-managing-state-with-cubits-and-the-bloc-library/projects/final/packages/monitoring/lib/monitoring.dart +++ b/03-managing-state-with-cubits-and-the-bloc-library/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/03-managing-state-with-cubits-and-the-bloc-library/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/03-managing-state-with-cubits-and-the-bloc-library/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/03-managing-state-with-cubits-and-the-bloc-library/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/03-managing-state-with-cubits-and-the-bloc-library/projects/starter/packages/monitoring/lib/monitoring.dart b/03-managing-state-with-cubits-and-the-bloc-library/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/03-managing-state-with-cubits-and-the-bloc-library/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/03-managing-state-with-cubits-and-the-bloc-library/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/03-managing-state-with-cubits-and-the-bloc-library/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/03-managing-state-with-cubits-and-the-bloc-library/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/03-managing-state-with-cubits-and-the-bloc-library/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/04-validating-forms-with-cubits/projects/final/packages/monitoring/lib/monitoring.dart b/04-validating-forms-with-cubits/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/04-validating-forms-with-cubits/projects/final/packages/monitoring/lib/monitoring.dart +++ b/04-validating-forms-with-cubits/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/04-validating-forms-with-cubits/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/04-validating-forms-with-cubits/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/04-validating-forms-with-cubits/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/04-validating-forms-with-cubits/projects/starter/packages/monitoring/lib/monitoring.dart b/04-validating-forms-with-cubits/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/04-validating-forms-with-cubits/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/04-validating-forms-with-cubits/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/04-validating-forms-with-cubits/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/04-validating-forms-with-cubits/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/04-validating-forms-with-cubits/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/05-managing-complex-state-with-blocs/projects/final/packages/monitoring/lib/monitoring.dart b/05-managing-complex-state-with-blocs/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/05-managing-complex-state-with-blocs/projects/final/packages/monitoring/lib/monitoring.dart +++ b/05-managing-complex-state-with-blocs/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/05-managing-complex-state-with-blocs/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/05-managing-complex-state-with-blocs/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/05-managing-complex-state-with-blocs/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/05-managing-complex-state-with-blocs/projects/starter/packages/monitoring/lib/monitoring.dart b/05-managing-complex-state-with-blocs/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/05-managing-complex-state-with-blocs/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/05-managing-complex-state-with-blocs/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/05-managing-complex-state-with-blocs/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/05-managing-complex-state-with-blocs/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/05-managing-complex-state-with-blocs/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/06-authenticating-users/projects/final/packages/monitoring/lib/monitoring.dart b/06-authenticating-users/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/06-authenticating-users/projects/final/packages/monitoring/lib/monitoring.dart +++ b/06-authenticating-users/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/06-authenticating-users/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/06-authenticating-users/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/06-authenticating-users/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/06-authenticating-users/projects/starter/packages/monitoring/lib/monitoring.dart b/06-authenticating-users/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/06-authenticating-users/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/06-authenticating-users/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/06-authenticating-users/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/06-authenticating-users/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/06-authenticating-users/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/07-routing-and-navigating/projects/final/packages/monitoring/lib/monitoring.dart b/07-routing-and-navigating/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/07-routing-and-navigating/projects/final/packages/monitoring/lib/monitoring.dart +++ b/07-routing-and-navigating/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/07-routing-and-navigating/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/07-routing-and-navigating/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/07-routing-and-navigating/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/07-routing-and-navigating/projects/starter/packages/monitoring/lib/monitoring.dart b/07-routing-and-navigating/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/07-routing-and-navigating/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/07-routing-and-navigating/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/07-routing-and-navigating/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/07-routing-and-navigating/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/07-routing-and-navigating/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/08-deep-linking/projects/final/packages/monitoring/lib/monitoring.dart b/08-deep-linking/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/08-deep-linking/projects/final/packages/monitoring/lib/monitoring.dart +++ b/08-deep-linking/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/08-deep-linking/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/08-deep-linking/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/08-deep-linking/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/08-deep-linking/projects/starter/packages/monitoring/lib/monitoring.dart b/08-deep-linking/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/08-deep-linking/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/08-deep-linking/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/08-deep-linking/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/08-deep-linking/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/08-deep-linking/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/09-internationalizing-and-localizing/projects/final/packages/monitoring/lib/monitoring.dart b/09-internationalizing-and-localizing/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/09-internationalizing-and-localizing/projects/final/packages/monitoring/lib/monitoring.dart +++ b/09-internationalizing-and-localizing/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/09-internationalizing-and-localizing/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/09-internationalizing-and-localizing/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/09-internationalizing-and-localizing/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/09-internationalizing-and-localizing/projects/starter/packages/monitoring/lib/monitoring.dart b/09-internationalizing-and-localizing/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/09-internationalizing-and-localizing/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/09-internationalizing-and-localizing/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/09-internationalizing-and-localizing/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/09-internationalizing-and-localizing/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/09-internationalizing-and-localizing/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/10-dynamic-theming-and-dark-mode/projects/final/packages/monitoring/lib/monitoring.dart b/10-dynamic-theming-and-dark-mode/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/10-dynamic-theming-and-dark-mode/projects/final/packages/monitoring/lib/monitoring.dart +++ b/10-dynamic-theming-and-dark-mode/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/10-dynamic-theming-and-dark-mode/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/10-dynamic-theming-and-dark-mode/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/10-dynamic-theming-and-dark-mode/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/10-dynamic-theming-and-dark-mode/projects/starter/packages/monitoring/lib/monitoring.dart b/10-dynamic-theming-and-dark-mode/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/10-dynamic-theming-and-dark-mode/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/10-dynamic-theming-and-dark-mode/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/10-dynamic-theming-and-dark-mode/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/10-dynamic-theming-and-dark-mode/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/10-dynamic-theming-and-dark-mode/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/11-create-your-own-widget-catalog/projects/challenge/packages/monitoring/lib/monitoring.dart b/11-create-your-own-widget-catalog/projects/challenge/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/11-create-your-own-widget-catalog/projects/challenge/packages/monitoring/lib/monitoring.dart +++ b/11-create-your-own-widget-catalog/projects/challenge/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/11-create-your-own-widget-catalog/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart b/11-create-your-own-widget-catalog/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/11-create-your-own-widget-catalog/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/11-create-your-own-widget-catalog/projects/final/packages/monitoring/lib/monitoring.dart b/11-create-your-own-widget-catalog/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/11-create-your-own-widget-catalog/projects/final/packages/monitoring/lib/monitoring.dart +++ b/11-create-your-own-widget-catalog/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/11-create-your-own-widget-catalog/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/11-create-your-own-widget-catalog/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/11-create-your-own-widget-catalog/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/11-create-your-own-widget-catalog/projects/starter/packages/monitoring/lib/monitoring.dart b/11-create-your-own-widget-catalog/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/11-create-your-own-widget-catalog/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/11-create-your-own-widget-catalog/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/11-create-your-own-widget-catalog/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/11-create-your-own-widget-catalog/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/11-create-your-own-widget-catalog/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/12-supporting-the-development-lifecycle-with-firebase/projects/final/packages/monitoring/lib/monitoring.dart b/12-supporting-the-development-lifecycle-with-firebase/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/12-supporting-the-development-lifecycle-with-firebase/projects/final/packages/monitoring/lib/monitoring.dart +++ b/12-supporting-the-development-lifecycle-with-firebase/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/12-supporting-the-development-lifecycle-with-firebase/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/12-supporting-the-development-lifecycle-with-firebase/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/12-supporting-the-development-lifecycle-with-firebase/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/12-supporting-the-development-lifecycle-with-firebase/projects/starter/packages/monitoring/lib/monitoring.dart b/12-supporting-the-development-lifecycle-with-firebase/projects/starter/packages/monitoring/lib/monitoring.dart index d3382fe4..806b6f85 100644 --- a/12-supporting-the-development-lifecycle-with-firebase/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/12-supporting-the-development-lifecycle-with-firebase/projects/starter/packages/monitoring/lib/monitoring.dart @@ -2,8 +2,8 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; -export 'src/explicit_crash.dart'; // TODO: export error_reporting_service.dart file +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/final/packages/monitoring/lib/monitoring.dart b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/final/packages/monitoring/lib/monitoring.dart +++ b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/final/packages/monitoring/lib/src/explicit_crash.dart b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/starter/packages/monitoring/lib/monitoring.dart b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/starter/packages/monitoring/lib/monitoring.dart +++ b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/starter/packages/monitoring/lib/src/explicit_crash.dart b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/13-running-live-experiments-with-a-b-testing-and-feature-flags/project/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/14-automated-testing/projects/challenge/packages/monitoring/lib/monitoring.dart b/14-automated-testing/projects/challenge/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/14-automated-testing/projects/challenge/packages/monitoring/lib/monitoring.dart +++ b/14-automated-testing/projects/challenge/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/14-automated-testing/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart b/14-automated-testing/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/14-automated-testing/projects/challenge/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/14-automated-testing/projects/final/packages/monitoring/lib/monitoring.dart b/14-automated-testing/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/14-automated-testing/projects/final/packages/monitoring/lib/monitoring.dart +++ b/14-automated-testing/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/14-automated-testing/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/14-automated-testing/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/14-automated-testing/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/14-automated-testing/projects/starter/packages/monitoring/lib/monitoring.dart b/14-automated-testing/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/14-automated-testing/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/14-automated-testing/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/14-automated-testing/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/14-automated-testing/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/14-automated-testing/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/15-automating-test-executions-and-build-distributions/projects/final/packages/monitoring/lib/monitoring.dart b/15-automating-test-executions-and-build-distributions/projects/final/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/15-automating-test-executions-and-build-distributions/projects/final/packages/monitoring/lib/monitoring.dart +++ b/15-automating-test-executions-and-build-distributions/projects/final/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/15-automating-test-executions-and-build-distributions/projects/final/packages/monitoring/lib/src/explicit_crash.dart b/15-automating-test-executions-and-build-distributions/projects/final/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/15-automating-test-executions-and-build-distributions/projects/final/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +} diff --git a/15-automating-test-executions-and-build-distributions/projects/starter/packages/monitoring/lib/monitoring.dart b/15-automating-test-executions-and-build-distributions/projects/starter/packages/monitoring/lib/monitoring.dart index d2d3fba8..f9c72b46 100644 --- a/15-automating-test-executions-and-build-distributions/projects/starter/packages/monitoring/lib/monitoring.dart +++ b/15-automating-test-executions-and-build-distributions/projects/starter/packages/monitoring/lib/monitoring.dart @@ -3,6 +3,7 @@ import 'package:firebase_core/firebase_core.dart'; export 'src/dynamic_link_service.dart'; export 'src/analytics_service.dart'; export 'src/error_reporting_service.dart'; +export 'src/explicit_crash.dart'; export 'src/remote_value_service.dart'; Future initializeMonitoringPackage() => Firebase.initializeApp(); diff --git a/15-automating-test-executions-and-build-distributions/projects/starter/packages/monitoring/lib/src/explicit_crash.dart b/15-automating-test-executions-and-build-distributions/projects/starter/packages/monitoring/lib/src/explicit_crash.dart new file mode 100644 index 00000000..86864715 --- /dev/null +++ b/15-automating-test-executions-and-build-distributions/projects/starter/packages/monitoring/lib/src/explicit_crash.dart @@ -0,0 +1,16 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; + +class ExplicitCrash { + ExplicitCrash({ + @visibleForTesting FirebaseCrashlytics? crashlytics, + }) : _crashlytics = crashlytics ?? FirebaseCrashlytics.instance; + + // 1 + final FirebaseCrashlytics _crashlytics; + + // 2 + crashTheApp() { + _crashlytics.crash(); + } +}