Skip to content

Commit

Permalink
Merge pull request #38 from 9oya/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
9oya authored Apr 16, 2023
2 parents b3330e5 + bae045a commit f91e5f4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.0.2
* Update a dependency to the latest release.

## 1.0.1
* Update a dependency to the latest release.

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# analytics_logger_gen

[analytics_logger_gen](https://github.com/9oya/analytics_logger_gen) is a Flutter plugin that generates an integrated event logger for various analytics tools including Firebase, AppsFlyer, Amplitude, Mixpanel, Singular, and DataDog. Import data from Google Spreadsheets, remote repositories, or local CSV files.
[analytics_logger_gen](https://github.com/9oya/analytics_logger_gen) is a code generator that generates an event logger for analytics tools like FirebaseAnalytics and AppsFlyer. Import data from Google Spreadsheets, remote repositories or CSV files.

## Running the generator
```shell
flutter packages pub run build_runner build

# if you want to delete the generated files before building
# > flutter packages pub run build_runner build --delete-conflicting-outputs
flutter packages pub run build_runner build --delete-conflicting-outputs

# if generated files are not updated after modifying the CSV file, run the following command
# > flutter pub run build_runner clean
# if generated files are not updated after modifying the CSV file
flutter pub run build_runner clean
```
## Basic Usage
The builders generate code when they find members annotated with `@AnalyticsLogger`.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.0"
version: "1.0.2"
analyzer:
dependency: transitive
description:
Expand Down
1 change: 0 additions & 1 deletion lib/src/analytics_logger.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/// The [AnalyticsLogger] annotation is used to generate the logger class.
class AnalyticsLogger {
/// When [localCsvPath] is provided, the logger and events will be
Expand Down
9 changes: 4 additions & 5 deletions lib/src/analytics_logger_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class AnalyticsLoggerGenerator extends GeneratorForAnnotation<AnalyticsLogger> {
'The event flag names for the \'$_eventLoggerColumnName\' in the header row ($headerRows) of the CSV file do not match those declared in the @AnalyticsLogger annotation.');
}

int _indexOfEventLoggerName = headerRows.indexOf(_eventLoggerColumnName);
int _indexOfEventLoggerName =
headerRows.indexOf(_eventLoggerColumnName);
String _eventFlagKey = headerRows[_indexOfEventLoggerName];
String _eventFlag = 'false';
if (bodyRows[i][_eventFlagKey] != null) {
Expand Down Expand Up @@ -207,8 +208,7 @@ class AnalyticsLoggerGenerator extends GeneratorForAnnotation<AnalyticsLogger> {
buffer.writeln('Map<String, dynamic> attributes = <String, dynamic>{');
buffer.writeln(paramsDict);
buffer.writeln('};');
buffer.writeln(
'$className.logEvent($_enumName.$eventName, attributes);');
buffer.writeln('$className.logEvent($_enumName.$eventName, attributes);');
buffer.writeln('}');
}
buffer.writeln('}');
Expand All @@ -224,8 +224,7 @@ class AnalyticsLoggerGenerator extends GeneratorForAnnotation<AnalyticsLogger> {

buffer.writeln('static void setup() {');
for (String _loggerName in eventLoggerNamesDict.keys) {
buffer.writeln(
'${_loggerName.toLowerFirstCase()}.setup();');
buffer.writeln('${_loggerName.toLowerFirstCase()}.setup();');
}
buffer.writeln('}');

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: analytics_logger_gen
description: analytics_logger_gen is a Flutter plugin that generates an integrated event logger for various analytics tools including Firebase, AppsFlyer, Amplitude, Mixpanel, Singular, and DataDog. Import data from Google Spreadsheets, remote repositories, or local CSV files.
version: 1.0.1
description: analytics_logger_gen generates an event logger for analytics tools like FirebaseAnalytics and AppsFlyer. Import data from Google Spreadsheets, remote repositories or CSV files.
version: 1.0.2
homepage: https://github.com/9oya
repository: https://github.com/9oya/analytics_logger_gen
issue_tracker: https://github.com/9oya/analytics_logger_gen/issues
Expand All @@ -17,7 +17,7 @@ environment:
dependencies:
flutter:
sdk: flutter
analyzer: ^5.0.0
analyzer: ^5.1.0
build: ^2.3.1
source_gen: ^1.2.7
http: ^0.13.5
Expand Down

0 comments on commit f91e5f4

Please sign in to comment.