mirror of
https://github.com/farcasclaudiu/flutter_plugin_appcenter.git
synced 2026-06-22 07:01:30 +03:00
fix Dart2 cast and gradle upgrade
This commit is contained in:
@@ -46,7 +46,7 @@ flutter {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
androidTestCompile 'com.android.support:support-annotations:25.4.0'
|
||||
androidTestCompile 'com.android.support.test:runner:0.5'
|
||||
androidTestCompile 'com.android.support.test:rules:0.5'
|
||||
androidTestImplementation 'com.android.support:support-annotations:25.4.0'
|
||||
androidTestImplementation 'com.android.support.test:runner:0.5'
|
||||
androidTestImplementation 'com.android.support.test:rules:0.5'
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Fri Jun 23 08:50:38 CEST 2017
|
||||
#Fri Aug 10 12:01:12 EEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:appcenter/appcenter.dart';
|
||||
import 'package:appcenter_analytics/appcenter_analytics.dart';
|
||||
import 'package:appcenter_crashes/appcenter_crashes.dart';
|
||||
@@ -15,13 +14,13 @@ class MyApp extends StatefulWidget {
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
|
||||
String _app_secret;
|
||||
String _appSecret;
|
||||
String _installId = 'Unknown';
|
||||
bool _areAnalyticsEnabled = false, _areCrashesEnabled = false;
|
||||
|
||||
_MyAppState() {
|
||||
final ios = defaultTargetPlatform == TargetPlatform.iOS;
|
||||
_app_secret = ios ? "a8a33033-ef2f-4911-a664-a7d118287ce7" : "3f1f3b0e-24ff-436a-b42d-3c08b117d46a";
|
||||
_appSecret = ios ? "a8a33033-ef2f-4911-a664-a7d118287ce7" : "3f1f3b0e-24ff-436a-b42d-3c08b117d46a";
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -32,7 +31,7 @@ class _MyAppState extends State<MyApp> {
|
||||
|
||||
// Platform messages are asynchronous, so we initialize in an async method.
|
||||
initPlatformState() async {
|
||||
await AppCenter.start(_app_secret, [AppCenterAnalytics.id, AppCenterCrashes.id]);
|
||||
await AppCenter.start(_appSecret, [AppCenterAnalytics.id, AppCenterCrashes.id]);
|
||||
|
||||
if (!mounted)
|
||||
return;
|
||||
@@ -69,12 +68,12 @@ class _MyAppState extends State<MyApp> {
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.map),
|
||||
tooltip: 'map',
|
||||
onPressed: () { AppcenterAnalytics.trackEvent("map"); },
|
||||
onPressed: () { AppCenterAnalytics.trackEvent("map"); },
|
||||
),
|
||||
new IconButton(
|
||||
icon: new Icon(Icons.casino),
|
||||
tooltip: 'casino',
|
||||
onPressed: () { AppcenterAnalytics.trackEvent("casino", { "dollars" : "10" }); },
|
||||
onPressed: () { AppCenterAnalytics.trackEvent("casino", { "dollars" : "10" }); },
|
||||
),
|
||||
])
|
||||
]
|
||||
|
||||
@@ -7,10 +7,11 @@ buildscript {
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ android {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
dependencies {
|
||||
def appCenterSdkVersion = '1.1.0'
|
||||
compile "com.microsoft.appcenter:appcenter:${appCenterSdkVersion}"
|
||||
def appCenterSdkVersion = '1.7.0'
|
||||
implementation "com.microsoft.appcenter:appcenter:${appCenterSdkVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Fri Jun 23 08:50:38 CEST 2017
|
||||
#Fri Aug 10 11:35:19 EEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
|
||||
@@ -7,16 +7,16 @@ class AppCenter {
|
||||
static const MethodChannel _channel = const MethodChannel('aloisdeniel.github.com/flutter_plugin_appcenter/appcenter');
|
||||
|
||||
/// Starts App Center services
|
||||
static Future<String> configure(String app_secret) => _channel.invokeMethod('configure', <String, dynamic>{
|
||||
'app_secret': app_secret,
|
||||
static Future<String> configure(String appSecret) => _channel.invokeMethod('configure', <String, String>{
|
||||
'app_secret': appSecret,
|
||||
});
|
||||
|
||||
static Future<String> start(String app_secret, List<String> services) => _channel.invokeMethod('start', <String, dynamic>{
|
||||
'app_secret': app_secret,
|
||||
static Future<dynamic> start(String appSecret, List<String> services) => _channel.invokeMethod('start', <String, dynamic>{
|
||||
'app_secret': appSecret,
|
||||
'services': services
|
||||
});
|
||||
|
||||
static Future<String> get installId => _channel.invokeMethod('installId');
|
||||
static Future<dynamic> get installId => _channel.invokeMethod('installId');
|
||||
|
||||
static Future<bool> get isEnabled => _channel.invokeMethod('isEnabled');
|
||||
|
||||
|
||||
@@ -7,10 +7,11 @@ buildscript {
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ android {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
dependencies {
|
||||
def appCenterSdkVersion = '1.1.0'
|
||||
compile "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
|
||||
def appCenterSdkVersion = '1.7.0'
|
||||
implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Fri Jun 23 08:50:38 CEST 2017
|
||||
#Fri Aug 10 11:40:38 EEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
|
||||
@@ -10,7 +10,10 @@ class AppCenterAnalytics {
|
||||
|
||||
static const MethodChannel _channel = const MethodChannel('aloisdeniel.github.com/flutter_plugin_appcenter/appcenter_analytics');
|
||||
|
||||
static Future<bool> get isEnabled => _channel.invokeMethod('isEnabled');
|
||||
static Future<bool> get isEnabled async {
|
||||
final bool result = await _channel.invokeMethod('isEnabled');
|
||||
return result;
|
||||
}
|
||||
|
||||
static Future setEnabled(bool isEnabled) => _channel.invokeMethod('setEnabled', <String, bool>{
|
||||
'isEnabled': isEnabled,
|
||||
|
||||
@@ -7,10 +7,11 @@ buildscript {
|
||||
maven {
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
google()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.3'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ android {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
dependencies {
|
||||
def appCenterSdkVersion = '1.1.0'
|
||||
compile "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
|
||||
def appCenterSdkVersion = '1.7.0'
|
||||
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Fri Jun 23 08:50:38 CEST 2017
|
||||
#Fri Aug 10 11:44:18 EEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
|
||||
@@ -10,7 +10,10 @@ class AppCenterCrashes {
|
||||
|
||||
static const MethodChannel _channel = const MethodChannel('aloisdeniel.github.com/flutter_plugin_appcenter/appcenter_crashes');
|
||||
|
||||
static Future<bool> get isEnabled => _channel.invokeMethod('isEnabled');
|
||||
static Future<bool> get isEnabled async {
|
||||
final bool result = await _channel.invokeMethod('isEnabled');
|
||||
return result;
|
||||
}
|
||||
|
||||
static Future setEnabled(bool isEnabled) => _channel.invokeMethod('setEnabled', <String, bool>{
|
||||
'isEnabled': isEnabled,
|
||||
|
||||
Reference in New Issue
Block a user