Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Move credentials inside package #13

Merged
merged 14 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkgs/dash_analytics/example/dash_analytics_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ final String apiSecret = '4yT8__oER3Cd84dtx6r-_A';
// point of the tool
final Analytics analytics = Analytics(
tool: DashTool.flutterTools,
measurementId: measurementId,
apiSecret: apiSecret,
flutterChannel: 'ey-test-channel',
flutterVersion: 'Flutter 3.6.0-7.0.pre.47',
dartVersion: 'Dart 2.19.0',
Expand Down
8 changes: 3 additions & 5 deletions pkgs/dash_analytics/lib/src/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ abstract class Analytics {
/// of the [Analytics] abstract class using the [LocalFileSystem]
factory Analytics({
required DashTool tool,
required String measurementId,
required String apiSecret,
required String dartVersion,
String? flutterChannel,
String? flutterVersion,
required String dartVersion,
}) {
// Create the instance of the file system so clients don't need
// resolve on their own
Expand All @@ -48,8 +46,8 @@ abstract class Analytics {
return AnalyticsImpl(
tool: tool.label,
homeDirectory: getHomeDirectory(fs),
measurementId: measurementId,
apiSecret: apiSecret,
measurementId: kGoogleAnalyticsMeasurementId,
apiSecret: kGoogleAnalyticsApiSecret,
flutterChannel: flutterChannel,
flutterVersion: flutterVersion,
dartVersion: dartVersion,
Expand Down
8 changes: 8 additions & 0 deletions pkgs/dash_analytics/lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ reporting=1
/// will be located
const String kDartToolDirectoryName = '.dart';

/// The API secret associated with the GA4 instance's Measurement Protocol
const kGoogleAnalyticsApiSecret = 'Ka1jc8tZSzWc_GXMWHfPHA';

/// The measurement ID related to the GA4 instance
///
/// Serves as an identifier for a web data stream
const kGoogleAnalyticsMeasurementId = 'G-04BXPVBCWJ';

/// How many data records to store in the log file
const int kLogFileLength = 2500;

Expand Down
3 changes: 3 additions & 0 deletions pkgs/dash_analytics/lib/src/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
/// The [label] for each enum value is what will be logged, the [description]
/// is here for documentation purposes
enum DashEvent {
// Events for flutter_tools
hotReloadTime(
label: 'hot_reload_time',
description: 'Hot reload duration',
toolOwner: DashTool.flutterTools,
),

// Events for language_server
lintUsageCounts(
label: 'lint_usage_counts',
description: 'Number of times each lint is enabled',
Expand Down