Commit d7e8e584 authored by Erfan Jazeb Nikoo's avatar Erfan Jazeb Nikoo
Browse files

Merge branch 'erfan/report_bug' into 'v0.0.3'

erfan/report_bug

See merge request !18
parents dc1184cc c5d11448
Showing with 9 additions and 2 deletions
+9 -2
......@@ -114,6 +114,7 @@ class AnalyticsService {
void logReportBug({
required String email,
required String msg,
required String ownerKey,
required bool notifyMe,
List? attachments,
}) {
......@@ -123,6 +124,7 @@ class AnalyticsService {
_AnalyticsProperties.message: msg,
_AnalyticsProperties.notifyMe: notifyMe,
_AnalyticsProperties.attachments: attachments,
_AnalyticsProperties.ownerKey: ownerKey,
});
}
}
......@@ -163,4 +165,5 @@ class _AnalyticsProperties {
static const message = 'message';
static const notifyMe = 'notifyMe';
static const attachments = 'attachments';
static const ownerKey = 'owner_key';
}
......@@ -17,7 +17,7 @@ Future<void> setup() async {
locator.registerLazySingleton<AppProvider>(
() => AppProvider(locator(), locator(), locator(), locator()));
locator.registerLazySingleton<FeedbackProvider>(
() => FeedbackProvider(locator()));
() => FeedbackProvider(locator(), locator()));
/// SERVICES
locator.registerLazySingleton<AnalyticsService>(() => AnalyticsService());
......
import 'package:consumer_app/core/services/analytics_service.dart';
import 'package:consumer_app/utilities/helpers/app_helper.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
enum ReportBugState { report, done }
class FeedbackProvider with ChangeNotifier {
final AnalyticsService _analyticsService;
final SharedPreferences _sharedPreferences;
FeedbackProvider(this._analyticsService);
FeedbackProvider(this._analyticsService, this._sharedPreferences);
final List<String> _attachments = [];
ReportBugState _reportBugState = ReportBugState.report;
......@@ -48,6 +51,7 @@ class FeedbackProvider with ChangeNotifier {
msg: msg,
notifyMe: reportNotifyMe,
attachments: _attachments,
ownerKey: _sharedPreferences.getString(app.keys.ownerKey) ?? '',
);
setReportBugState(ReportBugState.done);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment