Skip to content

Commit

Permalink
Merge pull request #275 from Eldar2021/el/mq-analytics
Browse files Browse the repository at this point in the history
MqCrashlytics & MqAnalytics
  • Loading branch information
Eldar2021 authored Dec 11, 2024
2 parents 58f06bc + b3b3bb0 commit 2bc682a
Show file tree
Hide file tree
Showing 45 changed files with 194 additions and 52 deletions.
1 change: 1 addition & 0 deletions app/lib/app/data/repository/auth_repositoty_impl.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:developer';

import 'package:meta/meta.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:mq_either/mq_either.dart';
import 'package:my_quran/app/app.dart';
import 'package:my_quran/core/core.dart';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/components/card/select_lang_list.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:loader_overlay/loader_overlay.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/app/app.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';

class SelectLangFromListViewBuilder extends StatelessWidget {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/config/router/parse_parameters.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:developer';

import 'package:meta/meta.dart';
import 'package:my_quran/core/core.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';

@immutable
final class ParseParams {
Expand Down
2 changes: 1 addition & 1 deletion app/lib/core/auth/soccial_auth.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:my_quran/core/core.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';

@immutable
Expand Down
2 changes: 0 additions & 2 deletions app/lib/core/core.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export 'auth/soccial_auth.dart';
export 'crashlytics/mq_crashlytics.dart';
export 'exceptions/network_exception.dart';
export 'exceptions/server_exception.dart';
export 'exceptions/auth_exception.dart';
export 'exceptions/convert_exception.dart';
export 'launch/app_launch.dart';
export 'enums/fetch_status.dart';
export 'analytics/mq_analytic.dart';
export 'remote_config/mq_remote_config.dart';
2 changes: 1 addition & 1 deletion app/lib/core/launch/app_launch.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:my_quran/core/core.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:url_launcher/url_launcher.dart';

@immutable
Expand Down
6 changes: 4 additions & 2 deletions app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import 'dart:developer';

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dio/dio.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:just_audio_background/just_audio_background.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:mq_remote_client/mq_remote_client.dart';
import 'package:mq_storage/mq_storage.dart';

Expand All @@ -27,7 +28,8 @@ Future<void> main({AppConfig? appConfig}) async {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
await FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(kReleaseMode);

await MqAnalytic.setAnalyticsCollectionEnabled(enabled: kReleaseMode);

await MqCrashlytics.setCrashlyticsCollectionEnabled(enabled: kReleaseMode);

Expand Down
20 changes: 19 additions & 1 deletion app/lib/modules/dev_mode/presentation/dev_mode_view.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:my_quran/config/app_config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/utils/show/alerts.dart';

class DevModeView extends StatefulWidget {
Expand Down Expand Up @@ -66,6 +67,23 @@ class _DevModeViewState extends State<DevModeView> {
},
child: const Text('Save'),
),
const SizedBox(height: 20),
TextButton(
onPressed: () async {
MqCrashlytics.report(
Exception('Test report Error'),
StackTrace.current,
);
MqCrashlytics.recordFlutterError(
FlutterErrorDetails(
exception: Exception('Test recordFlutterError Error'),
),
);
await MqCrashlytics.setUserIdentifier('Test Eldiiar');
MqAnalytic.track(AnalyticKey.test, params: {'Tested By': 'Eldiiar'});
},
child: const Text('Test Crashlytics and Analytics'),
),
],
),
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:async';
import 'dart:convert';

import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:mq_remote_client/mq_remote_client.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/modules/modules.dart';
import 'package:web_socket_channel/web_socket_channel.dart';

Expand Down
2 changes: 1 addition & 1 deletion app/lib/modules/hatim/presentation/bloc/hatim_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:developer';
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
import 'package:my_quran/core/core.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:my_quran/modules/hatim/hatim.dart';

part 'hatim_event.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/constants/contants.dart';

import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/hatim/hatim.dart';
import 'package:my_quran/modules/modules.dart';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/modules/hatim/presentation/view/hatim_view.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:mq_remote_client/mq_remote_client.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/hatim/hatim.dart';
import 'package:my_quran/modules/modules.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/modules.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:my_quran/core/core.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:my_quran/modules/modules.dart';

@immutable
Expand Down
1 change: 1 addition & 0 deletions app/lib/modules/home/presentation/cubit/home_cubit.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/modules/modules.dart';

Expand Down
2 changes: 2 additions & 0 deletions app/lib/modules/home/presentation/view/home_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:my_quran/config/config.dart';

import 'package:my_quran/core/core.dart';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/modules/login/presentation/view/login_view.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';

import 'package:my_quran/components/components.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/modules.dart';

Expand Down
1 change: 1 addition & 0 deletions app/lib/modules/login/presentation/view/sign_in_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:developer';
import 'dart:io';

import 'package:mq_analytics/mq_analytics.dart';
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/app/presentation/presenation.dart';
import 'package:my_quran/components/components.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/theme/custom/typography/typography_theme.dart';
import 'package:my_quran/theme/theme.dart';
import 'package:my_quran/utils/urils.dart';
import 'package:pin_code_fields/pin_code_fields.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/components/components.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';

class SelectGender extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';

import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/modules.dart';

Expand Down
2 changes: 1 addition & 1 deletion app/lib/modules/quran_audio/logic/quran_audio_cubit.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:just_audio/just_audio.dart';
import 'package:just_audio_background/just_audio_background.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:mq_remote_client/mq_remote_client.dart';

import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/modules/modules.dart';

part 'quran_audio_state.dart';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/modules/quran_audio/view/quran_audio_view.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:just_audio/just_audio.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/core/core.dart';

import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/modules.dart';
Expand Down
3 changes: 2 additions & 1 deletion app/lib/modules/read/presentation/view/pagination_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:mq_crashlytics/mq_crashlytics.dart';
import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/utils/urils.dart';
import 'package:my_quran/app/app.dart';
import 'package:my_quran/l10n/l10.dart';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/modules/read/presentation/view/read_view.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:mq_remote_client/mq_remote_client.dart';
import 'package:mq_storage/mq_storage.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/constants/contants.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/modules/modules.dart';
import 'package:my_quran/utils/urils.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:loader_overlay/loader_overlay.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/app/app.dart';

import 'package:my_quran/components/components.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/utils/urils.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';

import 'package:my_quran/app/app.dart';
import 'package:my_quran/components/components.dart';
import 'package:my_quran/config/config.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/theme/theme.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mq_analytics/mq_analytics.dart';
import 'package:mq_ci_keys/mq_ci_keys.dart';
import 'package:my_quran/app/app.dart';
import 'package:my_quran/core/core.dart';
import 'package:my_quran/l10n/l10.dart';
import 'package:my_quran/theme/theme.dart';

Expand Down
18 changes: 16 additions & 2 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ packages:
source: hosted
version: "7.0.0"
firebase_analytics:
dependency: "direct main"
dependency: transitive
description:
name: firebase_analytics
sha256: "2c4e7b548d41b46e8aa08bc3bd1163146be7e6d48f678f2e6dd3114994e42458"
Expand Down Expand Up @@ -415,7 +415,7 @@ packages:
source: hosted
version: "2.18.1"
firebase_crashlytics:
dependency: "direct main"
dependency: transitive
description:
name: firebase_crashlytics
sha256: "6899800fff1af819955aef740f18c4c8600f8b952a2a1ea97bc0872ebb257387"
Expand Down Expand Up @@ -916,13 +916,27 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
mq_analytics:
dependency: "direct main"
description:
path: "../packages/mq_analytics"
relative: true
source: path
version: "0.1.0+1"
mq_ci_keys:
dependency: "direct main"
description:
path: "../packages/mq_ci_keys"
relative: true
source: path
version: "1.0.0"
mq_crashlytics:
dependency: "direct main"
description:
path: "../packages/mq_crashlytics"
relative: true
source: path
version: "0.1.0+1"
mq_either:
dependency: "direct main"
description:
Expand Down
Loading

0 comments on commit 2bc682a

Please sign in to comment.