Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Dart2 cast and gradle upgrade #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.4'
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
11 changes: 5 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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" }); },
),
])
]
Expand Down
7 changes: 4 additions & 3 deletions src/appcenter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down Expand Up @@ -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}"
}
}
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions src/appcenter/lib/appcenter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
7 changes: 4 additions & 3 deletions src/appcenter_analytics/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down Expand Up @@ -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}"
}
}
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion src/appcenter_analytics/lib/appcenter_analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions src/appcenter_crashes/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down Expand Up @@ -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}"
}
}
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion src/appcenter_crashes/lib/appcenter_crashes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down