mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 04:32:32 +00:00
* chore(packages): Added pedantic package to enforce linting and styling * feat(lunasea): Enforce effective dart styling * Comment and format colours class * Localize additional classes in Dashboard, cleanup additional code * chore(lunasea): Major refactor by running dartfmt on the entire codebase, added widget return for page routers * Additional work on conforming to effective dart style * fix(share_plus): Roll back share_plus package to 2.0.0 to support iOS 12 or lower * chore(lunasea): Fix remaining enabled analysis warnings
31 lines
1013 B
Dart
31 lines
1013 B
Dart
import 'dart:io';
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:lunasea/core.dart';
|
|
|
|
class LunaFirebaseCrashlytics {
|
|
/// Returns true if Firebase Analytics is compatible with this build system/platform.
|
|
static bool get isPlatformCompatible {
|
|
return LunaFirebase.isPlatformCompatible &&
|
|
!Platform.isLinux &&
|
|
!Platform.isMacOS &&
|
|
!Platform.isWindows;
|
|
}
|
|
|
|
/// Returns an instance of [FirebaseCrashlytics].
|
|
///
|
|
/// Throws an error if [LunaFirebase.initialize] has not been called.
|
|
static FirebaseCrashlytics get instance => FirebaseCrashlytics.instance;
|
|
|
|
/// Set the enabled state of Firebase Crashlytics.
|
|
///
|
|
/// If `enabled` is set to false, force-disables Analytics.
|
|
void setEnabledState() {
|
|
if (isPlatformCompatible) {
|
|
bool state =
|
|
kReleaseMode && LunaDatabaseValue.ENABLE_FIREBASE_CRASHLYTICS.data;
|
|
instance.setCrashlyticsCollectionEnabled(state);
|
|
}
|
|
}
|
|
}
|