From d4a5c400aabd45f1d7e1050cfdd277cefee3fb3b Mon Sep 17 00:00:00 2001 From: James Greenhill Date: Thu, 25 Jun 2020 12:15:17 -0700 Subject: [PATCH] flutter-posthog => posthog-flutter --- README.md | 12 +++---- android/build.gradle | 2 +- android/settings.gradle | 2 +- android/src/main/AndroidManifest.xml | 2 +- .../flutter_posthog/FlutterPosthogPlugin.java | 34 +++++++++---------- example/README.md | 4 +-- example/android/app/build.gradle | 2 +- .../android/app/src/main/AndroidManifest.xml | 4 +-- .../flutter_posthog_example/MainActivity.java | 2 +- .../app/src/profile/AndroidManifest.xml | 2 +- example/ios/Podfile.lock | 10 +++--- example/ios/Runner.xcodeproj/project.pbxproj | 6 ++-- example/ios/Runner/Info.plist | 2 +- example/lib/main.dart | 2 +- example/pubspec.yaml | 6 ++-- example/test/widget_test.dart | 2 +- ios/Classes/FlutterPosthogPlugin.h | 2 +- ios/Classes/FlutterPosthogPlugin.m | 30 ++++++++-------- ios/flutter_posthog.podspec | 2 +- lib/flutter_posthog.dart | 4 +-- lib/src/posthog.dart | 6 ++-- lib/src/posthog_method_channel.dart | 6 ++-- lib/src/posthog_observer.dart | 2 +- lib/src/posthog_platform_interface.dart | 2 +- lib/src/posthog_web.dart | 2 +- pubspec.yaml | 14 ++++---- test/flutter_posthog_test.dart | 2 +- 27 files changed, 83 insertions(+), 83 deletions(-) diff --git a/README.md b/README.md index 18ff751..fb81956 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Posthog plugin -![Pub Version](https://img.shields.io/pub/v/flutter_posthog) +![Pub Version](https://img.shields.io/pub/v/posthog_flutter) Flutter plugin to support iOS, Android and Web sources at https://posthog.com. ## Usage -To use this plugin, add `flutter_posthog` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). +To use this plugin, add `posthog_flutter` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). ### Supported methods @@ -29,7 +29,7 @@ To use this plugin, add `flutter_posthog` as a [dependency in your pubspec.yaml ```dart import 'package:flutter/material.dart'; -import 'package:flutter_posthog/flutter_posthog.dart'; +import 'package:posthog_flutter/posthog_flutter.dart'; void main() => runApp(MyApp()); @@ -80,7 +80,7 @@ Remember that the application lifecycle events won't have any special context se #### AndroidManifest.xml ```xml - + [...] @@ -139,8 +139,8 @@ For more informations please check: https://posthog.com/docs/integrations/js-int ## Issues -Please file any issues, bugs, or feature requests in the [GitHub repo](https://github.com/posthog/flutter-posthog/issues/new). +Please file any issues, bugs, or feature requests in the [GitHub repo](https://github.com/posthog/posthog-flutter/issues/new). ## Contributing -If you wish to contribute a change to this repo, please send a [pull request](https://github.com/posthog/flutter-posthog/pulls). +If you wish to contribute a change to this repo, please send a [pull request](https://github.com/posthog/posthog-flutter/pulls). diff --git a/android/build.gradle b/android/build.gradle index df931f1..fc7a18c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,4 @@ -group 'com.posthog.flutter_posthog' +group 'com.posthog.posthog_flutter' version '1.0-SNAPSHOT' buildscript { diff --git a/android/settings.gradle b/android/settings.gradle index 348dd95..a8aadf6 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1 +1 @@ -rootProject.name = 'flutter_posthog' +rootProject.name = 'posthog_flutter' diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 35b08f4..b7034ea 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,4 +1,4 @@ + package="com.posthog.posthog_flutter"> diff --git a/android/src/main/java/com/posthog/flutter_posthog/FlutterPosthogPlugin.java b/android/src/main/java/com/posthog/flutter_posthog/FlutterPosthogPlugin.java index dbc9517..cc6938d 100644 --- a/android/src/main/java/com/posthog/flutter_posthog/FlutterPosthogPlugin.java +++ b/android/src/main/java/com/posthog/flutter_posthog/FlutterPosthogPlugin.java @@ -1,4 +1,4 @@ -package com.posthog.flutter_posthog; +package com.posthog.posthog_flutter; import android.app.Activity; import android.content.Context; @@ -29,8 +29,8 @@ import io.flutter.plugin.common.PluginRegistry; import io.flutter.embedding.engine.plugins.FlutterPlugin; -/** FlutterPosthogPlugin */ -public class FlutterPosthogPlugin implements MethodCallHandler, FlutterPlugin { +/** PosthogFlutterPlugin */ +public class PosthogFlutterPlugin implements MethodCallHandler, FlutterPlugin { private Context applicationContext; private MethodChannel methodChannel; @@ -38,7 +38,7 @@ public class FlutterPosthogPlugin implements MethodCallHandler, FlutterPlugin { /** Plugin registration. */ public static void registerWith(PluginRegistry.Registrar registrar) { - final FlutterPosthogPlugin instance = new FlutterPosthogPlugin(); + final PosthogFlutterPlugin instance = new PosthogFlutterPlugin(); instance.setupChannels(registrar.context(), registrar.messenger()); } @@ -49,7 +49,7 @@ public void onAttachedToEngine(FlutterPluginBinding binding) { private void setupChannels(Context applicationContext, BinaryMessenger messenger) { try { - methodChannel = new MethodChannel(messenger, "flutter_posthog"); + methodChannel = new MethodChannel(messenger, "posthog_flutter"); this.applicationContext = applicationContext; ApplicationInfo ai = applicationContext.getPackageManager() @@ -91,7 +91,7 @@ public void intercept(Chain chain) { chain.proceed(newPayload); } catch (Exception e) { - Log.e("FlutterPosthog", e.getMessage()); + Log.e("PosthogFlutter", e.getMessage()); chain.proceed(chain.payload()); } } @@ -105,12 +105,12 @@ public void intercept(Chain chain) { try { PostHog.setSingletonInstance(analyticsBuilder.build()); } catch (IllegalStateException e) { - Log.w("FlutterPosthog", e.getMessage()); + Log.w("PosthogFlutter", e.getMessage()); } // register the channel to receive calls methodChannel.setMethodCallHandler(this); } catch (Exception e) { - Log.e("FlutterPosthog", e.getMessage()); + Log.e("PosthogFlutter", e.getMessage()); } } @@ -150,7 +150,7 @@ private void identify(MethodCall call, Result result) { this.callIdentify(userId, traitsData, options); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -179,7 +179,7 @@ private void track(MethodCall call, Result result) { this.callTrack(eventName, propertiesData, options); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -208,7 +208,7 @@ private void screen(MethodCall call, Result result) { this.callScreen(screenName, propertiesData, options); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -237,7 +237,7 @@ private void alias(MethodCall call, Result result) { PostHog.with(this.applicationContext).alias(alias, options); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -246,7 +246,7 @@ private void anonymousId(Result result) { String anonymousId = PostHog.with(this.applicationContext).getAnonymousId(); result.success(anonymousId); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -255,7 +255,7 @@ private void reset(Result result) { PostHog.with(this.applicationContext).reset(); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -264,7 +264,7 @@ private void setContext(MethodCall call, Result result) { this.appendToContextMiddleware = call.argument("context"); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -275,7 +275,7 @@ private void enable(MethodCall call, Result result) { PostHog.with(this.applicationContext).optOut(false); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } @@ -286,7 +286,7 @@ private void disable(MethodCall call, Result result) { PostHog.with(this.applicationContext).optOut(true); result.success(true); } catch (Exception e) { - result.error("FlutterPosthogException", e.getLocalizedMessage(), null); + result.error("PosthogFlutterException", e.getLocalizedMessage(), null); } } diff --git a/example/README.md b/example/README.md index 1d8efe6..cf86e08 100644 --- a/example/README.md +++ b/example/README.md @@ -1,6 +1,6 @@ -# flutter_posthog_example +# posthog_flutter_example -Demonstrates how to use the flutter_posthog plugin. +Demonstrates how to use the posthog_flutter plugin. ## Getting Started diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index df1e90a..3b066a8 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -33,7 +33,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.posthog.flutter_posthog_example" + applicationId "com.posthog.posthog_flutter_example" minSdkVersion 16 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 0021899..f14297e 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.posthog.posthog_flutter_example"> + package="com.posthog.posthog_flutter_example"> diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index a6ba17e..e86ddd0 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -4,7 +4,7 @@ PODS: - Branch/Core (= 0.33.1) - Branch/Core (0.33.1) - Flutter (1.0.0) - - flutter_posthog (0.0.1): + - posthog_flutter (0.0.1): - Analytics (= 4.0.1) - Flutter - Posthog-Branch @@ -14,7 +14,7 @@ PODS: DEPENDENCIES: - Flutter (from `Flutter`) - - flutter_posthog (from `.symlinks/plugins/flutter_posthog/ios`) + - posthog_flutter (from `.symlinks/plugins/posthog_flutter/ios`) SPEC REPOS: https://github.com/cocoapods/specs.git: @@ -25,14 +25,14 @@ SPEC REPOS: EXTERNAL SOURCES: Flutter: :path: Flutter - flutter_posthog: - :path: ".symlinks/plugins/flutter_posthog/ios" + posthog_flutter: + :path: ".symlinks/plugins/posthog_flutter/ios" SPEC CHECKSUMS: Analytics: ebdc0c3ed93684d10c898f57886e0ce7fbecc240 Branch: 65d05ffb137ef504777cff6bd4fb6f770f17145a Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - flutter_posthog: 0357d36d6b066d5d255cda46d2f217b55110af95 + posthog_flutter: 0357d36d6b066d5d255cda46d2f217b55110af95 Posthog-Branch: f255ba1354f6aa1bc8654d450b3b933380f2558d PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 2082798..e9a2178 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -389,7 +389,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.posthog.flutterPosthogExample; + PRODUCT_BUNDLE_IDENTIFIER = com.posthog.PosthogFlutterExample; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -519,7 +519,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterPosthogExample; + PRODUCT_BUNDLE_IDENTIFIER = com.example.PosthogFlutterExample; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; @@ -543,7 +543,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterPosthogExample; + PRODUCT_BUNDLE_IDENTIFIER = com.example.PosthogFlutterExample; PRODUCT_NAME = "$(TARGET_NAME)"; VERSIONING_SYSTEM = "apple-generic"; }; diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index ed41b79..d0b83e8 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -11,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - flutter_posthog_example + posthog_flutter_example CFBundlePackageType APPL CFBundleShortVersionString diff --git a/example/lib/main.dart b/example/lib/main.dart index 295ea96..1792567 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,7 +1,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:flutter_posthog/flutter_posthog.dart'; +import 'package:posthog_flutter/posthog_flutter.dart'; void main() { /// Wait until the platform channel is properly initialized so we can call diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 20c9c2a..01fa9e8 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,5 +1,5 @@ -name: flutter_posthog_example -description: Demonstrates how to use the flutter_posthog plugin. +name: posthog_flutter_example +description: Demonstrates how to use the posthog_flutter plugin. publish_to: "none" version: 0.0.1+1 @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - flutter_posthog: + posthog_flutter: path: ../ # The following adds the Cupertino Icons font to your application. diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index 895a14b..04362ec 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_posthog_example/main.dart'; +import 'package:posthog_flutter_example/main.dart'; void main() { testWidgets('Verify Platform version', (WidgetTester tester) async { diff --git a/ios/Classes/FlutterPosthogPlugin.h b/ios/Classes/FlutterPosthogPlugin.h index 5df2f2a..80e4514 100644 --- a/ios/Classes/FlutterPosthogPlugin.h +++ b/ios/Classes/FlutterPosthogPlugin.h @@ -1,4 +1,4 @@ #import -@interface FlutterPosthogPlugin : NSObject +@interface PosthogFlutterPlugin : NSObject @end diff --git a/ios/Classes/FlutterPosthogPlugin.m b/ios/Classes/FlutterPosthogPlugin.m index 2953322..422b740 100644 --- a/ios/Classes/FlutterPosthogPlugin.m +++ b/ios/Classes/FlutterPosthogPlugin.m @@ -1,10 +1,10 @@ -#import "FlutterPosthogPlugin.h" +#import "PosthogFlutterPlugin.h" #import #import #import #import -@implementation FlutterPosthogPlugin +@implementation PosthogFlutterPlugin // Contents to be appended to the context static NSDictionary *_appendToContextMiddleware; @@ -83,9 +83,9 @@ + (void)registerWithRegistrar:(NSObject*)registrar { [PHGPostHog setupWithConfiguration:configuration]; FlutterMethodChannel* channel = [FlutterMethodChannel - methodChannelWithName:@"flutter_posthog" + methodChannelWithName:@"posthog_flutter" binaryMessenger:[registrar messenger]]; - FlutterPosthogPlugin* instance = [[FlutterPosthogPlugin alloc] init]; + PosthogFlutterPlugin* instance = [[PosthogFlutterPlugin alloc] init]; [registrar addMethodCallDelegate:instance channel:channel]; } @catch (NSException *exception) { @@ -127,7 +127,7 @@ - (void)setContext:(FlutterMethodCall*)call result:(FlutterResult)result { } @catch (NSException *exception) { result([FlutterError - errorWithCode:@"FlutterPosthogException" + errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } @@ -146,7 +146,7 @@ - (void)identify:(FlutterMethodCall*)call result:(FlutterResult)result { } @catch (NSException *exception) { result([FlutterError - errorWithCode:@"FlutterPosthogException" + errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } @@ -162,7 +162,7 @@ - (void)track:(FlutterMethodCall*)call result:(FlutterResult)result { result([NSNumber numberWithBool:YES]); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -176,7 +176,7 @@ - (void)screen:(FlutterMethodCall*)call result:(FlutterResult)result { result([NSNumber numberWithBool:YES]); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -188,7 +188,7 @@ - (void)alias:(FlutterMethodCall*)call result:(FlutterResult)result { result([NSNumber numberWithBool:YES]); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -198,7 +198,7 @@ - (void)anonymousId:(FlutterResult)result { result(anonymousId); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -208,7 +208,7 @@ - (void)reset:(FlutterResult)result { result([NSNumber numberWithBool:YES]); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -218,7 +218,7 @@ - (void)disable:(FlutterResult)result { result([NSNumber numberWithBool:YES]); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -228,7 +228,7 @@ - (void)enable:(FlutterResult)result { result([NSNumber numberWithBool:YES]); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -239,7 +239,7 @@ - (void)debug:(FlutterMethodCall*)call result:(FlutterResult)result { result([NSNumber numberWithBool:YES]); } @catch (NSException *exception) { - result([FlutterError errorWithCode:@"FlutterPosthogException" message:[exception reason] details: nil]); + result([FlutterError errorWithCode:@"PosthogFlutterException" message:[exception reason] details: nil]); } } @@ -250,7 +250,7 @@ + (NSDictionary *) mergeDictionary: (NSDictionary *) first with: (NSDictionary * if (!contained) { [result setObject:value forKey:key]; } else if ([value isKindOfClass:[NSDictionary class]]) { - [result setObject:[FlutterPosthogPlugin mergeDictionary:result[key] with:value] + [result setObject:[PosthogFlutterPlugin mergeDictionary:result[key] with:value] forKey:key]; } }]; diff --git a/ios/flutter_posthog.podspec b/ios/flutter_posthog.podspec index 37252ee..840a562 100644 --- a/ios/flutter_posthog.podspec +++ b/ios/flutter_posthog.podspec @@ -2,7 +2,7 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| - s.name = 'flutter_posthog' + s.name = 'posthog_flutter' s.version = '0.0.1' s.summary = 'A new flutter plugin project.' s.description = <<-DESC diff --git a/lib/flutter_posthog.dart b/lib/flutter_posthog.dart index ffb6069..5d6ab45 100644 --- a/lib/flutter_posthog.dart +++ b/lib/flutter_posthog.dart @@ -1,2 +1,2 @@ -export 'package:flutter_posthog/src/posthog.dart'; -export 'package:flutter_posthog/src/posthog_observer.dart'; +export 'package:posthog_flutter/src/posthog.dart'; +export 'package:posthog_flutter/src/posthog_observer.dart'; diff --git a/lib/src/posthog.dart b/lib/src/posthog.dart index d0f9ac6..23710d6 100644 --- a/lib/src/posthog.dart +++ b/lib/src/posthog.dart @@ -1,10 +1,10 @@ import 'dart:io'; import 'package:meta/meta.dart'; -import 'package:flutter_posthog/src/posthog_platform_interface.dart'; +import 'package:posthog_flutter/src/posthog_platform_interface.dart'; -export 'package:flutter_posthog/src/posthog_observer.dart'; -export 'package:flutter_posthog/src/posthog_default_options.dart'; +export 'package:posthog_flutter/src/posthog_observer.dart'; +export 'package:posthog_flutter/src/posthog_default_options.dart'; class Posthog { static PosthogPlatform get _posthog => PosthogPlatform.instance; diff --git a/lib/src/posthog_method_channel.dart b/lib/src/posthog_method_channel.dart index 24d0bb5..2ed42e0 100644 --- a/lib/src/posthog_method_channel.dart +++ b/lib/src/posthog_method_channel.dart @@ -1,9 +1,9 @@ import 'package:meta/meta.dart'; import 'package:flutter/services.dart'; -import 'package:flutter_posthog/src/posthog_default_options.dart'; -import 'package:flutter_posthog/src/posthog_platform_interface.dart'; +import 'package:posthog_flutter/src/posthog_default_options.dart'; +import 'package:posthog_flutter/src/posthog_platform_interface.dart'; -const MethodChannel _channel = MethodChannel('flutter_posthog'); +const MethodChannel _channel = MethodChannel('posthog_flutter'); class PosthogMethodChannel extends PosthogPlatform { Future identify({ diff --git a/lib/src/posthog_observer.dart b/lib/src/posthog_observer.dart index 72c25e4..eb7d7ed 100644 --- a/lib/src/posthog_observer.dart +++ b/lib/src/posthog_observer.dart @@ -1,5 +1,5 @@ import 'package:flutter/widgets.dart'; -import 'package:flutter_posthog/flutter_posthog.dart'; +import 'package:posthog_flutter/posthog_flutter.dart'; typedef String ScreenNameExtractor(RouteSettings settings); diff --git a/lib/src/posthog_platform_interface.dart b/lib/src/posthog_platform_interface.dart index 3acde84..af059b8 100644 --- a/lib/src/posthog_platform_interface.dart +++ b/lib/src/posthog_platform_interface.dart @@ -1,5 +1,5 @@ import 'package:meta/meta.dart'; -import 'package:flutter_posthog/src/posthog_method_channel.dart'; +import 'package:posthog_flutter/src/posthog_method_channel.dart'; abstract class PosthogPlatform { /// The default instance of [PosthogPlatform] to use diff --git a/lib/src/posthog_web.dart b/lib/src/posthog_web.dart index 3ef0ca5..56d366b 100644 --- a/lib/src/posthog_web.dart +++ b/lib/src/posthog_web.dart @@ -6,7 +6,7 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart'; class PosthogWeb { static void registerWith(Registrar registrar) { final MethodChannel channel = MethodChannel( - 'flutter_posthog', + 'posthog_flutter', const StandardMethodCodec(), registrar.messenger, ); diff --git a/pubspec.yaml b/pubspec.yaml index 5afa6e0..7a0f368 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,10 +1,10 @@ -name: flutter_posthog +name: posthog_flutter description: Flutter implementation of Posthog client for iOS, Android and Web version: 1.9.0 homepage: https://www.posthog.com -repository: https://github.com/posthog/flutter-posthog -issue_tracker: https://github.com/posthog/flutter-posthog/issues -documentation: https://github.com/posthog/flutter-posthog#readme +repository: https://github.com/posthog/posthog-flutter +issue_tracker: https://github.com/posthog/posthog-flutter/issues +documentation: https://github.com/posthog/posthog-flutter#readme environment: sdk: ">=2.1.0 <3.0.0" @@ -25,10 +25,10 @@ flutter: plugin: platforms: android: - package: com.posthog.flutter_posthog - pluginClass: FlutterPosthogPlugin + package: com.posthog.posthog_flutter + pluginClass: PosthogFlutterPlugin ios: - pluginClass: FlutterPosthogPlugin + pluginClass: PosthogFlutterPlugin web: pluginClass: PosthogWeb fileName: src/posthog_web.dart diff --git a/test/flutter_posthog_test.dart b/test/flutter_posthog_test.dart index 16132fa..f873497 100644 --- a/test/flutter_posthog_test.dart +++ b/test/flutter_posthog_test.dart @@ -2,7 +2,7 @@ import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { - const MethodChannel channel = MethodChannel('flutter_posthog'); + const MethodChannel channel = MethodChannel('posthog_flutter'); setUp(() { channel.setMockMethodCallHandler((MethodCall methodCall) async {