Thanks for your interest in improving the PostHog Flutter SDK.
From the repository root, run the same checks CI uses:
flutter pub get
make installLinters
make checkFormatDart
make analyzeDart
make formatKotlin
make formatSwift
cd posthog_flutter && flutter testCI also verifies the example app builds on the supported platforms. From the repository root:
flutter pub get
cd example
flutter build ios --simulator --no-codesign
flutter build macos
flutter build apk
flutter build webIf you want to exercise Swift Package Manager locally as well, run:
flutter config --enable-swift-package-manager
flutter pub get
cd example
flutter build ios --simulator --no-codesign
flutter build macos- Update
example/ios/Podfileto override thePostHogpod with your local path:
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# add this
pod 'PostHog', :path => File.expand_path('~/posthog-ios')
end- Run
cd example/ios && pod installto install the local pod - Open iOS simulator
- Run the app with
flutter run
In your local posthog-android repo:
- Run
make dryReleaseto build and publish the package to Maven local
In the posthog-flutter repo:
- Update
/android/build.gradleto addmavenLocal()as a repository:
allprojects {
repositories {
mavenLocal() // add this
google()
mavenCentral()
}
}- Open Android simulator
- Run the app with
flutter run