Skip to content

feat(dart): add support fort dart generator#2

Merged
jlabeit merged 3 commits intomainfrom
feature/DFS-1385/dart-support
Dec 30, 2024
Merged

feat(dart): add support fort dart generator#2
jlabeit merged 3 commits intomainfrom
feature/DFS-1385/dart-support

Conversation

@jlabeit
Copy link
Contributor

@jlabeit jlabeit commented Dec 27, 2024

What the PR Includes

Example code that is generated:

import 'package:mixpanel_flutter/mixpanel_flutter.dart';

class Lexicon {
  static Mixpanel? mixpanel;

  static void _track(String eventName, {Map<String, dynamic>? properties}) {
    mixpanel?.track(eventName, properties: properties);
  }

  /// Clicked on save & continue while creating an order during the send flow.
  static void trackSaveContinueEvent({String? featureName, String? workflow}) =>
      _track('Save & continue', properties: <String, dynamic>{
        'Feature Name': featureName,
        'Workflow': workflow,
      });

}

Checklist

  • Tests are added.
  • Manual testing instructions are added.
  • Configs are added/adapted if applicable.
  • Issue is properly linked if applicable.

Manual Testing Instructions

  1. To test the PR run the command below to generate a dart file.
  2. Alternative you can checkout this PR that implements an example in the IMPARGO DriverApp.

Command to generate:

 npx ts-node src/index.ts  -u $USERNAME -s $KEY -p $PROJECT -t dart > lexicon.dart 

@jlabeit jlabeit force-pushed the feature/DFS-1385/dart-support branch from 990d542 to f0a84aa Compare December 28, 2024 17:04
@jlabeit jlabeit marked this pull request as ready for review December 28, 2024 17:11
@jlabeit jlabeit requested a review from KhaledSakr December 28, 2024 17:37
Copy link
Member

@KhaledSakr KhaledSakr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Just one small suggestion.

@jlabeit jlabeit merged commit 511b1e3 into main Dec 30, 2024
3 checks passed
@jlabeit jlabeit deleted the feature/DFS-1385/dart-support branch December 30, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants