├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── SubHandler │ │ ├── SubHandler0.h │ │ └── Custom │ │ │ ├── SubHandlerCustom.h │ │ │ └── SubHandlerCustom.m │ ├── JanalyticsFluttifyPlugin.h │ └── JanalyticsFluttifyPlugin.m ├── .gitignore └── janalytics_fluttify.podspec ├── CHANGELOG.md ├── test └── janalytics_fluttify_test.dart ├── android ├── settings.gradle ├── .gitignore ├── gradle.properties ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── me │ │ └── yohom │ │ └── janalytics_fluttify │ │ ├── sub_handler │ │ └── custom │ │ │ └── SubHandlerCustom.java │ │ └── JanalyticsFluttifyPlugin.java ├── proguard-rules.pro ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── build.gradle ├── example ├── ios │ ├── Flutter │ │ ├── .last_build_id │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner │ │ ├── AppDelegate.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── main.m │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ ├── .gitignore │ └── Podfile ├── web │ ├── icons │ │ ├── Icon-192.png │ │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── android │ ├── gradle.properties │ ├── .gitignore │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── java │ │ │ │ │ └── me │ │ │ │ │ │ └── yohom │ │ │ │ │ │ └── janalytics_fluttify_example │ │ │ │ │ │ └── MainActivity.java │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── pubspec.yaml ├── README.md ├── .gitignore ├── test │ └── widget_test.dart └── lib │ └── main.dart ├── .gitignore ├── lib ├── janalytics_fluttify.dart └── src │ ├── ios │ ├── constants.g.dart │ ├── ios.export.g.dart │ ├── functions.g.dart │ ├── JANALYTICSSex.g.dart │ ├── JANALYTICSPaid.g.dart │ ├── JANALYTICSPurchaseCurrency.g.dart │ ├── JANALYTICSCountEvent.g.dart │ ├── JANALYTICSEventObject.g.dart │ ├── JANALYTICSLoginEvent.g.dart │ ├── JANALYTICSRegisterEvent.g.dart │ ├── JANALYTICSCalculateEvent.g.dart │ ├── JANALYTICSBrowseEvent.g.dart │ ├── JANALYTICSLaunchConfig.g.dart │ ├── type_op.g.dart │ └── JANALYTICSPurchaseEvent.g.dart │ ├── android │ ├── constants.g.dart │ ├── cn │ │ ├── jiguang │ │ │ └── analytics │ │ │ │ └── android │ │ │ │ ├── api │ │ │ │ ├── AccountCallback.g.dart │ │ │ │ ├── Currency.g.dart │ │ │ │ ├── agent │ │ │ │ │ ├── JMMIDlgPupW.g.dart │ │ │ │ │ └── JMMIClick.g.dart │ │ │ │ ├── CountEvent.g.dart │ │ │ │ ├── LoginEvent.g.dart │ │ │ │ ├── RegisterEvent.g.dart │ │ │ │ ├── Event.g.dart │ │ │ │ └── CalculateEvent.g.dart │ │ │ │ └── view │ │ │ │ └── BuryWebActivity.g.dart │ │ └── analytics │ │ │ └── client │ │ │ └── android │ │ │ └── BuildConfig.g.dart │ └── android.export.g.dart │ └── facade │ ├── objects.g.dart │ ├── page_analyzer.dart │ ├── janalytics.dart │ └── models.dart ├── analysis_options.yaml ├── .metadata ├── LICENSE ├── pubspec.yaml ├── pubspec.lock └── README.md /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | - 首个版本 3 | -------------------------------------------------------------------------------- /test/janalytics_fluttify_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'janalytics_fluttify' 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/.last_build_id: -------------------------------------------------------------------------------- 1 | e5b3d6af2a20bf1017b0833bc2255a32 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class cn.jiguang.** { *; } 2 | -keep class android.support.** { *; } 3 | -keep class androidx.** { *; } 4 | -keep class com.google.android.** { *; } -------------------------------------------------------------------------------- /lib/janalytics_fluttify.dart: -------------------------------------------------------------------------------- 1 | library janalytics_fluttify; 2 | 3 | export 'src/facade/janalytics.dart'; 4 | export 'src/facade/models.dart'; 5 | export 'src/facade/page_analyzer.dart'; 6 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttify-project/janalytics_fluttify/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip 6 | -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | janalytics_fluttify_example 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:pedantic/analysis_options.yaml 2 | 3 | linter: 4 | rules: 5 | camel_case_types: false 6 | camel_case_extensions: false 7 | omit_local_variable_types: false 8 | prefer_single_quotes: false 9 | unnecessary_this: false -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18cd7a3601bcffb36fdf2f679f763b5e827c2e8e 8 | channel: beta 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 18cd7a3601bcffb36fdf2f679f763b5e827c2e8e 8 | channel: beta 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /lib/src/ios/constants.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | import 'package:flutter/services.dart'; 6 | import '../facade/objects.g.dart'; 7 | 8 | -------------------------------------------------------------------------------- /lib/src/android/constants.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | import 'package:flutter/services.dart'; 6 | import '../facade/objects.g.dart'; 7 | 8 | -------------------------------------------------------------------------------- /ios/Classes/SubHandler/SubHandler0.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "JanalyticsFluttifyPlugin.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface JanalyticsFluttifyPlugin (SubHandler0) 10 | - (NSDictionary*) getSubHandler0; 11 | @end 12 | 13 | NS_ASSUME_NONNULL_END 14 | -------------------------------------------------------------------------------- /ios/Classes/SubHandler/Custom/SubHandlerCustom.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "JanalyticsFluttifyPlugin.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface JanalyticsFluttifyPlugin (SubHandlerCustom) 10 | - (NSDictionary*) getSubHandlerCustom; 11 | @end 12 | 13 | NS_ASSUME_NONNULL_END 14 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: janalytics_fluttify_example 2 | description: Demonstrates how to use the janalytics_fluttify plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.6.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | cupertino_icons: ^0.1.3 12 | decorated_flutter: ^0.18.0 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | janalytics_fluttify: 18 | path: ../ 19 | 20 | flutter: 21 | uses-material-design: true -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /example/android/app/src/main/java/me/yohom/janalytics_fluttify_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package me.yohom.janalytics_fluttify_example; 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity; 5 | import io.flutter.embedding.engine.FlutterEngine; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 yohom 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /ios/Classes/JanalyticsFluttifyPlugin.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import 6 | 7 | typedef void (^Handler)(NSObject *, id, FlutterResult); 8 | 9 | @interface JanalyticsFluttifyPlugin : NSObject 10 | 11 | - (instancetype) initWithFlutterPluginRegistrar: (NSObject *) registrar; 12 | 13 | @property(nonatomic) NSObject* registrar; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # janalytics_fluttify_example 2 | 3 | Demonstrates how to use the janalytics_fluttify plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /lib/src/facade/objects.g.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 3 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 4 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 5 | 6 | const kJanalyticsFluttifyMessageCodec = FluttifyMessageCodec(tag: 'janalytics_fluttify'/*, androidCaster: JanalyticsFluttifyAndroidAs, iosCaster: JanalyticsFluttifyIOSAs*/); 7 | const kJanalyticsFluttifyMethodCodec = StandardMethodCodec(kJanalyticsFluttifyMessageCodec); 8 | const kJanalyticsFluttifyChannel = MethodChannel('me.yohom/janalytics_fluttify', kJanalyticsFluttifyMethodCodec); 9 | const kJanalyticsFluttifyProjectName = 'janalytics_fluttify'; -------------------------------------------------------------------------------- /lib/src/ios/ios.export.g.dart: -------------------------------------------------------------------------------- 1 | export 'constants.g.dart'; 2 | export 'functions.g.dart'; 3 | export 'JANALYTICSBrowseEvent.g.dart'; 4 | export 'JANALYTICSCalculateEvent.g.dart'; 5 | export 'JANALYTICSCountEvent.g.dart'; 6 | export 'JANALYTICSEventObject.g.dart'; 7 | export 'JANALYTICSLaunchConfig.g.dart'; 8 | export 'JANALYTICSLoginEvent.g.dart'; 9 | export 'JANALYTICSPaid.g.dart'; 10 | export 'JANALYTICSPurchaseCurrency.g.dart'; 11 | export 'JANALYTICSPurchaseEvent.g.dart'; 12 | export 'JANALYTICSRegisterEvent.g.dart'; 13 | export 'JANALYTICSService.g.dart'; 14 | export 'JANALYTICSSex.g.dart'; 15 | export 'JANALYTICSUserInfo.g.dart'; 16 | export 'type_op.g.dart'; 17 | export 'package:jcore_fluttify/jcore_fluttify.dart'; 18 | export '../facade/objects.g.dart'; 19 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "janalytics_fluttify_example", 3 | "short_name": "janalytics_fluttify_example", 4 | "start_url": ".", 5 | "display": "minimal-ui", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "Demonstrates how to use the janalytics_fluttify plugin.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/ios/functions.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 10 | import 'package:flutter/foundation.dart'; 11 | import 'package:flutter/services.dart'; 12 | 13 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 14 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 15 | 16 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /ios/Classes/SubHandler/Custom/SubHandlerCustom.m: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "SubHandlerCustom.h" 6 | #import "JANALYTICSEventObject.h" 7 | #import "JAnalytics/JANALYTICSService.h" 8 | 9 | // Dart端一次方法调用所存在的栈, 只有当MethodChannel传递参数受限时, 再启用这个容器 10 | extern NSMutableDictionary* STACK; 11 | // Dart端随机存取对象的容器 12 | extern NSMutableDictionary* HEAP; 13 | // 日志打印开关 14 | extern BOOL enableLog; 15 | 16 | @implementation JanalyticsFluttifyPlugin (SubHandlerCustom) 17 | - (NSDictionary*) getSubHandlerCustom { 18 | __weak __typeof(self)weakSelf = self; 19 | return @{ 20 | 21 | }; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: janalytics_fluttify 2 | description: A `JAnalytics` Component, Powered By `Fluttify` Engine. 3 | version: 0.3.2+1 4 | author: yohom 5 | homepage: https://github.com/fluttify-project/janalytics_fluttify 6 | 7 | environment: 8 | sdk: ">=2.6.0 <3.0.0" 9 | flutter: ">=1.12.13 <2.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | jcore_fluttify: ^0.3.0 15 | 16 | foundation_fluttify: ^0.11.1 17 | core_location_fluttify: ^0.6.0 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | pedantic: ^1.9.2 23 | 24 | flutter: 25 | plugin: 26 | platforms: 27 | android: 28 | package: me.yohom.janalytics_fluttify 29 | pluginClass: JanalyticsFluttifyPlugin 30 | ios: 31 | pluginClass: JanalyticsFluttifyPlugin -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:janalytics_fluttify_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/AccountCallback.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | 16 | 17 | mixin cn_jiguang_analytics_android_api_AccountCallback on java_lang_Object { 18 | 19 | 20 | 21 | 22 | @override 23 | final String tag__ = 'janalytics_fluttify'; 24 | 25 | 26 | 27 | 28 | 29 | /* @mustCallSuper */ 30 | Future callback(int var1, String var2) {} 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSSex.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum JANALYTICSSex { 7 | JANALYTICSSexUnknown /* null */, 8 | JANALYTICSSexMale /* null */, 9 | JANALYTICSSexFemale /* null */ 10 | } 11 | 12 | extension JANALYTICSSexToX on JANALYTICSSex { 13 | int toValue() { 14 | switch (this) { 15 | case JANALYTICSSex.JANALYTICSSexUnknown: return JANALYTICSSex.JANALYTICSSexUnknown.index + 0; 16 | case JANALYTICSSex.JANALYTICSSexMale: return JANALYTICSSex.JANALYTICSSexMale.index + 0; 17 | case JANALYTICSSex.JANALYTICSSexFemale: return JANALYTICSSex.JANALYTICSSexFemale.index + 0; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension JANALYTICSSexFromX on int { 24 | JANALYTICSSex toJANALYTICSSex() { 25 | switch (this) { 26 | 27 | default: return JANALYTICSSex.values[this + 0]; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /lib/src/android/android.export.g.dart: -------------------------------------------------------------------------------- 1 | export 'cn/analytics/client/android/BuildConfig.g.dart'; 2 | export 'cn/jiguang/analytics/android/api/Account.g.dart'; 3 | export 'cn/jiguang/analytics/android/api/AccountCallback.g.dart'; 4 | export 'cn/jiguang/analytics/android/api/agent/JMMIClick.g.dart'; 5 | export 'cn/jiguang/analytics/android/api/agent/JMMIDlgPupW.g.dart'; 6 | export 'cn/jiguang/analytics/android/api/BrowseEvent.g.dart'; 7 | export 'cn/jiguang/analytics/android/api/CalculateEvent.g.dart'; 8 | export 'cn/jiguang/analytics/android/api/CountEvent.g.dart'; 9 | export 'cn/jiguang/analytics/android/api/Currency.g.dart'; 10 | export 'cn/jiguang/analytics/android/api/Event.g.dart'; 11 | export 'cn/jiguang/analytics/android/api/JAnalyticsInterface.g.dart'; 12 | export 'cn/jiguang/analytics/android/api/LoginEvent.g.dart'; 13 | export 'cn/jiguang/analytics/android/api/PurchaseEvent.g.dart'; 14 | export 'cn/jiguang/analytics/android/api/RegisterEvent.g.dart'; 15 | export 'cn/jiguang/analytics/android/view/BuryWebActivity.g.dart'; 16 | export 'constants.g.dart'; 17 | export 'type_op.g.dart'; 18 | export 'package:jcore_fluttify/jcore_fluttify.dart'; 19 | export '../facade/objects.g.dart'; 20 | -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSPaid.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum JANALYTICSPaid { 7 | JANALYTICSPaidUnknown /* null */, 8 | JANALYTICSPaidPaid /* null */, 9 | JANALYTICSPaidUnpaid /* null */ 10 | } 11 | 12 | extension JANALYTICSPaidToX on JANALYTICSPaid { 13 | int toValue() { 14 | switch (this) { 15 | case JANALYTICSPaid.JANALYTICSPaidUnknown: return JANALYTICSPaid.JANALYTICSPaidUnknown.index + 0; 16 | case JANALYTICSPaid.JANALYTICSPaidPaid: return JANALYTICSPaid.JANALYTICSPaidPaid.index + 0; 17 | case JANALYTICSPaid.JANALYTICSPaidUnpaid: return JANALYTICSPaid.JANALYTICSPaidUnpaid.index + 0; 18 | default: return 0; 19 | } 20 | } 21 | } 22 | 23 | extension JANALYTICSPaidFromX on int { 24 | JANALYTICSPaid toJANALYTICSPaid() { 25 | switch (this) { 26 | 27 | default: return JANALYTICSPaid.values[this + 0]; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSPurchaseCurrency.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum JANALYTICSPurchaseCurrency { 7 | JANALYTICSCurrencyCNY /* null */, 8 | JANALYTICSCurrencyUSD /* null */ 9 | } 10 | 11 | extension JANALYTICSPurchaseCurrencyToX on JANALYTICSPurchaseCurrency { 12 | int toValue() { 13 | switch (this) { 14 | case JANALYTICSPurchaseCurrency.JANALYTICSCurrencyCNY: return JANALYTICSPurchaseCurrency.JANALYTICSCurrencyCNY.index + 0; 15 | case JANALYTICSPurchaseCurrency.JANALYTICSCurrencyUSD: return JANALYTICSPurchaseCurrency.JANALYTICSCurrencyUSD.index + 0; 16 | default: return 0; 17 | } 18 | } 19 | } 20 | 21 | extension JANALYTICSPurchaseCurrencyFromX on int { 22 | JANALYTICSPurchaseCurrency toJANALYTICSPurchaseCurrency() { 23 | switch (this) { 24 | 25 | default: return JANALYTICSPurchaseCurrency.values[this + 0]; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/Currency.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | enum cn_jiguang_analytics_android_api_Currency { 7 | CNY /* null */, 8 | USD /* null */ 9 | } 10 | 11 | extension cn_jiguang_analytics_android_api_CurrencyToX on cn_jiguang_analytics_android_api_Currency { 12 | int toValue() { 13 | switch (this) { 14 | case cn_jiguang_analytics_android_api_Currency.CNY: return cn_jiguang_analytics_android_api_Currency.CNY.index + 0; 15 | case cn_jiguang_analytics_android_api_Currency.USD: return cn_jiguang_analytics_android_api_Currency.USD.index + 0; 16 | default: return 0; 17 | } 18 | } 19 | } 20 | 21 | extension cn_jiguang_analytics_android_api_CurrencyFromX on int { 22 | cn_jiguang_analytics_android_api_Currency tocn_jiguang_analytics_android_api_Currency() { 23 | switch (this) { 24 | 25 | default: return cn_jiguang_analytics_android_api_Currency.values[this + 0]; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /lib/src/facade/page_analyzer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:janalytics_fluttify/janalytics_fluttify.dart'; 3 | 4 | class PageAnalyzer extends NavigatorObserver { 5 | static PageAnalyzer instance = PageAnalyzer._(); 6 | 7 | PageAnalyzer._(); 8 | 9 | @override 10 | void didPush(Route route, Route previousRoute) { 11 | if (previousRoute?.settings?.name != null) { 12 | JAnalytics.onPageEnd(previousRoute.settings.name); 13 | } 14 | 15 | if (route.settings.name != null) { 16 | JAnalytics.onPageStart(route.settings.name); 17 | } 18 | } 19 | 20 | @override 21 | void didPop(Route route, Route previousRoute) { 22 | if (route.settings.name != null) { 23 | JAnalytics.onPageEnd(route.settings.name); 24 | } 25 | 26 | if (previousRoute?.settings?.name != null) { 27 | JAnalytics.onPageStart(previousRoute.settings.name); 28 | } 29 | } 30 | 31 | @override 32 | void didReplace({Route newRoute, Route oldRoute}) { 33 | if (oldRoute?.settings?.name != null) { 34 | JAnalytics.onPageEnd(oldRoute.settings.name); 35 | } 36 | 37 | if (newRoute.settings.name != null) { 38 | JAnalytics.onPageStart(newRoute.settings.name); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 32 | end 33 | 34 | post_install do |installer| 35 | installer.pods_project.targets.each do |target| 36 | flutter_additional_ios_build_settings(target) 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /ios/janalytics_fluttify.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'janalytics_fluttify' 6 | s.version = '0.0.1' 7 | s.summary = 'A `JAnalytics` Component, Powered By `Fluttify` Engine.' 8 | s.description = <<-DESC 9 | A new flutter plugin project. 10 | DESC 11 | s.homepage = 'https://github.com/fluttify-project/janalytics_fluttify' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'yohom' => 'yohombao@qq.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = ['Classes/**/*.h', 'Vendors/*.h'] # 只接收顶层的.h文件, 防止framework下面的.h文件被包含 17 | s.dependency 'Flutter' 18 | s.dependency 'foundation_fluttify' 19 | # flutter plugin dependency 20 | s.dependency 'jcore_fluttify' 21 | # sdk dependency 22 | s.dependency 'JAnalytics', '2.1.2' 23 | 24 | s.static_framework = true 25 | s.ios.deployment_target = '8.0' 26 | # include project framework 27 | s.vendored_frameworks = 'Vendors/*.framework' 28 | # include project .a 29 | s.vendored_libraries = 'Vendors/*.a' 30 | # ios system framework 31 | s.frameworks = [ 32 | 33 | ] 34 | # ios system library 35 | s.libraries = [ 36 | 37 | ] 38 | # resources 39 | s.resources = 'Vendors/**/*.bundle' 40 | # s.resource_bundles = { 41 | # 'janalytics_fluttify' => ['Vendors/*.framework/*.bundle'] 42 | # } 43 | end 44 | 45 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | janalytics_fluttify_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | io.flutter.embedded_views_preview 45 | YES 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/Classes/JanalyticsFluttifyPlugin.m: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | #import "JanalyticsFluttifyPlugin.h" 6 | #import 7 | #import "SubHandler/SubHandler0.h" 8 | #import "SubHandler/Custom/SubHandlerCustom.h" 9 | #import "FluttifyMessageCodec.h" 10 | #import 11 | #import 12 | 13 | // Dart端一次方法调用所存在的栈, 只有当MethodChannel传递参数受限时, 再启用这个容器 14 | extern NSMutableDictionary* STACK; 15 | // Dart端随机存取对象的容器 16 | extern NSMutableDictionary* HEAP; 17 | // 日志打印开关 18 | extern BOOL enableLog; 19 | 20 | @interface JanalyticsFluttifyPlugin (_Delegate) @end 21 | 22 | @implementation JanalyticsFluttifyPlugin { 23 | NSMutableDictionary* _handlerMap; 24 | } 25 | 26 | - (instancetype) initWithFlutterPluginRegistrar: (NSObject *) registrar { 27 | self = [super init]; 28 | if (self) { 29 | _registrar = registrar; 30 | // 处理方法们 31 | _handlerMap = @{}.mutableCopy; 32 | 33 | [_handlerMap addEntriesFromDictionary: [self getSubHandler0]]; 34 | [_handlerMap addEntriesFromDictionary: [self getSubHandlerCustom]]; 35 | } 36 | 37 | return self; 38 | } 39 | 40 | + (void)registerWithRegistrar:(NSObject *)registrar { 41 | FlutterMethodChannel *channel = [FlutterMethodChannel 42 | methodChannelWithName:@"me.yohom/janalytics_fluttify" 43 | binaryMessenger:[registrar messenger] 44 | codec:[FlutterStandardMethodCodec codecWithReaderWriter:[[FluttifyReaderWriter alloc] init]]]; 45 | 46 | [registrar addMethodCallDelegate:[[JanalyticsFluttifyPlugin alloc] initWithFlutterPluginRegistrar:registrar] 47 | channel:channel]; 48 | 49 | // 注册View 50 | 51 | } 52 | 53 | // Method Handlers 54 | - (void)handleMethodCall:(FlutterMethodCall *)methodCall result:(FlutterResult)methodResult { 55 | if (_handlerMap[methodCall.method] != nil) { 56 | _handlerMap[methodCall.method](_registrar, [methodCall arguments], methodResult); 57 | } else { 58 | methodResult(FlutterMethodNotImplemented); 59 | } 60 | } 61 | 62 | // 委托方法们 63 | 64 | 65 | @end -------------------------------------------------------------------------------- /android/src/main/java/me/yohom/janalytics_fluttify/sub_handler/custom/SubHandlerCustom.java: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | package me.yohom.janalytics_fluttify.sub_handler.custom; 6 | 7 | import android.os.Bundle; 8 | import android.util.Log; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Collection; 12 | import java.util.HashMap; 13 | import java.util.List; 14 | import java.util.Map; 15 | 16 | import androidx.annotation.NonNull; 17 | import io.flutter.embedding.engine.plugins.FlutterPlugin; 18 | import io.flutter.plugin.common.BinaryMessenger; 19 | import io.flutter.plugin.common.MethodCall; 20 | import io.flutter.plugin.common.MethodChannel; 21 | import io.flutter.plugin.common.PluginRegistry.Registrar; 22 | import io.flutter.plugin.platform.PlatformViewRegistry; 23 | 24 | import me.yohom.janalytics_fluttify.JanalyticsFluttifyPlugin.Handler; 25 | 26 | import static me.yohom.foundation_fluttify.FoundationFluttifyPluginKt.getEnableLog; 27 | import static me.yohom.foundation_fluttify.FoundationFluttifyPluginKt.getHEAP; 28 | 29 | @SuppressWarnings("ALL") 30 | public class SubHandlerCustom { 31 | public static SubHandlerCustom instance = new SubHandlerCustom(); 32 | 33 | private SubHandlerCustom() {} 34 | 35 | public Map getSubHandler(BinaryMessenger messenger, android.app.Activity activity) { 36 | return new HashMap() {{ 37 | put("", (args, methodResult) -> { 38 | // args 39 | 40 | // ref 41 | 42 | // invoke native method 43 | try { 44 | 45 | } catch (Throwable throwable) { 46 | throwable.printStackTrace(); 47 | if (getEnableLog()) { 48 | Log.d("Current HEAP: ", getHEAP().toString()); 49 | } 50 | methodResult.error(throwable.getMessage(), null, null); 51 | return; 52 | } 53 | 54 | // convert result to jsonable result 55 | String jsonableResult = "success"; 56 | 57 | methodResult.success(jsonableResult); 58 | }); 59 | }}; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "me.yohom.janalytics_fluttify_example" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | 43 | manifestPlaceholders = [ 44 | JPUSH_APPKEY : "d8995694b85ea9b3d22450c1", //JPush上注册的包名对应的appkey. 45 | JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. 46 | ] 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | testImplementation 'junit:junit:4.12' 64 | androidTestImplementation 'androidx.test:runner:1.1.1' 65 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 66 | } 67 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'me.yohom.janalytics_fluttify' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | maven { url 'http://download.flutter.io' } 9 | maven { url "https://oss.sonatype.org/content/groups/public" } 10 | maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } 11 | maven { url "https://dl.bintray.com/aweme-open-sdk-team/public" } 12 | maven { url 'http://developer.huawei.com/repo/' } 13 | } 14 | 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.5.0' 17 | } 18 | } 19 | 20 | rootProject.allprojects { 21 | repositories { 22 | google() 23 | jcenter() 24 | maven { url 'http://download.flutter.io' } 25 | maven { url "https://oss.sonatype.org/content/groups/public" } 26 | maven { url "http://maven.aliyun.com/nexus/content/groups/public/" } 27 | maven { url "https://dl.bintray.com/aweme-open-sdk-team/public" } 28 | maven { url 'http://developer.huawei.com/repo/' } 29 | } 30 | } 31 | 32 | apply plugin: 'com.android.library' 33 | 34 | android { 35 | compileSdkVersion 28 36 | 37 | sourceSets { 38 | main.java.srcDirs += 'src/main/kotlin' 39 | main.jniLibs.srcDir 'libs' 40 | } 41 | defaultConfig { 42 | minSdkVersion 16 43 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 44 | } 45 | lintOptions { 46 | disable 'InvalidPackage' 47 | } 48 | compileOptions { 49 | targetCompatibility JavaVersion.VERSION_1_8 50 | sourceCompatibility JavaVersion.VERSION_1_8 51 | } 52 | packagingOptions { 53 | merge 'res/values/values.xml' 54 | merge 'AndroidManifest.xml' 55 | merge 'R.txt' 56 | merge 'classes.jar' 57 | merge 'proguard.txt' 58 | } 59 | buildTypes { 60 | release { 61 | consumerProguardFiles "proguard-rules.pro" 62 | } 63 | } 64 | } 65 | 66 | dependencies { 67 | implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) 68 | implementation 'androidx.annotation:annotation:1.1.0' 69 | implementation 'androidx.appcompat:appcompat:1.1.0' 70 | compileOnly rootProject.findProject(":foundation_fluttify") 71 | // flutter plugin dependency 72 | compileOnly rootProject.findProject(":jcore_fluttify") 73 | // sdk dependency 74 | api 'cn.jiguang.sdk:janalytics:2.1.2' 75 | } 76 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:decorated_flutter/decorated_flutter.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:janalytics_fluttify/janalytics_fluttify.dart'; 4 | 5 | Future main() async { 6 | runApp(MyApp()); 7 | 8 | JAnalytics.init(iosKey: 'e36112dc89935e81b2f77d03'); 9 | } 10 | 11 | class MyApp extends StatefulWidget { 12 | @override 13 | _MyAppState createState() => _MyAppState(); 14 | } 15 | 16 | class _MyAppState extends State { 17 | @override 18 | Widget build(BuildContext context) { 19 | return MaterialApp(home: HomeScreen()); 20 | } 21 | } 22 | 23 | class HomeScreen extends StatelessWidget { 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | appBar: AppBar( 28 | title: const Text('Plugin example app'), 29 | ), 30 | body: DecoratedColumn( 31 | padding: EdgeInsets.all(kSpaceBig), 32 | crossAxisAlignment: CrossAxisAlignment.stretch, 33 | mainAxisAlignment: MainAxisAlignment.center, 34 | itemSpacing: kSpaceBig, 35 | children: [ 36 | RaisedButton( 37 | onPressed: () async { 38 | await JAnalytics.setDebugEnable(true); 39 | }, 40 | child: Text('是否打开日志'), 41 | ), 42 | RaisedButton( 43 | onPressed: () async { 44 | await JAnalytics.startCrashHandler(); 45 | }, 46 | child: Text('打开奔溃日志上报'), 47 | ), 48 | RaisedButton( 49 | onPressed: () async { 50 | await JAnalytics.onPageStart('test page'); 51 | }, 52 | child: Text('页面流统计 页面开始'), 53 | ), 54 | RaisedButton( 55 | onPressed: () async { 56 | await JAnalytics.onPageEnd('test page'); 57 | }, 58 | child: Text('页面流统计 页面结束'), 59 | ), 60 | RaisedButton( 61 | onPressed: () async { 62 | await JAnalytics.onEvent(CountEvent(eventId: "test event")); 63 | }, 64 | child: Text('自定义事件'), 65 | ), 66 | RaisedButton( 67 | onPressed: () async { 68 | await JAnalytics.setReportPeriod(Duration(seconds: 60)); 69 | }, 70 | child: Text('设置统计上报的自动周期'), 71 | ), 72 | RaisedButton( 73 | onPressed: () async { 74 | // await JAnalytics.identifyAccount(CountEvent(eventId: "test event")); 75 | }, 76 | child: Text('为用户增加账户信息'), 77 | ), 78 | ], 79 | ), 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/src/android/cn/analytics/client/android/BuildConfig.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_analytics_client_android_BuildConfig extends java_lang_Object { 16 | //region constants 17 | static const String name__ = 'cn.analytics.client.android.BuildConfig'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | static final String APPLICATION_ID = "cn.analytics.client.android"; 23 | static final String BUILD_TYPE = "release"; 24 | static final String FLAVOR = ""; 25 | static final int VERSION_CODE = 1; 26 | static final String VERSION_NAME = "2.1.2"; 27 | //endregion 28 | 29 | //region creators 30 | static Future create__() async { 31 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 32 | 'ObjectFactory::createcn_analytics_client_android_BuildConfig__', 33 | 34 | ); 35 | return JanalyticsFluttifyAndroidAs(__result__); 36 | } 37 | 38 | static Future> create_batch__(int length) async { 39 | assert(true); 40 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 41 | 'ObjectFactory::create_batchcn_analytics_client_android_BuildConfig__', 42 | {'length': length} 43 | ); 44 | return __result_batch__ 45 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 46 | .toList(); 47 | } 48 | 49 | //endregion 50 | 51 | //region getters 52 | static Future get_static_DEBUG() async { 53 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("cn.analytics.client.android.BuildConfig::get_DEBUG", ); 54 | return __result__; 55 | } 56 | 57 | //endregion 58 | 59 | //region setters 60 | 61 | //endregion 62 | 63 | //region methods 64 | 65 | //endregion 66 | 67 | @override 68 | String toString() { 69 | return 'cn_analytics_client_android_BuildConfig{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 70 | } 71 | } 72 | 73 | extension cn_analytics_client_android_BuildConfig_Batch on List { 74 | //region getters 75 | Future> get_static_DEBUG_batch() async { 76 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("cn.analytics.client.android.BuildConfig::get_DEBUG_batch", [for (final __item__ in this) {'__this__': __item__}]); 77 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 78 | } 79 | 80 | //endregion 81 | 82 | //region setters 83 | 84 | //endregion 85 | 86 | //region methods 87 | 88 | //endregion 89 | } -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSCountEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSCountEvent extends JANALYTICSEventObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSCountEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSCountEvent', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSCountEvent', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future get_eventID() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSCountEvent::get_eventID", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | //endregion 54 | 55 | //region setters 56 | Future set_eventID(String eventID) async { 57 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSCountEvent::set_eventID', {'__this__': this, "eventID": eventID}); 58 | 59 | 60 | } 61 | 62 | //endregion 63 | 64 | //region methods 65 | 66 | //endregion 67 | 68 | @override 69 | String toString() { 70 | return 'JANALYTICSCountEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 71 | } 72 | } 73 | 74 | extension JANALYTICSCountEvent_Batch on List { 75 | //region getters 76 | Future> get_eventID_batch() async { 77 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSCountEvent::get_eventID_batch", [for (final __item__ in this) {'__this__': __item__}]); 78 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 79 | } 80 | 81 | //endregion 82 | 83 | //region setters 84 | Future set_eventID_batch(List eventID) async { 85 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSCountEvent::set_eventID_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "eventID": eventID[__i__]}]); 86 | 87 | 88 | } 89 | 90 | //endregion 91 | 92 | //region methods 93 | 94 | //endregion 95 | } -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSEventObject.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSEventObject extends NSObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSEventObject'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSEventObject', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSEventObject', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future> get_extra() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSEventObject::get_extra", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | //endregion 54 | 55 | //region setters 56 | Future set_extra(Map extra) async { 57 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSEventObject::set_extra', {'__this__': this, "extra": extra}); 58 | 59 | 60 | } 61 | 62 | //endregion 63 | 64 | //region methods 65 | 66 | //endregion 67 | 68 | @override 69 | String toString() { 70 | return 'JANALYTICSEventObject{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 71 | } 72 | } 73 | 74 | extension JANALYTICSEventObject_Batch on List { 75 | //region getters 76 | Future>> get_extra_batch() async { 77 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSEventObject::get_extra_batch", [for (final __item__ in this) {'__this__': __item__}]); 78 | return (resultBatch as List)?.map((__result__) => __result__)?.cast>()?.toList(); 79 | } 80 | 81 | //endregion 82 | 83 | //region setters 84 | Future set_extra_batch(List> extra) async { 85 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSEventObject::set_extra_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "extra": extra[__i__]}]); 86 | 87 | 88 | } 89 | 90 | //endregion 91 | 92 | //region methods 93 | 94 | //endregion 95 | } -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/view/BuryWebActivity.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_jiguang_analytics_android_view_BuryWebActivity extends android_app_Activity { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.view.BuryWebActivity'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createcn_jiguang_analytics_android_view_BuryWebActivity__', 29 | 30 | ); 31 | return JanalyticsFluttifyAndroidAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_view_BuryWebActivity__', 38 | {'length': length} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | 49 | //endregion 50 | 51 | //region setters 52 | 53 | //endregion 54 | 55 | //region methods 56 | 57 | Future onBackPressed() async { 58 | // print log 59 | if (fluttifyLogEnabled) { 60 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.view.BuryWebActivity@$refId::onBackPressed([])'); 61 | } 62 | 63 | // invoke native method 64 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.view.BuryWebActivity::onBackPressed', {"__this__": this}); 65 | 66 | 67 | // handle native call 68 | 69 | 70 | return __result__; 71 | } 72 | 73 | //endregion 74 | 75 | @override 76 | String toString() { 77 | return 'cn_jiguang_analytics_android_view_BuryWebActivity{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 78 | } 79 | } 80 | 81 | extension cn_jiguang_analytics_android_view_BuryWebActivity_Batch on List { 82 | //region getters 83 | 84 | //endregion 85 | 86 | //region setters 87 | 88 | //endregion 89 | 90 | //region methods 91 | 92 | Future> onBackPressed_batch() async { 93 | assert(true); 94 | 95 | // invoke native method 96 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.view.BuryWebActivity::onBackPressed_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 97 | 98 | 99 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 100 | } 101 | 102 | //endregion 103 | } -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/agent/JMMIDlgPupW.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_jiguang_analytics_android_api_agent_JMMIDlgPupW extends java_lang_Object { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.api.agent.JMMIDlgPupW'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createcn_jiguang_analytics_android_api_agent_JMMIDlgPupW__', 29 | 30 | ); 31 | return JanalyticsFluttifyAndroidAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_agent_JMMIDlgPupW__', 38 | {'length': length} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | 49 | //endregion 50 | 51 | //region setters 52 | 53 | //endregion 54 | 55 | //region methods 56 | 57 | static Future onDismissPopupWindow(Object var0) async { 58 | // print log 59 | if (fluttifyLogEnabled) { 60 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.agent.JMMIDlgPupW::onDismissPopupWindow([\'var0\':$var0])'); 61 | } 62 | 63 | // invoke native method 64 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIDlgPupW::onDismissPopupWindow', {"var0": var0}); 65 | 66 | 67 | // handle native call 68 | 69 | 70 | return __result__; 71 | } 72 | 73 | //endregion 74 | 75 | @override 76 | String toString() { 77 | return 'cn_jiguang_analytics_android_api_agent_JMMIDlgPupW{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 78 | } 79 | } 80 | 81 | extension cn_jiguang_analytics_android_api_agent_JMMIDlgPupW_Batch on List { 82 | //region getters 83 | 84 | //endregion 85 | 86 | //region setters 87 | 88 | //endregion 89 | 90 | //region methods 91 | 92 | static Future> onDismissPopupWindow_batch(List var0) async { 93 | assert(true); 94 | 95 | // invoke native method 96 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIDlgPupW::onDismissPopupWindow_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__]}]); 97 | 98 | 99 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 100 | } 101 | 102 | //endregion 103 | } -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSLoginEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSLoginEvent extends JANALYTICSEventObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSLoginEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSLoginEvent', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSLoginEvent', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future get_method() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLoginEvent::get_method", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | Future get_success() async { 54 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLoginEvent::get_success", {'__this__': this}); 55 | return __result__; 56 | } 57 | 58 | //endregion 59 | 60 | //region setters 61 | Future set_method(String method) async { 62 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLoginEvent::set_method', {'__this__': this, "method": method}); 63 | 64 | 65 | } 66 | 67 | Future set_success(bool success) async { 68 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLoginEvent::set_success', {'__this__': this, "success": success}); 69 | 70 | 71 | } 72 | 73 | //endregion 74 | 75 | //region methods 76 | 77 | //endregion 78 | 79 | @override 80 | String toString() { 81 | return 'JANALYTICSLoginEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 82 | } 83 | } 84 | 85 | extension JANALYTICSLoginEvent_Batch on List { 86 | //region getters 87 | Future> get_method_batch() async { 88 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLoginEvent::get_method_batch", [for (final __item__ in this) {'__this__': __item__}]); 89 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 90 | } 91 | 92 | Future> get_success_batch() async { 93 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLoginEvent::get_success_batch", [for (final __item__ in this) {'__this__': __item__}]); 94 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 95 | } 96 | 97 | //endregion 98 | 99 | //region setters 100 | Future set_method_batch(List method) async { 101 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLoginEvent::set_method_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "method": method[__i__]}]); 102 | 103 | 104 | } 105 | 106 | Future set_success_batch(List success) async { 107 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLoginEvent::set_success_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "success": success[__i__]}]); 108 | 109 | 110 | } 111 | 112 | //endregion 113 | 114 | //region methods 115 | 116 | //endregion 117 | } -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSRegisterEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSRegisterEvent extends JANALYTICSEventObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSRegisterEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSRegisterEvent', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSRegisterEvent', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future get_method() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSRegisterEvent::get_method", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | Future get_success() async { 54 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSRegisterEvent::get_success", {'__this__': this}); 55 | return __result__; 56 | } 57 | 58 | //endregion 59 | 60 | //region setters 61 | Future set_method(String method) async { 62 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSRegisterEvent::set_method', {'__this__': this, "method": method}); 63 | 64 | 65 | } 66 | 67 | Future set_success(bool success) async { 68 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSRegisterEvent::set_success', {'__this__': this, "success": success}); 69 | 70 | 71 | } 72 | 73 | //endregion 74 | 75 | //region methods 76 | 77 | //endregion 78 | 79 | @override 80 | String toString() { 81 | return 'JANALYTICSRegisterEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 82 | } 83 | } 84 | 85 | extension JANALYTICSRegisterEvent_Batch on List { 86 | //region getters 87 | Future> get_method_batch() async { 88 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSRegisterEvent::get_method_batch", [for (final __item__ in this) {'__this__': __item__}]); 89 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 90 | } 91 | 92 | Future> get_success_batch() async { 93 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSRegisterEvent::get_success_batch", [for (final __item__ in this) {'__this__': __item__}]); 94 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 95 | } 96 | 97 | //endregion 98 | 99 | //region setters 100 | Future set_method_batch(List method) async { 101 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSRegisterEvent::set_method_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "method": method[__i__]}]); 102 | 103 | 104 | } 105 | 106 | Future set_success_batch(List success) async { 107 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSRegisterEvent::set_success_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "success": success[__i__]}]); 108 | 109 | 110 | } 111 | 112 | //endregion 113 | 114 | //region methods 115 | 116 | //endregion 117 | } -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSCalculateEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSCalculateEvent extends JANALYTICSEventObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSCalculateEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSCalculateEvent', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSCalculateEvent', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future get_eventID() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSCalculateEvent::get_eventID", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | Future get_value() async { 54 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSCalculateEvent::get_value", {'__this__': this}); 55 | return __result__; 56 | } 57 | 58 | //endregion 59 | 60 | //region setters 61 | Future set_eventID(String eventID) async { 62 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSCalculateEvent::set_eventID', {'__this__': this, "eventID": eventID}); 63 | 64 | 65 | } 66 | 67 | Future set_value(double value) async { 68 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSCalculateEvent::set_value', {'__this__': this, "value": value}); 69 | 70 | 71 | } 72 | 73 | //endregion 74 | 75 | //region methods 76 | 77 | //endregion 78 | 79 | @override 80 | String toString() { 81 | return 'JANALYTICSCalculateEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 82 | } 83 | } 84 | 85 | extension JANALYTICSCalculateEvent_Batch on List { 86 | //region getters 87 | Future> get_eventID_batch() async { 88 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSCalculateEvent::get_eventID_batch", [for (final __item__ in this) {'__this__': __item__}]); 89 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 90 | } 91 | 92 | Future> get_value_batch() async { 93 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSCalculateEvent::get_value_batch", [for (final __item__ in this) {'__this__': __item__}]); 94 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 95 | } 96 | 97 | //endregion 98 | 99 | //region setters 100 | Future set_eventID_batch(List eventID) async { 101 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSCalculateEvent::set_eventID_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "eventID": eventID[__i__]}]); 102 | 103 | 104 | } 105 | 106 | Future set_value_batch(List value) async { 107 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSCalculateEvent::set_value_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "value": value[__i__]}]); 108 | 109 | 110 | } 111 | 112 | //endregion 113 | 114 | //region methods 115 | 116 | //endregion 117 | } -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.5.0-nullsafety.1" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "2.1.0-nullsafety.1" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "1.1.0-nullsafety.3" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.2.0-nullsafety.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.0-nullsafety.1" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.15.0-nullsafety.3" 46 | core_location_fluttify: 47 | dependency: "direct main" 48 | description: 49 | name: core_location_fluttify 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "0.6.0" 53 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "1.2.0-nullsafety.1" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | foundation_fluttify: 71 | dependency: "direct main" 72 | description: 73 | name: foundation_fluttify 74 | url: "https://pub.flutter-io.cn" 75 | source: hosted 76 | version: "0.11.1" 77 | jcore_fluttify: 78 | dependency: "direct main" 79 | description: 80 | name: jcore_fluttify 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "0.3.0" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.flutter-io.cn" 89 | source: hosted 90 | version: "0.12.10-nullsafety.1" 91 | meta: 92 | dependency: transitive 93 | description: 94 | name: meta 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "1.3.0-nullsafety.3" 98 | path: 99 | dependency: transitive 100 | description: 101 | name: path 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "1.8.0-nullsafety.1" 105 | pedantic: 106 | dependency: "direct dev" 107 | description: 108 | name: pedantic 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "1.9.2" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | source_span: 118 | dependency: transitive 119 | description: 120 | name: source_span 121 | url: "https://pub.flutter-io.cn" 122 | source: hosted 123 | version: "1.8.0-nullsafety.2" 124 | stack_trace: 125 | dependency: transitive 126 | description: 127 | name: stack_trace 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "1.10.0-nullsafety.1" 131 | stream_channel: 132 | dependency: transitive 133 | description: 134 | name: stream_channel 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "2.1.0-nullsafety.1" 138 | string_scanner: 139 | dependency: transitive 140 | description: 141 | name: string_scanner 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "1.1.0-nullsafety.1" 145 | term_glyph: 146 | dependency: transitive 147 | description: 148 | name: term_glyph 149 | url: "https://pub.flutter-io.cn" 150 | source: hosted 151 | version: "1.2.0-nullsafety.1" 152 | test_api: 153 | dependency: transitive 154 | description: 155 | name: test_api 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "0.2.19-nullsafety.2" 159 | typed_data: 160 | dependency: transitive 161 | description: 162 | name: typed_data 163 | url: "https://pub.flutter-io.cn" 164 | source: hosted 165 | version: "1.3.0-nullsafety.3" 166 | vector_math: 167 | dependency: transitive 168 | description: 169 | name: vector_math 170 | url: "https://pub.flutter-io.cn" 171 | source: hosted 172 | version: "2.1.0-nullsafety.3" 173 | sdks: 174 | dart: ">=2.10.0-110 <2.11.0" 175 | flutter: ">=1.12.13 <2.0.0" 176 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Logo](https://github.com/fluttify-project/fluttify-core-example/blob/develop/other/Logo-Landscape.png?raw=true) 2 | 3 | # 极光 统计组件 Flutter插件 4 | [![pub package](https://img.shields.io/pub/v/janalytics_fluttify.svg)](https://pub.Flutter-io.cn/packages/janalytics_fluttify) 5 | 6 | # Fluttify系列插件 7 | | 名称 | 描述 | 仓库 | 8 | |:-----:|:-----:|:-----:| 9 | | [高德地图](https://github.com/fluttify-project/amap_map_fluttify) | 高德地图地图组件, 提供地图控件 | [![pub package](https://img.shields.io/pub/v/amap_map_fluttify.svg)](https://pub.Flutter-io.cn/packages/amap_map_fluttify) | 10 | | [高德定位](https://github.com/fluttify-project/amap_location_fluttify) | 高德地图定位组件, 提供独立的定位功能 | [![pub package](https://img.shields.io/pub/v/amap_location_fluttify.svg)](https://pub.Flutter-io.cn/packages/amap_location_fluttify) | 11 | | [高德搜索](https://github.com/fluttify-project/amap_search_fluttify) | 高德地图搜索组件, 提供poi搜索等功能 | [![pub package](https://img.shields.io/pub/v/amap_search_fluttify.svg)](https://pub.Flutter-io.cn/packages/amap_search_fluttify) | 12 | | [高德猎鹰](https://github.com/fluttify-project/amap_track_fluttify) | 高德地图猎鹰组件, 提供实时定位采集功能 | [![pub package](https://img.shields.io/pub/v/amap_track_fluttify.svg)](https://pub.Flutter-io.cn/packages/amap_track_fluttify) | 13 | | [百度地图](https://github.com/fluttify-project/bmap_map_fluttify) | 百度地图, 包含了地图控件, 定位以及搜索poi等功能 | [![pub package](https://img.shields.io/pub/v/bmap_map_fluttify.svg)](https://pub.Flutter-io.cn/packages/bmap_map_fluttify) | 14 | | [百度人脸识别](https://github.com/fluttify-project/baidu_face_flutter) | 百度人脸识别, 提供活体检测等功能 | [![pub package](https://img.shields.io/pub/v/baidu_face_flutter.svg)](https://pub.Flutter-io.cn/packages/baidu_face_flutter) | 15 | | [网易直播](https://github.com/fluttify-project/netease_live_fluttify) | 网易直播推流组件 | [![pub package](https://img.shields.io/pub/v/netease_live_fluttify.svg)](https://pub.Flutter-io.cn/packages/netease_live_fluttify) | 16 | | [网易云信](https://github.com/fluttify-project/nim_fluttify) | 网易云信 IM组件 | [![pub package](https://img.shields.io/pub/v/nim_fluttify.svg)](https://pub.Flutter-io.cn/packages/nim_fluttify) | 17 | | [腾讯直播](https://github.com/fluttify-project/tencent_live_fluttify) | 腾讯直播, 包含推流组件和播放组件 | [![pub package](https://img.shields.io/pub/v/tencent_live_fluttify.svg)](https://pub.Flutter-io.cn/packages/tencent_live_fluttify) | 18 | | [腾讯IM](https://github.com/fluttify-project/tim_fluttify) | 腾讯IM组件 | [![pub package](https://img.shields.io/pub/v/tim_fluttify.svg)](https://pub.Flutter-io.cn/packages/tim_fluttify) | 19 | | [腾讯地图](https://github.com/fluttify-project/tmap_map_fluttify) | 腾讯地图组件 | [![pub package](https://img.shields.io/pub/v/tmap_map_fluttify.svg)](https://pub.Flutter-io.cn/packages/tmap_map_fluttify) | 20 | | [讯飞语音合成](https://github.com/fluttify-project/xftts_fluttify) | 腾讯语言合成组件, 提供文字转语言功能 | [![pub package](https://img.shields.io/pub/v/xftts_fluttify.svg)](https://pub.flutter-io.cn/packages/xftts_fluttify) | 21 | | [极光统计](https://github.com/fluttify-project/janalytics_fluttify) | 极光统计组件, 提供异常上报等功能 | [![pub package](https://img.shields.io/pub/v/janalytics_fluttify.svg)](https://pub.flutter-io.cn/packages/janalytics_fluttify) | 22 | | [阿里云RTC](https://github.com/fluttify-project/ali_rtc_fluttify) | 阿里云实时音视频 | [![pub package](https://img.shields.io/pub/v/ali_rtc_fluttify.svg)](https://pub.flutter-io.cn/packages/ali_rtc_fluttify) | 23 | | [环信](https://github.com/fluttify-project/easemob_im_fluttify) | 环信IM | [![pub package](https://img.shields.io/pub/v/easemob_im_fluttify.svg)](https://pub.flutter-io.cn/packages/easemob_im_fluttify) | 24 | | [未完待续...](https://github.com/fluttify-project) | 如有其它需求, 请联系qq 382146139 | ![fluttify](https://img.shields.io/badge/fluttify-welcom-green) | 25 | 26 | ## 依赖 27 | ```yaml 28 | dependencies: 29 | flutter: 30 | sdk: flutter 31 | janalytics_fluttify: ^x.x.x 32 | ``` 33 | 34 | ## 配置 35 | #### Android 36 | 在 module 的 gradle 中添加依赖和AndroidManifest的替换变量。 37 | ```groovy 38 | android { 39 | ...... 40 | defaultConfig { 41 | applicationId "com.xxx.xxx" // 你应用的包名. 42 | ...... 43 | 44 | manifestPlaceholders = [ 45 | JPUSH_APPKEY : "你的appkey", //JPush上注册的包名对应的appkey. 46 | JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. 47 | ] 48 | ...... 49 | } 50 | ...... 51 | } 52 | ``` 53 | 54 | ## 导入 55 | ```dart 56 | import 'package:janalytics_fluttify/janalytics_fluttify.dart'; 57 | ``` 58 | 59 | ## 使用 60 | 参考[wiki](https://github.com/fluttify-project/janalytics_fluttify/wiki). 61 | 62 | ## 社区 63 | | QQ群 | 64 | | :----------: | 65 | | | 66 | 67 | ## LICENSE 68 | > Copyright (C) 2020 yohom 69 | > 70 | > This program is free software: you can redistribute it and/or modify 71 | > it under the terms of the GNU General Public License as published by 72 | > the Free Software Foundation, either version 3 of the License, or 73 | > (at your option) any later version. 74 | > 75 | > This program is distributed in the hope that it will be useful, 76 | > but WITHOUT ANY WARRANTY; without even the implied warranty of 77 | > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 78 | > GNU General Public License for more details. 79 | > 80 | > You should have received a copy of the GNU General Public License 81 | > along with this program. If not, see . 82 | -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/CountEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_jiguang_analytics_android_api_CountEvent extends cn_jiguang_analytics_android_api_Event with java_io_Serializable { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.api.CountEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__String(String var1) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createcn_jiguang_analytics_android_api_CountEvent__String', 29 | {"var1": var1} 30 | ); 31 | return JanalyticsFluttifyAndroidAs(__result__); 32 | } 33 | 34 | static Future create__() async { 35 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 36 | 'ObjectFactory::createcn_jiguang_analytics_android_api_CountEvent__', 37 | 38 | ); 39 | return JanalyticsFluttifyAndroidAs(__result__); 40 | } 41 | 42 | static Future> create_batch__String(List var1) async { 43 | assert(true); 44 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 45 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_CountEvent__String', 46 | [for (int __i__ = 0; __i__ < var1.length; __i__++) {"var1": var1[__i__]}] 47 | ); 48 | return __result_batch__ 49 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 50 | .toList(); 51 | } 52 | 53 | static Future> create_batch__(int length) async { 54 | assert(true); 55 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 56 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_CountEvent__', 57 | {'length': length} 58 | ); 59 | return __result_batch__ 60 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 61 | .toList(); 62 | } 63 | 64 | //endregion 65 | 66 | //region getters 67 | 68 | //endregion 69 | 70 | //region setters 71 | 72 | //endregion 73 | 74 | //region methods 75 | 76 | Future getEventId() async { 77 | // print log 78 | if (fluttifyLogEnabled) { 79 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.CountEvent@$refId::getEventId([])'); 80 | } 81 | 82 | // invoke native method 83 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CountEvent::getEventId', {"__this__": this}); 84 | 85 | 86 | // handle native call 87 | 88 | 89 | return __result__; 90 | } 91 | 92 | 93 | Future setEventId(String var1) async { 94 | // print log 95 | if (fluttifyLogEnabled) { 96 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.CountEvent@$refId::setEventId([\'var1\':$var1])'); 97 | } 98 | 99 | // invoke native method 100 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CountEvent::setEventId', {"var1": var1, "__this__": this}); 101 | 102 | 103 | // handle native call 104 | 105 | 106 | return JanalyticsFluttifyAndroidAs(__result__); 107 | } 108 | 109 | //endregion 110 | 111 | @override 112 | String toString() { 113 | return 'cn_jiguang_analytics_android_api_CountEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 114 | } 115 | } 116 | 117 | extension cn_jiguang_analytics_android_api_CountEvent_Batch on List { 118 | //region getters 119 | 120 | //endregion 121 | 122 | //region setters 123 | 124 | //endregion 125 | 126 | //region methods 127 | 128 | Future> getEventId_batch() async { 129 | assert(true); 130 | 131 | // invoke native method 132 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CountEvent::getEventId_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 133 | 134 | 135 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 136 | } 137 | 138 | 139 | Future> setEventId_batch(List var1) async { 140 | assert(true); 141 | 142 | // invoke native method 143 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CountEvent::setEventId_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 144 | 145 | 146 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 147 | } 148 | 149 | //endregion 150 | } -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/agent/JMMIClick.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_jiguang_analytics_android_api_agent_JMMIClick extends java_lang_Object { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.api.agent.JMMIClick'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createcn_jiguang_analytics_android_api_agent_JMMIClick__', 29 | 30 | ); 31 | return JanalyticsFluttifyAndroidAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_agent_JMMIClick__', 38 | {'length': length} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | 49 | //endregion 50 | 51 | //region setters 52 | 53 | //endregion 54 | 55 | //region methods 56 | 57 | static Future clickOn(android_view_View var0) async { 58 | // print log 59 | if (fluttifyLogEnabled) { 60 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.agent.JMMIClick::clickOn([])'); 61 | } 62 | 63 | // invoke native method 64 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIClick::clickOn', {"var0": var0}); 65 | 66 | 67 | // handle native call 68 | 69 | 70 | return __result__; 71 | } 72 | 73 | 74 | static Future onClick__Object__android_view_View(Object var0, android_view_View var1) async { 75 | // print log 76 | if (fluttifyLogEnabled) { 77 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.agent.JMMIClick::onClick([\'var0\':$var0])'); 78 | } 79 | 80 | // invoke native method 81 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIClick::onClick__Object__android_view_View', {"var0": var0, "var1": var1}); 82 | 83 | 84 | // handle native call 85 | 86 | 87 | return __result__; 88 | } 89 | 90 | 91 | static Future performClickTabLayoutTabView(android_view_View var0) async { 92 | // print log 93 | if (fluttifyLogEnabled) { 94 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.agent.JMMIClick::performClickTabLayoutTabView([])'); 95 | } 96 | 97 | // invoke native method 98 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIClick::performClickTabLayoutTabView', {"var0": var0}); 99 | 100 | 101 | // handle native call 102 | 103 | 104 | return __result__; 105 | } 106 | 107 | //endregion 108 | 109 | @override 110 | String toString() { 111 | return 'cn_jiguang_analytics_android_api_agent_JMMIClick{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 112 | } 113 | } 114 | 115 | extension cn_jiguang_analytics_android_api_agent_JMMIClick_Batch on List { 116 | //region getters 117 | 118 | //endregion 119 | 120 | //region setters 121 | 122 | //endregion 123 | 124 | //region methods 125 | 126 | static Future> clickOn_batch(List var0) async { 127 | assert(true); 128 | 129 | // invoke native method 130 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIClick::clickOn_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__]}]); 131 | 132 | 133 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 134 | } 135 | 136 | 137 | static Future> onClick__Object__android_view_View_batch(List var0, List var1) async { 138 | assert(var0.length == var1.length); 139 | 140 | // invoke native method 141 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIClick::onClick__Object__android_view_View_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__], "var1": var1[__i__]}]); 142 | 143 | 144 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 145 | } 146 | 147 | 148 | static Future> performClickTabLayoutTabView_batch(List var0) async { 149 | assert(true); 150 | 151 | // invoke native method 152 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.agent.JMMIClick::performClickTabLayoutTabView_batch', [for (int __i__ = 0; __i__ < var0.length; __i__++) {"var0": var0[__i__]}]); 153 | 154 | 155 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 156 | } 157 | 158 | //endregion 159 | } -------------------------------------------------------------------------------- /android/src/main/java/me/yohom/janalytics_fluttify/JanalyticsFluttifyPlugin.java: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////// 2 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 3 | ////////////////////////////////////////////////////////// 4 | 5 | package me.yohom.janalytics_fluttify; 6 | 7 | import android.os.Bundle; 8 | import android.util.Log; 9 | import android.app.Activity; 10 | 11 | import java.util.ArrayList; 12 | import java.util.Collection; 13 | import java.util.HashMap; 14 | import java.util.List; 15 | import java.util.Map; 16 | 17 | import androidx.annotation.NonNull; 18 | import io.flutter.embedding.engine.plugins.FlutterPlugin; 19 | import io.flutter.embedding.engine.plugins.activity.ActivityAware; 20 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; 21 | import io.flutter.plugin.common.BinaryMessenger; 22 | import io.flutter.plugin.common.MethodCall; 23 | import io.flutter.plugin.common.MethodChannel; 24 | import io.flutter.plugin.common.PluginRegistry.Registrar; 25 | import io.flutter.plugin.common.StandardMethodCodec; 26 | import io.flutter.plugin.platform.PlatformViewRegistry; 27 | 28 | import me.yohom.janalytics_fluttify.sub_handler.*; 29 | import me.yohom.janalytics_fluttify.sub_handler.custom.SubHandlerCustom; 30 | import me.yohom.foundation_fluttify.core.FluttifyMessageCodec; 31 | 32 | import static me.yohom.foundation_fluttify.FoundationFluttifyPluginKt.getEnableLog; 33 | import static me.yohom.foundation_fluttify.FoundationFluttifyPluginKt.getHEAP; 34 | 35 | @SuppressWarnings("ALL") 36 | public class JanalyticsFluttifyPlugin implements FlutterPlugin, MethodChannel.MethodCallHandler, ActivityAware { 37 | 38 | private static List> handlerMapList; 39 | 40 | // v1 android embedding for compatible 41 | public static void registerWith(Registrar registrar) { 42 | final MethodChannel channel = new MethodChannel(registrar.messenger(), "me.yohom/janalytics_fluttify", new StandardMethodCodec(new FluttifyMessageCodec())); 43 | 44 | JanalyticsFluttifyPlugin plugin = new JanalyticsFluttifyPlugin(); 45 | 46 | BinaryMessenger messenger = registrar.messenger(); 47 | PlatformViewRegistry platformViewRegistry = registrar.platformViewRegistry(); 48 | Activity activity = registrar.activity(); 49 | 50 | plugin.messenger = messenger; 51 | plugin.platformViewRegistry = platformViewRegistry; 52 | 53 | handlerMapList = new ArrayList<>(); 54 | handlerMapList.add(SubHandler0.getSubHandler(messenger)); 55 | handlerMapList.add(SubHandlerCustom.instance.getSubHandler(messenger, registrar.activity())); 56 | 57 | channel.setMethodCallHandler(plugin); 58 | 59 | // register platform view 60 | 61 | } 62 | 63 | private BinaryMessenger messenger; 64 | private PlatformViewRegistry platformViewRegistry; 65 | 66 | // v2 android embedding 67 | @Override 68 | public void onAttachedToEngine(FlutterPluginBinding binding) { 69 | if (getEnableLog()) { 70 | Log.d("fluttify-java", "JanalyticsFluttifyPlugin::onAttachedToEngine@" + binding); 71 | } 72 | 73 | final MethodChannel channel = new MethodChannel(binding.getBinaryMessenger(), "me.yohom/janalytics_fluttify", new StandardMethodCodec(new FluttifyMessageCodec())); 74 | 75 | messenger = binding.getBinaryMessenger(); 76 | platformViewRegistry = binding.getPlatformViewRegistry(); 77 | 78 | handlerMapList = new ArrayList<>(); 79 | handlerMapList.add(SubHandler0.getSubHandler(messenger)); 80 | 81 | channel.setMethodCallHandler(this); 82 | } 83 | 84 | @Override 85 | public void onDetachedFromEngine(FlutterPluginBinding binding) { 86 | if (getEnableLog()) { 87 | Log.d("fluttify-java", "JanalyticsFluttifyPlugin::onDetachedFromEngine@" + binding); 88 | } 89 | } 90 | 91 | @Override 92 | public void onAttachedToActivity(ActivityPluginBinding binding) { 93 | if (getEnableLog()) { 94 | Log.d("fluttify-java", "JanalyticsFluttifyPlugin::onAttachedToActivity@" + binding); 95 | } 96 | Activity activity = binding.getActivity(); 97 | 98 | handlerMapList.add(SubHandlerCustom.instance.getSubHandler(messenger, activity)); 99 | 100 | // register platform view 101 | 102 | } 103 | 104 | @Override 105 | public void onDetachedFromActivity() { 106 | if (getEnableLog()) { 107 | Log.d("fluttify-java", "JanalyticsFluttifyPlugin::onDetachedFromActivity"); 108 | } 109 | } 110 | 111 | @Override 112 | public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) { 113 | if (getEnableLog()) { 114 | Log.d("fluttify-java", "JanalyticsFluttifyPlugin::onReattachedToActivityForConfigChanges@" + binding); 115 | } 116 | } 117 | 118 | @Override 119 | public void onDetachedFromActivityForConfigChanges() { 120 | if (getEnableLog()) { 121 | Log.d("fluttify-java", "JanalyticsFluttifyPlugin::onDetachedFromActivityForConfigChanges"); 122 | } 123 | } 124 | 125 | @Override 126 | public void onMethodCall(@NonNull MethodCall methodCall, @NonNull MethodChannel.Result methodResult) { 127 | Handler handler = null; 128 | for (Map handlerMap : handlerMapList) { 129 | if (handlerMap.containsKey(methodCall.method)) { 130 | handler = handlerMap.get(methodCall.method); 131 | break; 132 | } 133 | } 134 | if (handler != null) { 135 | try { 136 | handler.call(methodCall.arguments, methodResult); 137 | } catch (Exception e) { 138 | e.printStackTrace(); 139 | methodResult.error(e.getMessage(), null, null); 140 | } 141 | } else { 142 | methodResult.notImplemented(); 143 | } 144 | } 145 | 146 | @FunctionalInterface 147 | public static interface Handler { 148 | void call(Object args, MethodChannel.Result methodResult) throws Exception; 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSBrowseEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSBrowseEvent extends JANALYTICSEventObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSBrowseEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSBrowseEvent', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSBrowseEvent', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future get_name() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_name", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | Future get_contentID() async { 54 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_contentID", {'__this__': this}); 55 | return __result__; 56 | } 57 | 58 | Future get_type() async { 59 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_type", {'__this__': this}); 60 | return __result__; 61 | } 62 | 63 | Future get_duration() async { 64 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_duration", {'__this__': this}); 65 | return __result__; 66 | } 67 | 68 | //endregion 69 | 70 | //region setters 71 | Future set_name(String name) async { 72 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_name', {'__this__': this, "name": name}); 73 | 74 | 75 | } 76 | 77 | Future set_contentID(String contentID) async { 78 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_contentID', {'__this__': this, "contentID": contentID}); 79 | 80 | 81 | } 82 | 83 | Future set_type(String type) async { 84 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_type', {'__this__': this, "type": type}); 85 | 86 | 87 | } 88 | 89 | Future set_duration(double duration) async { 90 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_duration', {'__this__': this, "duration": duration}); 91 | 92 | 93 | } 94 | 95 | //endregion 96 | 97 | //region methods 98 | 99 | //endregion 100 | 101 | @override 102 | String toString() { 103 | return 'JANALYTICSBrowseEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 104 | } 105 | } 106 | 107 | extension JANALYTICSBrowseEvent_Batch on List { 108 | //region getters 109 | Future> get_name_batch() async { 110 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_name_batch", [for (final __item__ in this) {'__this__': __item__}]); 111 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 112 | } 113 | 114 | Future> get_contentID_batch() async { 115 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_contentID_batch", [for (final __item__ in this) {'__this__': __item__}]); 116 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 117 | } 118 | 119 | Future> get_type_batch() async { 120 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_type_batch", [for (final __item__ in this) {'__this__': __item__}]); 121 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 122 | } 123 | 124 | Future> get_duration_batch() async { 125 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSBrowseEvent::get_duration_batch", [for (final __item__ in this) {'__this__': __item__}]); 126 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 127 | } 128 | 129 | //endregion 130 | 131 | //region setters 132 | Future set_name_batch(List name) async { 133 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_name_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "name": name[__i__]}]); 134 | 135 | 136 | } 137 | 138 | Future set_contentID_batch(List contentID) async { 139 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_contentID_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "contentID": contentID[__i__]}]); 140 | 141 | 142 | } 143 | 144 | Future set_type_batch(List type) async { 145 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_type_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "type": type[__i__]}]); 146 | 147 | 148 | } 149 | 150 | Future set_duration_batch(List duration) async { 151 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSBrowseEvent::set_duration_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "duration": duration[__i__]}]); 152 | 153 | 154 | } 155 | 156 | //endregion 157 | 158 | //region methods 159 | 160 | //endregion 161 | } -------------------------------------------------------------------------------- /lib/src/facade/janalytics.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 5 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 6 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 7 | 8 | import 'models.dart'; 9 | 10 | class JAnalytics { 11 | /// 初始化 12 | static Future init({ 13 | @required String iosKey, 14 | String channel = 'developer-default', 15 | }) async { 16 | await platform( 17 | android: (pool) async { 18 | final context = await android_app_Application.get(); 19 | 20 | await cn_jiguang_analytics_android_api_JAnalyticsInterface 21 | .init(context); 22 | await cn_jiguang_analytics_android_api_JAnalyticsInterface.setChannel( 23 | context, channel); 24 | }, 25 | ios: (pool) async { 26 | final config = await JANALYTICSLaunchConfig.create__(); 27 | await config.set_appKey(iosKey); 28 | await config.set_channel(channel); 29 | 30 | await JANALYTICSService.setupWithConfig(config); 31 | 32 | pool.add(config); 33 | }, 34 | ); 35 | } 36 | 37 | /// 是否打开debug日志 38 | static Future setDebugEnable(bool enable) async { 39 | await platform( 40 | android: (pool) async { 41 | await cn_jiguang_analytics_android_api_JAnalyticsInterface 42 | .setDebugMode(enable); 43 | }, 44 | ios: (pool) async { 45 | await JANALYTICSService.setDebug(enable); 46 | }, 47 | ); 48 | } 49 | 50 | /// 打开奔溃日志上报 51 | static Future startCrashHandler() async { 52 | await platform( 53 | android: (pool) async { 54 | final context = await android_app_Application.get(); 55 | await cn_jiguang_analytics_android_api_JAnalyticsInterface 56 | .initCrashHandler(context); 57 | }, 58 | ios: (pool) async { 59 | await JANALYTICSService.crashLogON(); 60 | }, 61 | ); 62 | } 63 | 64 | /// 页面流统计 页面开始 65 | static Future onPageStart(String pageName) async { 66 | assert(pageName != null); 67 | await platform( 68 | android: (pool) async { 69 | final context = await android_app_Activity.get(); 70 | await cn_jiguang_analytics_android_api_JAnalyticsInterface.onPageStart( 71 | context, pageName); 72 | }, 73 | ios: (pool) async { 74 | await JANALYTICSService.startLogPageView(pageName); 75 | }, 76 | ); 77 | } 78 | 79 | /// 页面流统计 页面结束 80 | static Future onPageEnd(String pageName) async { 81 | assert(pageName != null); 82 | await platform( 83 | android: (pool) async { 84 | final context = await android_app_Activity.get(); 85 | await cn_jiguang_analytics_android_api_JAnalyticsInterface.onPageEnd( 86 | context, pageName); 87 | }, 88 | ios: (pool) async { 89 | await JANALYTICSService.stopLogPageView(pageName); 90 | }, 91 | ); 92 | } 93 | 94 | /// 自定义事件 95 | static Future onEvent(Event event) async { 96 | assert(event != null); 97 | await platform( 98 | android: (pool) async { 99 | final context = await android_app_Activity.get(); 100 | await cn_jiguang_analytics_android_api_JAnalyticsInterface.onEvent( 101 | context, await event.toAndroidModel()); 102 | }, 103 | ios: (pool) async { 104 | await JANALYTICSService.eventRecord(await event.toIOSModel()); 105 | }, 106 | ); 107 | } 108 | 109 | /// 设置统计上报的自动周期,未调用前默认即时上报 110 | /// 111 | /// [period] 最小10秒,最大1天,超出范围会打印调用失败日志。传0表示统计数据即时上报 112 | static Future setReportPeriod(Duration period) async { 113 | assert( 114 | period == Duration.zero || 115 | (period.inSeconds >= 10 && period.inSeconds <= 24 * 60 * 60), 116 | ); 117 | await platform( 118 | android: (pool) async { 119 | final context = await android_app_Application.get(); 120 | await cn_jiguang_analytics_android_api_JAnalyticsInterface 121 | .setAnalyticsReportPeriod__android_content_Context__int( 122 | context, 123 | period.inSeconds, 124 | ); 125 | }, 126 | ios: (pool) async { 127 | await JANALYTICSService.setFrequency(period.inSeconds); 128 | }, 129 | ); 130 | } 131 | 132 | /// 为用户增加账户信息 133 | static Future identifyAccount(Account account) async { 134 | assert(account != null); 135 | final completer = Completer(); 136 | platform( 137 | android: (pool) async { 138 | final context = await android_app_Application.get(); 139 | await cn_jiguang_analytics_android_api_JAnalyticsInterface 140 | .identifyAccount__android_content_Context__cn_jiguang_analytics_android_api_Account__cn_jiguang_analytics_android_api_AccountCallback( 141 | context, 142 | await account.toAndroidModel(), 143 | _IdentifyAccountCallback(completer), 144 | ); 145 | }, 146 | ios: (pool) async { 147 | await JANALYTICSService.identifyAccount_with( 148 | await account.toIOSModel(), 149 | (err, msg) { 150 | if (err != 0) { 151 | completer.completeError(msg); 152 | } else { 153 | completer.complete(); 154 | } 155 | }, 156 | ); 157 | }, 158 | ); 159 | return completer.future; 160 | } 161 | 162 | /// 解绑当前用户信息 163 | static Future detachAccount() async { 164 | final completer = Completer(); 165 | platform( 166 | android: (pool) async { 167 | final context = await android_app_Application.get(); 168 | await cn_jiguang_analytics_android_api_JAnalyticsInterface 169 | .detachAccount__android_content_Context__cn_jiguang_analytics_android_api_AccountCallback( 170 | context, 171 | _IdentifyAccountCallback(completer), 172 | ); 173 | }, 174 | ios: (pool) async { 175 | await JANALYTICSService.detachAccount( 176 | (err, msg) { 177 | if (err != 0) { 178 | completer.completeError(msg); 179 | } else { 180 | completer.complete(); 181 | } 182 | }, 183 | ); 184 | }, 185 | ); 186 | return completer.future; 187 | } 188 | } 189 | 190 | class _IdentifyAccountCallback extends java_lang_Object 191 | with cn_jiguang_analytics_android_api_AccountCallback { 192 | final Completer completer; 193 | 194 | _IdentifyAccountCallback(this.completer) : assert(completer != null); 195 | 196 | @override 197 | Future callback(int var1, String var2) async { 198 | super.callback(var1, var2); 199 | if (var1 != 0) { 200 | completer.completeError(var2); 201 | } else { 202 | completer.complete(); 203 | } 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSLaunchConfig.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSLaunchConfig extends NSObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSLaunchConfig'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSLaunchConfig', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSLaunchConfig', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future get_appKey() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_appKey", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | Future get_channel() async { 54 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_channel", {'__this__': this}); 55 | return __result__; 56 | } 57 | 58 | Future get_advertisingId() async { 59 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_advertisingId", {'__this__': this}); 60 | return __result__; 61 | } 62 | 63 | Future get_isProduction() async { 64 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_isProduction", {'__this__': this}); 65 | return __result__; 66 | } 67 | 68 | //endregion 69 | 70 | //region setters 71 | Future set_appKey(String appKey) async { 72 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_appKey', {'__this__': this, "appKey": appKey}); 73 | 74 | 75 | } 76 | 77 | Future set_channel(String channel) async { 78 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_channel', {'__this__': this, "channel": channel}); 79 | 80 | 81 | } 82 | 83 | Future set_advertisingId(String advertisingId) async { 84 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_advertisingId', {'__this__': this, "advertisingId": advertisingId}); 85 | 86 | 87 | } 88 | 89 | Future set_isProduction(bool isProduction) async { 90 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_isProduction', {'__this__': this, "isProduction": isProduction}); 91 | 92 | 93 | } 94 | 95 | //endregion 96 | 97 | //region methods 98 | 99 | //endregion 100 | 101 | @override 102 | String toString() { 103 | return 'JANALYTICSLaunchConfig{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 104 | } 105 | } 106 | 107 | extension JANALYTICSLaunchConfig_Batch on List { 108 | //region getters 109 | Future> get_appKey_batch() async { 110 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_appKey_batch", [for (final __item__ in this) {'__this__': __item__}]); 111 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 112 | } 113 | 114 | Future> get_channel_batch() async { 115 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_channel_batch", [for (final __item__ in this) {'__this__': __item__}]); 116 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 117 | } 118 | 119 | Future> get_advertisingId_batch() async { 120 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_advertisingId_batch", [for (final __item__ in this) {'__this__': __item__}]); 121 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 122 | } 123 | 124 | Future> get_isProduction_batch() async { 125 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSLaunchConfig::get_isProduction_batch", [for (final __item__ in this) {'__this__': __item__}]); 126 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 127 | } 128 | 129 | //endregion 130 | 131 | //region setters 132 | Future set_appKey_batch(List appKey) async { 133 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_appKey_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "appKey": appKey[__i__]}]); 134 | 135 | 136 | } 137 | 138 | Future set_channel_batch(List channel) async { 139 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_channel_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "channel": channel[__i__]}]); 140 | 141 | 142 | } 143 | 144 | Future set_advertisingId_batch(List advertisingId) async { 145 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_advertisingId_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "advertisingId": advertisingId[__i__]}]); 146 | 147 | 148 | } 149 | 150 | Future set_isProduction_batch(List isProduction) async { 151 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSLaunchConfig::set_isProduction_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "isProduction": isProduction[__i__]}]); 152 | 153 | 154 | } 155 | 156 | //endregion 157 | 158 | //region methods 159 | 160 | //endregion 161 | } -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/LoginEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_jiguang_analytics_android_api_LoginEvent extends cn_jiguang_analytics_android_api_Event with java_io_Serializable { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.api.LoginEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__String__boolean(String var1, bool var2) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createcn_jiguang_analytics_android_api_LoginEvent__String__boolean', 29 | {"var1": var1, "var2": var2} 30 | ); 31 | return JanalyticsFluttifyAndroidAs(__result__); 32 | } 33 | 34 | static Future create__() async { 35 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 36 | 'ObjectFactory::createcn_jiguang_analytics_android_api_LoginEvent__', 37 | 38 | ); 39 | return JanalyticsFluttifyAndroidAs(__result__); 40 | } 41 | 42 | static Future> create_batch__String__boolean(List var1, List var2) async { 43 | assert(var1.length == var2.length); 44 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 45 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_LoginEvent__String__boolean', 46 | [for (int __i__ = 0; __i__ < var1.length; __i__++) {"var1": var1[__i__], "var2": var2[__i__]}] 47 | ); 48 | return __result_batch__ 49 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 50 | .toList(); 51 | } 52 | 53 | static Future> create_batch__(int length) async { 54 | assert(true); 55 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 56 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_LoginEvent__', 57 | {'length': length} 58 | ); 59 | return __result_batch__ 60 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 61 | .toList(); 62 | } 63 | 64 | //endregion 65 | 66 | //region getters 67 | 68 | //endregion 69 | 70 | //region setters 71 | 72 | //endregion 73 | 74 | //region methods 75 | 76 | Future getLoginMethod() async { 77 | // print log 78 | if (fluttifyLogEnabled) { 79 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.LoginEvent@$refId::getLoginMethod([])'); 80 | } 81 | 82 | // invoke native method 83 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::getLoginMethod', {"__this__": this}); 84 | 85 | 86 | // handle native call 87 | 88 | 89 | return __result__; 90 | } 91 | 92 | 93 | Future setLoginMethod(String var1) async { 94 | // print log 95 | if (fluttifyLogEnabled) { 96 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.LoginEvent@$refId::setLoginMethod([\'var1\':$var1])'); 97 | } 98 | 99 | // invoke native method 100 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::setLoginMethod', {"var1": var1, "__this__": this}); 101 | 102 | 103 | // handle native call 104 | 105 | 106 | return JanalyticsFluttifyAndroidAs(__result__); 107 | } 108 | 109 | 110 | Future getLoginSuccess() async { 111 | // print log 112 | if (fluttifyLogEnabled) { 113 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.LoginEvent@$refId::getLoginSuccess([])'); 114 | } 115 | 116 | // invoke native method 117 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::getLoginSuccess', {"__this__": this}); 118 | 119 | 120 | // handle native call 121 | 122 | 123 | return __result__; 124 | } 125 | 126 | 127 | Future setLoginSuccess(bool var1) async { 128 | // print log 129 | if (fluttifyLogEnabled) { 130 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.LoginEvent@$refId::setLoginSuccess([\'var1\':$var1])'); 131 | } 132 | 133 | // invoke native method 134 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::setLoginSuccess', {"var1": var1, "__this__": this}); 135 | 136 | 137 | // handle native call 138 | 139 | 140 | return JanalyticsFluttifyAndroidAs(__result__); 141 | } 142 | 143 | //endregion 144 | 145 | @override 146 | String toString() { 147 | return 'cn_jiguang_analytics_android_api_LoginEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 148 | } 149 | } 150 | 151 | extension cn_jiguang_analytics_android_api_LoginEvent_Batch on List { 152 | //region getters 153 | 154 | //endregion 155 | 156 | //region setters 157 | 158 | //endregion 159 | 160 | //region methods 161 | 162 | Future> getLoginMethod_batch() async { 163 | assert(true); 164 | 165 | // invoke native method 166 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::getLoginMethod_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 167 | 168 | 169 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 170 | } 171 | 172 | 173 | Future> setLoginMethod_batch(List var1) async { 174 | assert(true); 175 | 176 | // invoke native method 177 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::setLoginMethod_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 178 | 179 | 180 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 181 | } 182 | 183 | 184 | Future> getLoginSuccess_batch() async { 185 | assert(true); 186 | 187 | // invoke native method 188 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::getLoginSuccess_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 189 | 190 | 191 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 192 | } 193 | 194 | 195 | Future> setLoginSuccess_batch(List var1) async { 196 | assert(true); 197 | 198 | // invoke native method 199 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.LoginEvent::setLoginSuccess_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 200 | 201 | 202 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 203 | } 204 | 205 | //endregion 206 | } -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/RegisterEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_jiguang_analytics_android_api_RegisterEvent extends cn_jiguang_analytics_android_api_Event with java_io_Serializable { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.api.RegisterEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__String__boolean(String var1, bool var2) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createcn_jiguang_analytics_android_api_RegisterEvent__String__boolean', 29 | {"var1": var1, "var2": var2} 30 | ); 31 | return JanalyticsFluttifyAndroidAs(__result__); 32 | } 33 | 34 | static Future create__() async { 35 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 36 | 'ObjectFactory::createcn_jiguang_analytics_android_api_RegisterEvent__', 37 | 38 | ); 39 | return JanalyticsFluttifyAndroidAs(__result__); 40 | } 41 | 42 | static Future> create_batch__String__boolean(List var1, List var2) async { 43 | assert(var1.length == var2.length); 44 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 45 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_RegisterEvent__String__boolean', 46 | [for (int __i__ = 0; __i__ < var1.length; __i__++) {"var1": var1[__i__], "var2": var2[__i__]}] 47 | ); 48 | return __result_batch__ 49 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 50 | .toList(); 51 | } 52 | 53 | static Future> create_batch__(int length) async { 54 | assert(true); 55 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 56 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_RegisterEvent__', 57 | {'length': length} 58 | ); 59 | return __result_batch__ 60 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 61 | .toList(); 62 | } 63 | 64 | //endregion 65 | 66 | //region getters 67 | 68 | //endregion 69 | 70 | //region setters 71 | 72 | //endregion 73 | 74 | //region methods 75 | 76 | Future getRegisterMthod() async { 77 | // print log 78 | if (fluttifyLogEnabled) { 79 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.RegisterEvent@$refId::getRegisterMthod([])'); 80 | } 81 | 82 | // invoke native method 83 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::getRegisterMthod', {"__this__": this}); 84 | 85 | 86 | // handle native call 87 | 88 | 89 | return __result__; 90 | } 91 | 92 | 93 | Future setRegisterMethod(String var1) async { 94 | // print log 95 | if (fluttifyLogEnabled) { 96 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.RegisterEvent@$refId::setRegisterMethod([\'var1\':$var1])'); 97 | } 98 | 99 | // invoke native method 100 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::setRegisterMethod', {"var1": var1, "__this__": this}); 101 | 102 | 103 | // handle native call 104 | 105 | 106 | return JanalyticsFluttifyAndroidAs(__result__); 107 | } 108 | 109 | 110 | Future getRegisterSuccess() async { 111 | // print log 112 | if (fluttifyLogEnabled) { 113 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.RegisterEvent@$refId::getRegisterSuccess([])'); 114 | } 115 | 116 | // invoke native method 117 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::getRegisterSuccess', {"__this__": this}); 118 | 119 | 120 | // handle native call 121 | 122 | 123 | return __result__; 124 | } 125 | 126 | 127 | Future setRegisterSuccess(bool var1) async { 128 | // print log 129 | if (fluttifyLogEnabled) { 130 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.RegisterEvent@$refId::setRegisterSuccess([\'var1\':$var1])'); 131 | } 132 | 133 | // invoke native method 134 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::setRegisterSuccess', {"var1": var1, "__this__": this}); 135 | 136 | 137 | // handle native call 138 | 139 | 140 | return JanalyticsFluttifyAndroidAs(__result__); 141 | } 142 | 143 | //endregion 144 | 145 | @override 146 | String toString() { 147 | return 'cn_jiguang_analytics_android_api_RegisterEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 148 | } 149 | } 150 | 151 | extension cn_jiguang_analytics_android_api_RegisterEvent_Batch on List { 152 | //region getters 153 | 154 | //endregion 155 | 156 | //region setters 157 | 158 | //endregion 159 | 160 | //region methods 161 | 162 | Future> getRegisterMthod_batch() async { 163 | assert(true); 164 | 165 | // invoke native method 166 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::getRegisterMthod_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 167 | 168 | 169 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 170 | } 171 | 172 | 173 | Future> setRegisterMethod_batch(List var1) async { 174 | assert(true); 175 | 176 | // invoke native method 177 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::setRegisterMethod_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 178 | 179 | 180 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 181 | } 182 | 183 | 184 | Future> getRegisterSuccess_batch() async { 185 | assert(true); 186 | 187 | // invoke native method 188 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::getRegisterSuccess_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 189 | 190 | 191 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 192 | } 193 | 194 | 195 | Future> setRegisterSuccess_batch(List var1) async { 196 | assert(true); 197 | 198 | // invoke native method 199 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.RegisterEvent::setRegisterSuccess_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 200 | 201 | 202 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 203 | } 204 | 205 | //endregion 206 | } -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/Event.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | /* abstract */ class cn_jiguang_analytics_android_api_Event extends java_lang_Object with java_io_Serializable { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.api.Event'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | 27 | //endregion 28 | 29 | //region getters 30 | 31 | //endregion 32 | 33 | //region setters 34 | 35 | //endregion 36 | 37 | //region methods 38 | 39 | Future setExtMap(Map var1) async { 40 | // print log 41 | if (fluttifyLogEnabled) { 42 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.Event@$refId::setExtMap([\'var1\':$var1])'); 43 | } 44 | 45 | // invoke native method 46 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::setExtMap', {"var1": var1, "__this__": this}); 47 | 48 | 49 | // handle native call 50 | 51 | 52 | return JanalyticsFluttifyAndroidAs(__result__); 53 | } 54 | 55 | 56 | Future addExtMap(Map var1) async { 57 | // print log 58 | if (fluttifyLogEnabled) { 59 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.Event@$refId::addExtMap([\'var1\':$var1])'); 60 | } 61 | 62 | // invoke native method 63 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::addExtMap', {"var1": var1, "__this__": this}); 64 | 65 | 66 | // handle native call 67 | 68 | 69 | return JanalyticsFluttifyAndroidAs(__result__); 70 | } 71 | 72 | 73 | Future> getExtMap() async { 74 | // print log 75 | if (fluttifyLogEnabled) { 76 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.Event@$refId::getExtMap([])'); 77 | } 78 | 79 | // invoke native method 80 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::getExtMap', {"__this__": this}); 81 | 82 | 83 | // handle native call 84 | 85 | 86 | return __result__; 87 | } 88 | 89 | 90 | Future getItime() async { 91 | // print log 92 | if (fluttifyLogEnabled) { 93 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.Event@$refId::getItime([])'); 94 | } 95 | 96 | // invoke native method 97 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::getItime', {"__this__": this}); 98 | 99 | 100 | // handle native call 101 | 102 | 103 | return __result__; 104 | } 105 | 106 | 107 | Future setItime(int var1) async { 108 | // print log 109 | if (fluttifyLogEnabled) { 110 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.Event@$refId::setItime([\'var1\':$var1])'); 111 | } 112 | 113 | // invoke native method 114 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::setItime', {"var1": var1, "__this__": this}); 115 | 116 | 117 | // handle native call 118 | 119 | 120 | return JanalyticsFluttifyAndroidAs(__result__); 121 | } 122 | 123 | 124 | Future addKeyValue(String var1, String var2) async { 125 | // print log 126 | if (fluttifyLogEnabled) { 127 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.Event@$refId::addKeyValue([\'var1\':$var1, \'var2\':$var2])'); 128 | } 129 | 130 | // invoke native method 131 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::addKeyValue', {"var1": var1, "var2": var2, "__this__": this}); 132 | 133 | 134 | // handle native call 135 | 136 | 137 | return JanalyticsFluttifyAndroidAs(__result__); 138 | } 139 | 140 | 141 | Future checkEvent() async { 142 | // print log 143 | if (fluttifyLogEnabled) { 144 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.Event@$refId::checkEvent([])'); 145 | } 146 | 147 | // invoke native method 148 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::checkEvent', {"__this__": this}); 149 | 150 | 151 | // handle native call 152 | 153 | 154 | return __result__; 155 | } 156 | 157 | //endregion 158 | 159 | @override 160 | String toString() { 161 | return 'cn_jiguang_analytics_android_api_Event{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 162 | } 163 | } 164 | 165 | extension cn_jiguang_analytics_android_api_Event_Batch on List { 166 | //region getters 167 | 168 | //endregion 169 | 170 | //region setters 171 | 172 | //endregion 173 | 174 | //region methods 175 | 176 | Future> setExtMap_batch(List> var1) async { 177 | assert(true); 178 | 179 | // invoke native method 180 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::setExtMap_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 181 | 182 | 183 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 184 | } 185 | 186 | 187 | Future> addExtMap_batch(List> var1) async { 188 | assert(true); 189 | 190 | // invoke native method 191 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::addExtMap_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 192 | 193 | 194 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 195 | } 196 | 197 | 198 | Future>> getExtMap_batch() async { 199 | assert(true); 200 | 201 | // invoke native method 202 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::getExtMap_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 203 | 204 | 205 | return (resultBatch as List).map((__result__) => __result__).cast>().toList(); 206 | } 207 | 208 | 209 | Future> getItime_batch() async { 210 | assert(true); 211 | 212 | // invoke native method 213 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::getItime_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 214 | 215 | 216 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 217 | } 218 | 219 | 220 | Future> setItime_batch(List var1) async { 221 | assert(true); 222 | 223 | // invoke native method 224 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::setItime_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 225 | 226 | 227 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 228 | } 229 | 230 | 231 | Future> addKeyValue_batch(List var1, List var2) async { 232 | assert(var1.length == var2.length); 233 | 234 | // invoke native method 235 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::addKeyValue_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "var2": var2[__i__], "__this__": this[__i__]}]); 236 | 237 | 238 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 239 | } 240 | 241 | 242 | Future> checkEvent_batch() async { 243 | assert(true); 244 | 245 | // invoke native method 246 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.Event::checkEvent_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 247 | 248 | 249 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 250 | } 251 | 252 | //endregion 253 | } -------------------------------------------------------------------------------- /lib/src/android/cn/jiguang/analytics/android/api/CalculateEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class cn_jiguang_analytics_android_api_CalculateEvent extends cn_jiguang_analytics_android_api_Event with java_io_Serializable { 16 | //region constants 17 | static const String name__ = 'cn.jiguang.analytics.android.api.CalculateEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__() async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createcn_jiguang_analytics_android_api_CalculateEvent__', 29 | 30 | ); 31 | return JanalyticsFluttifyAndroidAs(__result__); 32 | } 33 | 34 | static Future create__String__double(String var1, double var2) async { 35 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 36 | 'ObjectFactory::createcn_jiguang_analytics_android_api_CalculateEvent__String__double', 37 | {"var1": var1, "var2": var2} 38 | ); 39 | return JanalyticsFluttifyAndroidAs(__result__); 40 | } 41 | 42 | static Future> create_batch__(int length) async { 43 | assert(true); 44 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 45 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_CalculateEvent__', 46 | {'length': length} 47 | ); 48 | return __result_batch__ 49 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 50 | .toList(); 51 | } 52 | 53 | static Future> create_batch__String__double(List var1, List var2) async { 54 | assert(var1.length == var2.length); 55 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 56 | 'ObjectFactory::create_batchcn_jiguang_analytics_android_api_CalculateEvent__String__double', 57 | [for (int __i__ = 0; __i__ < var1.length; __i__++) {"var1": var1[__i__], "var2": var2[__i__]}] 58 | ); 59 | return __result_batch__ 60 | .map((it) => JanalyticsFluttifyAndroidAs(it)) 61 | .toList(); 62 | } 63 | 64 | //endregion 65 | 66 | //region getters 67 | 68 | //endregion 69 | 70 | //region setters 71 | 72 | //endregion 73 | 74 | //region methods 75 | 76 | Future getEventId() async { 77 | // print log 78 | if (fluttifyLogEnabled) { 79 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.CalculateEvent@$refId::getEventId([])'); 80 | } 81 | 82 | // invoke native method 83 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::getEventId', {"__this__": this}); 84 | 85 | 86 | // handle native call 87 | 88 | 89 | return __result__; 90 | } 91 | 92 | 93 | Future setEventId(String var1) async { 94 | // print log 95 | if (fluttifyLogEnabled) { 96 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.CalculateEvent@$refId::setEventId([\'var1\':$var1])'); 97 | } 98 | 99 | // invoke native method 100 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::setEventId', {"var1": var1, "__this__": this}); 101 | 102 | 103 | // handle native call 104 | 105 | 106 | return JanalyticsFluttifyAndroidAs(__result__); 107 | } 108 | 109 | 110 | Future getEventValue() async { 111 | // print log 112 | if (fluttifyLogEnabled) { 113 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.CalculateEvent@$refId::getEventValue([])'); 114 | } 115 | 116 | // invoke native method 117 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::getEventValue', {"__this__": this}); 118 | 119 | 120 | // handle native call 121 | 122 | 123 | return __result__; 124 | } 125 | 126 | 127 | Future setEventValue(double var1) async { 128 | // print log 129 | if (fluttifyLogEnabled) { 130 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.CalculateEvent@$refId::setEventValue([\'var1\':$var1])'); 131 | } 132 | 133 | // invoke native method 134 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::setEventValue', {"var1": var1, "__this__": this}); 135 | 136 | 137 | // handle native call 138 | 139 | 140 | return JanalyticsFluttifyAndroidAs(__result__); 141 | } 142 | 143 | 144 | Future addEventValue(double var1) async { 145 | // print log 146 | if (fluttifyLogEnabled) { 147 | debugPrint('fluttify-dart: cn.jiguang.analytics.android.api.CalculateEvent@$refId::addEventValue([\'var1\':$var1])'); 148 | } 149 | 150 | // invoke native method 151 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::addEventValue', {"var1": var1, "__this__": this}); 152 | 153 | 154 | // handle native call 155 | 156 | 157 | return JanalyticsFluttifyAndroidAs(__result__); 158 | } 159 | 160 | //endregion 161 | 162 | @override 163 | String toString() { 164 | return 'cn_jiguang_analytics_android_api_CalculateEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 165 | } 166 | } 167 | 168 | extension cn_jiguang_analytics_android_api_CalculateEvent_Batch on List { 169 | //region getters 170 | 171 | //endregion 172 | 173 | //region setters 174 | 175 | //endregion 176 | 177 | //region methods 178 | 179 | Future> getEventId_batch() async { 180 | assert(true); 181 | 182 | // invoke native method 183 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::getEventId_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 184 | 185 | 186 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 187 | } 188 | 189 | 190 | Future> setEventId_batch(List var1) async { 191 | assert(true); 192 | 193 | // invoke native method 194 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::setEventId_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 195 | 196 | 197 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 198 | } 199 | 200 | 201 | Future> getEventValue_batch() async { 202 | assert(true); 203 | 204 | // invoke native method 205 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::getEventValue_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"__this__": this[__i__]}]); 206 | 207 | 208 | return (resultBatch as List).map((__result__) => __result__).cast().toList(); 209 | } 210 | 211 | 212 | Future> setEventValue_batch(List var1) async { 213 | assert(true); 214 | 215 | // invoke native method 216 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::setEventValue_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 217 | 218 | 219 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 220 | } 221 | 222 | 223 | Future> addEventValue_batch(List var1) async { 224 | assert(true); 225 | 226 | // invoke native method 227 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod('cn.jiguang.analytics.android.api.CalculateEvent::addEventValue_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]); 228 | 229 | 230 | return (resultBatch as List).map((__result__) => JanalyticsFluttifyAndroidAs(__result__)).cast().toList(); 231 | } 232 | 233 | //endregion 234 | } -------------------------------------------------------------------------------- /lib/src/ios/type_op.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:io'; 7 | 8 | import 'package:flutter/foundation.dart'; 9 | import 'package:flutter/services.dart'; 10 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | import 'package:jcore_fluttify/jcore_fluttify.dart'; 15 | 16 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import 17 | // type check 18 | @optionalTypeArgs 19 | Future JanalyticsFluttifyIOSIs(dynamic __this__) async { 20 | final typeName = T.toString(); 21 | if (RegExp(r'^(List<)?(String|int|double)(>)?|(Map)$').hasMatch(typeName)) { 22 | return __this__ is T; 23 | } 24 | else if (T == JANALYTICSEventObject) { 25 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSEventObject', {'__this__': __this__}); 26 | return result; 27 | } else if (T == JANALYTICSLoginEvent) { 28 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSLoginEvent', {'__this__': __this__}); 29 | return result; 30 | } else if (T == JANALYTICSRegisterEvent) { 31 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSRegisterEvent', {'__this__': __this__}); 32 | return result; 33 | } else if (T == JANALYTICSPurchaseEvent) { 34 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSPurchaseEvent', {'__this__': __this__}); 35 | return result; 36 | } else if (T == JANALYTICSBrowseEvent) { 37 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSBrowseEvent', {'__this__': __this__}); 38 | return result; 39 | } else if (T == JANALYTICSCountEvent) { 40 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSCountEvent', {'__this__': __this__}); 41 | return result; 42 | } else if (T == JANALYTICSCalculateEvent) { 43 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSCalculateEvent', {'__this__': __this__}); 44 | return result; 45 | } else if (T == JANALYTICSUserInfo) { 46 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSUserInfo', {'__this__': __this__}); 47 | return result; 48 | } else if (T == JANALYTICSLaunchConfig) { 49 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSLaunchConfig', {'__this__': __this__}); 50 | return result; 51 | } else if (T == JANALYTICSService) { 52 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfJANALYTICSService', {'__this__': __this__}); 53 | return result; 54 | } else if (T == CLLocation) { 55 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfCLLocation', {'__this__': __this__}); 56 | return result; 57 | } else if (T == CLHeading) { 58 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfCLHeading', {'__this__': __this__}); 59 | return result; 60 | } else if (T == CGRect) { 61 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfCGRect', {'__this__': __this__}); 62 | return result; 63 | } else if (T == CGPoint) { 64 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfCGPoint', {'__this__': __this__}); 65 | return result; 66 | } else if (T == CGSize) { 67 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfCGSize', {'__this__': __this__}); 68 | return result; 69 | } else if (T == UIEdgeInsets) { 70 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfUIEdgeInsets', {'__this__': __this__}); 71 | return result; 72 | } else if (T == CLLocationCoordinate2D) { 73 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfCLLocationCoordinate2D', {'__this__': __this__}); 74 | return result; 75 | } else if (T == CLLocationManager) { 76 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfCLLocationManager', {'__this__': __this__}); 77 | return result; 78 | } else if (T == NSError) { 79 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfNSError', {'__this__': __this__}); 80 | return result; 81 | } else if (T == UIView) { 82 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfUIView', {'__this__': __this__}); 83 | return result; 84 | } else if (T == UIViewController) { 85 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfUIViewController', {'__this__': __this__}); 86 | return result; 87 | } else if (T == UIControl) { 88 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfUIControl', {'__this__': __this__}); 89 | return result; 90 | } else if (T == UIImage) { 91 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfUIImage', {'__this__': __this__}); 92 | return result; 93 | } else if (T == UIColor) { 94 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfUIColor', {'__this__': __this__}); 95 | return result; 96 | } else if (T == NSData) { 97 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfNSData', {'__this__': __this__}); 98 | return result; 99 | } else if (T == NSDate) { 100 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfNSDate', {'__this__': __this__}); 101 | return result; 102 | } else if (T == NSOperation) { 103 | final result = await kJanalyticsFluttifyChannel.invokeMethod('RefClass::isKindOfNSOperation', {'__this__': __this__}); 104 | return result; 105 | } 106 | else { 107 | return false; 108 | } 109 | } 110 | 111 | // type cast 112 | // 给一个可选的泛型, 如果没有指定泛型就返回dynamic 113 | @optionalTypeArgs 114 | T JanalyticsFluttifyIOSAs(dynamic __this__) { 115 | final typeName = T.toString(); 116 | 117 | if (__this__ == null) { 118 | return null; 119 | } else if (RegExp(r'^(List<)?(String|int|double)(>)?|(Map)$').hasMatch(typeName)) { 120 | return __this__ as T; 121 | } 122 | else if (T == JANALYTICSEventObject) { 123 | return (JANALYTICSEventObject()..refId = (__this__ as Ref).refId) as T; 124 | } else if (T == JANALYTICSLoginEvent) { 125 | return (JANALYTICSLoginEvent()..refId = (__this__ as Ref).refId) as T; 126 | } else if (T == JANALYTICSRegisterEvent) { 127 | return (JANALYTICSRegisterEvent()..refId = (__this__ as Ref).refId) as T; 128 | } else if (T == JANALYTICSPurchaseEvent) { 129 | return (JANALYTICSPurchaseEvent()..refId = (__this__ as Ref).refId) as T; 130 | } else if (T == JANALYTICSBrowseEvent) { 131 | return (JANALYTICSBrowseEvent()..refId = (__this__ as Ref).refId) as T; 132 | } else if (T == JANALYTICSCountEvent) { 133 | return (JANALYTICSCountEvent()..refId = (__this__ as Ref).refId) as T; 134 | } else if (T == JANALYTICSCalculateEvent) { 135 | return (JANALYTICSCalculateEvent()..refId = (__this__ as Ref).refId) as T; 136 | } else if (T == JANALYTICSUserInfo) { 137 | return (JANALYTICSUserInfo()..refId = (__this__ as Ref).refId) as T; 138 | } else if (T == JANALYTICSLaunchConfig) { 139 | return (JANALYTICSLaunchConfig()..refId = (__this__ as Ref).refId) as T; 140 | } else if (T == JANALYTICSService) { 141 | return (JANALYTICSService()..refId = (__this__ as Ref).refId) as T; 142 | } else if (T == CLLocation) { 143 | return (CLLocation()..refId = (__this__ as Ref).refId) as T; 144 | } else if (T == CLHeading) { 145 | return (CLHeading()..refId = (__this__ as Ref).refId) as T; 146 | } else if (T == CGRect) { 147 | return (CGRect()..refId = (__this__ as Ref).refId) as T; 148 | } else if (T == CGPoint) { 149 | return (CGPoint()..refId = (__this__ as Ref).refId) as T; 150 | } else if (T == CGSize) { 151 | return (CGSize()..refId = (__this__ as Ref).refId) as T; 152 | } else if (T == UIEdgeInsets) { 153 | return (UIEdgeInsets()..refId = (__this__ as Ref).refId) as T; 154 | } else if (T == CLLocationCoordinate2D) { 155 | return (CLLocationCoordinate2D()..refId = (__this__ as Ref).refId) as T; 156 | } else if (T == CLLocationManager) { 157 | return (CLLocationManager()..refId = (__this__ as Ref).refId) as T; 158 | } else if (T == NSError) { 159 | return (NSError()..refId = (__this__ as Ref).refId) as T; 160 | } else if (T == UIView) { 161 | return (UIView()..refId = (__this__ as Ref).refId) as T; 162 | } else if (T == UIViewController) { 163 | return (UIViewController()..refId = (__this__ as Ref).refId) as T; 164 | } else if (T == UIControl) { 165 | return (UIControl()..refId = (__this__ as Ref).refId) as T; 166 | } else if (T == UIImage) { 167 | return (UIImage()..refId = (__this__ as Ref).refId) as T; 168 | } else if (T == UIColor) { 169 | return (UIColor()..refId = (__this__ as Ref).refId) as T; 170 | } else if (T == NSData) { 171 | return (NSData()..refId = (__this__ as Ref).refId) as T; 172 | } else if (T == NSDate) { 173 | return (NSDate()..refId = (__this__ as Ref).refId) as T; 174 | } else if (T == NSOperation) { 175 | return (NSOperation()..refId = (__this__ as Ref).refId) as T; 176 | } 177 | else if (JcoreFluttifyIOSAs(__this__) != null) { 178 | return JcoreFluttifyIOSAs(__this__); 179 | } 180 | else { 181 | return null; 182 | } 183 | } -------------------------------------------------------------------------------- /lib/src/ios/JANALYTICSPurchaseEvent.g.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast 2 | ////////////////////////////////////////////////////////// 3 | // GENERATED BY FLUTTIFY. DO NOT EDIT IT. 4 | ////////////////////////////////////////////////////////// 5 | 6 | import 'dart:typed_data'; 7 | 8 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 9 | import 'package:flutter/foundation.dart'; 10 | import 'package:flutter/services.dart'; 11 | 12 | import 'package:foundation_fluttify/foundation_fluttify.dart'; 13 | import 'package:core_location_fluttify/core_location_fluttify.dart'; 14 | 15 | class JANALYTICSPurchaseEvent extends JANALYTICSEventObject { 16 | //region constants 17 | static const String name__ = 'JANALYTICSPurchaseEvent'; 18 | 19 | @override 20 | final String tag__ = 'janalytics_fluttify'; 21 | 22 | 23 | //endregion 24 | 25 | //region creators 26 | static Future create__({ bool init = true /* ios only */ }) async { 27 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod( 28 | 'ObjectFactory::createJANALYTICSPurchaseEvent', 29 | {'init': init} 30 | ); 31 | return JanalyticsFluttifyIOSAs(__result__); 32 | } 33 | 34 | static Future> create_batch__(int length, { bool init = true /* ios only */ }) async { 35 | assert(true); 36 | final __result_batch__ = await kJanalyticsFluttifyChannel.invokeListMethod( 37 | 'ObjectFactory::create_batchJANALYTICSPurchaseEvent', 38 | {'length': length, 'init': init} 39 | ); 40 | return __result_batch__ 41 | .map((it) => JanalyticsFluttifyIOSAs(it)) 42 | .toList(); 43 | } 44 | 45 | //endregion 46 | 47 | //region getters 48 | Future get_price() async { 49 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_price", {'__this__': this}); 50 | return __result__; 51 | } 52 | 53 | Future get_success() async { 54 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_success", {'__this__': this}); 55 | return __result__; 56 | } 57 | 58 | Future get_goodsID() async { 59 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_goodsID", {'__this__': this}); 60 | return __result__; 61 | } 62 | 63 | Future get_goodsName() async { 64 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_goodsName", {'__this__': this}); 65 | return __result__; 66 | } 67 | 68 | Future get_goodsType() async { 69 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_goodsType", {'__this__': this}); 70 | return __result__; 71 | } 72 | 73 | Future get_currency() async { 74 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_currency", {'__this__': this}); 75 | return (__result__ as int).toJANALYTICSPurchaseCurrency(); 76 | } 77 | 78 | Future get_quantity() async { 79 | final __result__ = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_quantity", {'__this__': this}); 80 | return __result__; 81 | } 82 | 83 | //endregion 84 | 85 | //region setters 86 | Future set_price(double price) async { 87 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_price', {'__this__': this, "price": price}); 88 | 89 | 90 | } 91 | 92 | Future set_success(bool success) async { 93 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_success', {'__this__': this, "success": success}); 94 | 95 | 96 | } 97 | 98 | Future set_goodsID(String goodsID) async { 99 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_goodsID', {'__this__': this, "goodsID": goodsID}); 100 | 101 | 102 | } 103 | 104 | Future set_goodsName(String goodsName) async { 105 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_goodsName', {'__this__': this, "goodsName": goodsName}); 106 | 107 | 108 | } 109 | 110 | Future set_goodsType(String goodsType) async { 111 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_goodsType', {'__this__': this, "goodsType": goodsType}); 112 | 113 | 114 | } 115 | 116 | Future set_currency(JANALYTICSPurchaseCurrency currency) async { 117 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_currency', {'__this__': this, "currency": currency.toValue()}); 118 | 119 | 120 | } 121 | 122 | Future set_quantity(int quantity) async { 123 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_quantity', {'__this__': this, "quantity": quantity}); 124 | 125 | 126 | } 127 | 128 | //endregion 129 | 130 | //region methods 131 | 132 | //endregion 133 | 134 | @override 135 | String toString() { 136 | return 'JANALYTICSPurchaseEvent{refId: $refId, runtimeType: $runtimeType, tag__: $tag__}'; 137 | } 138 | } 139 | 140 | extension JANALYTICSPurchaseEvent_Batch on List { 141 | //region getters 142 | Future> get_price_batch() async { 143 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_price_batch", [for (final __item__ in this) {'__this__': __item__}]); 144 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 145 | } 146 | 147 | Future> get_success_batch() async { 148 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_success_batch", [for (final __item__ in this) {'__this__': __item__}]); 149 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 150 | } 151 | 152 | Future> get_goodsID_batch() async { 153 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_goodsID_batch", [for (final __item__ in this) {'__this__': __item__}]); 154 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 155 | } 156 | 157 | Future> get_goodsName_batch() async { 158 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_goodsName_batch", [for (final __item__ in this) {'__this__': __item__}]); 159 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 160 | } 161 | 162 | Future> get_goodsType_batch() async { 163 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_goodsType_batch", [for (final __item__ in this) {'__this__': __item__}]); 164 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 165 | } 166 | 167 | Future> get_currency_batch() async { 168 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_currency_batch", [for (final __item__ in this) {'__this__': __item__}]); 169 | return (resultBatch as List)?.map((__result__) => (__result__ as int).toJANALYTICSPurchaseCurrency())?.cast()?.toList(); 170 | } 171 | 172 | Future> get_quantity_batch() async { 173 | final resultBatch = await kJanalyticsFluttifyChannel.invokeMethod("JANALYTICSPurchaseEvent::get_quantity_batch", [for (final __item__ in this) {'__this__': __item__}]); 174 | return (resultBatch as List)?.map((__result__) => __result__)?.cast()?.toList(); 175 | } 176 | 177 | //endregion 178 | 179 | //region setters 180 | Future set_price_batch(List price) async { 181 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_price_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "price": price[__i__]}]); 182 | 183 | 184 | } 185 | 186 | Future set_success_batch(List success) async { 187 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_success_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "success": success[__i__]}]); 188 | 189 | 190 | } 191 | 192 | Future set_goodsID_batch(List goodsID) async { 193 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_goodsID_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "goodsID": goodsID[__i__]}]); 194 | 195 | 196 | } 197 | 198 | Future set_goodsName_batch(List goodsName) async { 199 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_goodsName_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "goodsName": goodsName[__i__]}]); 200 | 201 | 202 | } 203 | 204 | Future set_goodsType_batch(List goodsType) async { 205 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_goodsType_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "goodsType": goodsType[__i__]}]); 206 | 207 | 208 | } 209 | 210 | Future set_currency_batch(List currency) async { 211 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_currency_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "currency": currency[__i__].toValue()}]); 212 | 213 | 214 | } 215 | 216 | Future set_quantity_batch(List quantity) async { 217 | await kJanalyticsFluttifyChannel.invokeMethod('JANALYTICSPurchaseEvent::set_quantity_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "quantity": quantity[__i__]}]); 218 | 219 | 220 | } 221 | 222 | //endregion 223 | 224 | //region methods 225 | 226 | //endregion 227 | } -------------------------------------------------------------------------------- /lib/src/facade/models.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:janalytics_fluttify/src/android/android.export.g.dart'; 3 | import 'package:janalytics_fluttify/src/ios/ios.export.g.dart'; 4 | 5 | abstract class Event { 6 | /// 转换为android对应类 7 | Future toAndroidModel(); 8 | 9 | /// 转换为ios对应类 10 | Future toIOSModel(); 11 | } 12 | 13 | class CountEvent extends Event { 14 | CountEvent({ 15 | @required this.eventId, 16 | this.extMap, 17 | }) : assert(eventId != null); 18 | 19 | /// 事件Id(非空) 20 | final String eventId; 21 | 22 | /// 扩展参数 23 | /// 24 | /// 自定义计数事件模型中扩展参数中不能使用以下 key 值: 25 | /// event_id 26 | /// 此类 key 已被模型使用,如果使用则会导致统计到的数据不准确. 27 | final Map extMap; 28 | 29 | @override 30 | String toString() { 31 | return 'CountEvent{eventId: $eventId, extMap: $extMap}'; 32 | } 33 | 34 | @override 35 | Future toAndroidModel() async { 36 | final event = await cn_jiguang_analytics_android_api_CountEvent 37 | .create__String(eventId); 38 | extMap?.forEach((key, value) async { 39 | await event.addKeyValue(key, value); 40 | }); 41 | return event; 42 | } 43 | 44 | @override 45 | Future toIOSModel() async { 46 | final event = await JANALYTICSCountEvent.create__(); 47 | await event.set_eventID(eventId); 48 | if (extMap != null) { 49 | await event.set_extra(extMap); 50 | } 51 | return event; 52 | } 53 | } 54 | 55 | class CalculateEvent extends Event { 56 | CalculateEvent({ 57 | @required this.eventId, 58 | @required this.eventValue, 59 | this.extMap, 60 | }) : assert(eventId != null), 61 | assert(eventValue != null); 62 | 63 | /// 事件Id(非空) 64 | final String eventId; 65 | 66 | /// 事件的值(非空) 67 | final double eventValue; 68 | 69 | /// 扩展参数 70 | /// 71 | /// 自定义计算事件模型中扩展参数中不能使用以下 key 值: 72 | /// event_id 73 | /// event_value 74 | /// 此类 key 已被模型使用,如果使用则会导致统计到的数据不准确. 75 | final Map extMap; 76 | 77 | @override 78 | Future toAndroidModel() async { 79 | final event = await cn_jiguang_analytics_android_api_CalculateEvent 80 | .create__String__double(eventId, eventValue); 81 | extMap?.forEach((key, value) async { 82 | await event.addKeyValue(key, value); 83 | }); 84 | return event; 85 | } 86 | 87 | @override 88 | Future toIOSModel() async { 89 | final event = await JANALYTICSCalculateEvent.create__(); 90 | await event.set_eventID(eventId); 91 | await event.set_value(eventValue); 92 | if (extMap != null) { 93 | await event.set_extra(extMap); 94 | } 95 | return event; 96 | } 97 | } 98 | 99 | class LoginEvent extends Event { 100 | LoginEvent({ 101 | @required this.loginMethod, 102 | @required this.loginSuccess, 103 | this.extMap, 104 | }) : assert(loginMethod != null), 105 | assert(loginSuccess != null); 106 | 107 | /// 登录方式(非空) 108 | final String loginMethod; 109 | 110 | /// 登录是否成功(非空) 111 | final bool loginSuccess; 112 | 113 | /// 扩展参数 114 | /// 115 | /// 登录事件模型中扩展参数中不能使用以下 key 值: 116 | /// login_method 117 | /// login_success 118 | /// 此类 key 已被模型使用,如果使用则会导致统计到的数据不准确. 119 | final Map extMap; 120 | 121 | @override 122 | Future toAndroidModel() async { 123 | final event = await cn_jiguang_analytics_android_api_LoginEvent 124 | .create__String__boolean(loginMethod, loginSuccess); 125 | extMap?.forEach((key, value) async { 126 | await event.addKeyValue(key, value); 127 | }); 128 | return event; 129 | } 130 | 131 | @override 132 | Future toIOSModel() async { 133 | final event = await JANALYTICSLoginEvent.create__(); 134 | await event.set_method(loginMethod); 135 | await event.set_success(loginSuccess); 136 | if (extMap != null) { 137 | await event.set_extra(extMap); 138 | } 139 | return event; 140 | } 141 | } 142 | 143 | class RegisterEvent extends Event { 144 | RegisterEvent({ 145 | @required this.registerMethod, 146 | @required this.registerSuccess, 147 | this.extMap, 148 | }) : assert(registerMethod != null), 149 | assert(registerSuccess != null); 150 | 151 | /// 注册方式(非空) 152 | final String registerMethod; 153 | 154 | /// 注册是否成功(非空) 155 | final bool registerSuccess; 156 | 157 | /// 扩展参数 158 | /// 159 | /// 注册事件模型中扩展参数中不能使用以下 key 值: 160 | /// register_method 161 | /// register_success 162 | /// 此类 key 已被模型使用,如果使用则会导致统计到的数据不准确. 163 | final Map extMap; 164 | 165 | @override 166 | Future toAndroidModel() async { 167 | final event = await cn_jiguang_analytics_android_api_RegisterEvent 168 | .create__String__boolean(registerMethod, registerSuccess); 169 | extMap?.forEach((key, value) async { 170 | await event.addKeyValue(key, value); 171 | }); 172 | return null; 173 | } 174 | 175 | @override 176 | Future toIOSModel() async { 177 | final event = await JANALYTICSRegisterEvent.create__(); 178 | await event.set_method(registerMethod); 179 | await event.set_success(registerSuccess); 180 | if (extMap != null) { 181 | await event.set_extra(extMap); 182 | } 183 | return event; 184 | } 185 | } 186 | 187 | class BrowseEvent extends Event { 188 | BrowseEvent({ 189 | this.browseId, 190 | @required this.browseName, 191 | this.browseType, 192 | this.browseDuration, 193 | this.extMap, 194 | }); 195 | 196 | /// 浏览内容id 197 | final String browseId; 198 | 199 | /// 内容名称(非空) 200 | final String browseName; 201 | 202 | /// 内容类型 203 | final String browseType; 204 | 205 | /// 浏览时长,单位秒 206 | final Duration browseDuration; 207 | 208 | /// 扩展参数 209 | /// 210 | /// 浏览事件模型中扩展参数中不能使用以下 key 值: 211 | /// browse_content_id 212 | /// browse_name 213 | /// browse_type 214 | /// browse_duration 215 | /// 此类 key 已被模型使用,如果使用则会导致统计到的数据不准确. 216 | final Map extMap; 217 | 218 | @override 219 | Future toAndroidModel() async { 220 | final event = await cn_jiguang_analytics_android_api_BrowseEvent 221 | .create__String__String__String__float( 222 | browseId, 223 | browseName, 224 | browseType, 225 | browseDuration.inSeconds.toDouble(), 226 | ); 227 | extMap?.forEach((key, value) async { 228 | await event.addKeyValue(key, value); 229 | }); 230 | return event; 231 | } 232 | 233 | @override 234 | Future toIOSModel() async { 235 | final event = await JANALYTICSBrowseEvent.create__(); 236 | await event.set_name(browseName); 237 | await event.set_type(browseType); 238 | await event.set_contentID(browseId); 239 | await event.set_duration(browseDuration.inSeconds.toDouble()); 240 | if (extMap != null) { 241 | await event.set_extra(extMap); 242 | } 243 | return event; 244 | } 245 | } 246 | 247 | class PurchaseEvent extends Event { 248 | PurchaseEvent({ 249 | this.purchaseGoodsid, 250 | this.purchaseGoodsName, 251 | this.purchasePrice, 252 | this.purchaseSuccess, 253 | this.purchaseCurrency, 254 | this.purchaseGoodsType, 255 | this.purchaseGoodsCount, 256 | this.extMap, 257 | }) : assert(purchasePrice != null), 258 | assert(purchaseSuccess != null); 259 | 260 | /// 商品id 261 | final String purchaseGoodsid; 262 | 263 | /// 商品名称 264 | final String purchaseGoodsName; 265 | 266 | /// 购买价格(非空) 267 | final double purchasePrice; 268 | 269 | /// 购买是否成功(非空) 270 | final bool purchaseSuccess; 271 | 272 | /// 货币类型,一个枚举类 273 | final Currency purchaseCurrency; 274 | 275 | /// 商品类型 276 | final String purchaseGoodsType; 277 | 278 | /// 商品数量 279 | final int purchaseGoodsCount; 280 | 281 | /// 扩展参数 282 | /// 283 | /// 购买事件模型中扩展参数中不能使用以下 key 值: 284 | /// purchase_goods_id 285 | /// purchase_goods_name 286 | /// purchase_price 287 | /// purchase_currency 288 | /// purchase_goods_type 289 | /// purchase_quantity 290 | /// 此类 key 已被模型使用,如果使用则会导致统计到的数据不准确. 291 | final Map extMap; 292 | 293 | @override 294 | Future toAndroidModel() async { 295 | final event = 296 | await cn_jiguang_analytics_android_api_PurchaseEvent.create__(); 297 | extMap?.forEach((key, value) async { 298 | await event.addKeyValue(key, value); 299 | }); 300 | return event; 301 | } 302 | 303 | @override 304 | Future toIOSModel() async { 305 | final event = await JANALYTICSPurchaseEvent.create__(); 306 | await event.set_goodsID(purchaseGoodsid); 307 | await event.set_goodsName(purchaseGoodsName); 308 | await event.set_price(purchasePrice); 309 | await event.set_success(purchaseSuccess); 310 | switch (purchaseCurrency) { 311 | case Currency.CNY: 312 | await event 313 | .set_currency(JANALYTICSPurchaseCurrency.JANALYTICSCurrencyCNY); 314 | break; 315 | case Currency.USD: 316 | await event 317 | .set_currency(JANALYTICSPurchaseCurrency.JANALYTICSCurrencyUSD); 318 | break; 319 | } 320 | await event.set_goodsType(purchaseGoodsType); 321 | await event.set_quantity(purchaseGoodsCount); 322 | if (extMap != null) { 323 | await event.set_extra(extMap); 324 | } 325 | return event; 326 | } 327 | } 328 | 329 | class Account { 330 | /// 账号ID 331 | final String accountID; 332 | 333 | /// 账号创建时间 334 | final DateTime creationTime; 335 | 336 | /// 姓名 337 | final String name; 338 | 339 | /// 性别 340 | final Gender sex; 341 | 342 | /// 是否付费 343 | final Paid paid; 344 | 345 | /// 出生年月 346 | final DateTime birthdate; 347 | 348 | /// 手机号码 349 | final String phone; 350 | 351 | /// 电子邮件 352 | final String email; 353 | 354 | /// 新浪微博ID 355 | final String weiboID; 356 | 357 | /// 微信ID 358 | final String wechatID; 359 | 360 | /// QQ ID 361 | final String qqID; 362 | 363 | Account({ 364 | @required this.accountID, 365 | this.creationTime, 366 | this.name, 367 | this.sex, 368 | this.paid, 369 | this.birthdate, 370 | this.phone, 371 | this.email, 372 | this.weiboID, 373 | this.wechatID, 374 | this.qqID, 375 | }) : assert(accountID != null, "账户id不能为空"); 376 | 377 | Future toAndroidModel() async { 378 | final result = await cn_jiguang_analytics_android_api_Account 379 | .create__String(accountID); 380 | if (creationTime != null) { 381 | await result.setCreationTime(creationTime.millisecondsSinceEpoch); 382 | } 383 | if (name != null) { 384 | await result.setName(name); 385 | } 386 | if (sex != null) { 387 | await result.setSex(sex.index); 388 | } 389 | if (paid != null) { 390 | await result.setPaid(paid.index); 391 | } 392 | if (birthdate != null) { 393 | await result.setBirthdate(birthdate.toString()); 394 | } 395 | if (phone != null) { 396 | await result.setPhone(phone); 397 | } 398 | if (email != null) { 399 | await result.setEmail(email); 400 | } 401 | if (weiboID != null) { 402 | await result.setWeiboId(weiboID); 403 | } 404 | if (wechatID != null) { 405 | await result.setWechatId(wechatID); 406 | } 407 | if (qqID != null) { 408 | await result.setQqId(qqID); 409 | } 410 | return result; 411 | } 412 | 413 | Future toIOSModel() async { 414 | final result = await JANALYTICSUserInfo.create__(); 415 | if (creationTime != null) { 416 | await result 417 | .set_creationTime(creationTime.millisecondsSinceEpoch.toDouble()); 418 | } 419 | if (name != null) { 420 | await result.set_name(name); 421 | } 422 | if (sex != null) { 423 | await result.set_sex(JANALYTICSSex.values[sex.index]); 424 | } 425 | if (paid != null) { 426 | await result.set_paid(JANALYTICSPaid.values[paid.index]); 427 | } 428 | if (birthdate != null) { 429 | await result.set_birthdate(birthdate.toString()); 430 | } 431 | if (phone != null) { 432 | await result.set_phone(phone); 433 | } 434 | if (email != null) { 435 | await result.set_email(email); 436 | } 437 | if (weiboID != null) { 438 | await result.set_weiboID(weiboID); 439 | } 440 | if (wechatID != null) { 441 | await result.set_wechatID(wechatID); 442 | } 443 | if (qqID != null) { 444 | await result.set_qqID(qqID); 445 | } 446 | return result; 447 | } 448 | 449 | @override 450 | String toString() { 451 | return 'Account{accountID: $accountID, creationTime: $creationTime, name: $name, sex: $sex, paid: $paid, birthdate: $birthdate, phone: $phone, email: $email, weiboID: $weiboID, wechatID: $wechatID, qqID: $qqID}'; 452 | } 453 | } 454 | 455 | enum Currency { CNY, USD } 456 | 457 | enum Gender { Unknown, Male, Female } 458 | 459 | enum Paid { Unknown, Yes, No } 460 | --------------------------------------------------------------------------------