import 'dart:async'; import 'package:flutter/services.dart'; class Flurry { static const MethodChannel _channel = const MethodChannel('flurry'); static Future get platformVersion async { final String version = await _channel.invokeMethod('getPlatformVersion'); return version; } static Future initialize({String androidKey = "", String iosKey = "", bool enableLog = true}) async { Map args = {}; args.putIfAbsent("api_key_android", () => androidKey); args.putIfAbsent("api_key_ios", () => iosKey); args.putIfAbsent("is_log_enabled", () => enableLog); await _channel.invokeMethod('initialize', args); return null; } static Future logEvent(String message) async { Map args = {}; args.putIfAbsent("message", () => message); await _channel.invokeMethod('logEvent', args); return null; } static Future setUserId(String userId) async { Map args = {}; args.putIfAbsent("userId", () => userId); await _channel.invokeMethod('userId', args); return null; } }