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

improved Dart 2.1 compatability #5

Open
wants to merge 3 commits 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
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 24 additions & 20 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ PODS:
- appcenter (0.0.1):
- AppCenter
- Flutter
- AppCenter (1.0.1):
- AppCenter/Analytics (= 1.0.1)
- AppCenter/Crashes (= 1.0.1)
- AppCenter/Analytics (1.0.1):
- AppCenter (1.2.0):
- AppCenter/Analytics (= 1.2.0)
- AppCenter/Crashes (= 1.2.0)
- AppCenter/Analytics (1.2.0):
- AppCenter/Core
- AppCenter/Core (1.0.1)
- AppCenter/Crashes (1.0.1):
- AppCenter/Core (1.2.0)
- AppCenter/Crashes (1.2.0):
- AppCenter/Core
- appcenter_analytics (0.0.1):
- AppCenter/Analytics
Expand All @@ -19,28 +19,32 @@ PODS:
- Flutter (1.0.0)

DEPENDENCIES:
- appcenter (from `/Users/alois/flutter_plugin_appcenter/src/appcenter/ios`)
- appcenter_analytics (from `/Users/alois/flutter_plugin_appcenter/src/appcenter_analytics/ios`)
- appcenter_crashes (from `/Users/alois/flutter_plugin_appcenter/src/appcenter_crashes/ios`)
- Flutter (from `/Users/alois/flutter/bin/cache/artifacts/engine/ios`)
- appcenter (from `/Users/AS/AndroidStudioProjects/flutter_plugin_appcenter/src/appcenter/ios`)
- appcenter_analytics (from `/Users/AS/AndroidStudioProjects/flutter_plugin_appcenter/src/appcenter_analytics/ios`)
- appcenter_crashes (from `/Users/AS/AndroidStudioProjects/flutter_plugin_appcenter/src/appcenter_crashes/ios`)
- Flutter (from `/Users/AS/dev/flutter/bin/cache/artifacts/engine/ios`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- AppCenter

EXTERNAL SOURCES:
appcenter:
:path: /Users/alois/flutter_plugin_appcenter/src/appcenter/ios
:path: "/Users/AS/AndroidStudioProjects/flutter_plugin_appcenter/src/appcenter/ios"
appcenter_analytics:
:path: /Users/alois/flutter_plugin_appcenter/src/appcenter_analytics/ios
:path: "/Users/AS/AndroidStudioProjects/flutter_plugin_appcenter/src/appcenter_analytics/ios"
appcenter_crashes:
:path: /Users/alois/flutter_plugin_appcenter/src/appcenter_crashes/ios
:path: "/Users/AS/AndroidStudioProjects/flutter_plugin_appcenter/src/appcenter_crashes/ios"
Flutter:
:path: /Users/alois/flutter/bin/cache/artifacts/engine/ios
:path: "/Users/AS/dev/flutter/bin/cache/artifacts/engine/ios"

SPEC CHECKSUMS:
AppCenter: 1d9e08e4ffe7a8eab6e9741a12d27e44074e73a7
appcenter: ec63d9079174977ead44a0040ff083d6dd4c94c5
appcenter_analytics: 46cd35cb5fac57f7a4b2ae5d5040f984b4ad4b5a
appcenter_crashes: 1b06d86617183e4778779b59f85a25c4bbc89493
Flutter: d674e78c937094a75ac71dd77e921e840bea3dbf
AppCenter: d0b68b2a7a87ac0aed78e66f36d87fd321d0a29c
appcenter: 5e85f0b7c5c040e551f8976c559103bfdb13cee2
appcenter_analytics: ff44d283dfb2942015f45a0550bf3e8be60eb757
appcenter_crashes: 5c44889c35121ee939f1b7ca3ea040d6876f9096
Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296

PODFILE CHECKSUM: 351e02e34b831289961ec3558a535cbd2c4965d2

COCOAPODS: 1.3.1
COCOAPODS: 1.5.3
26 changes: 5 additions & 21 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Expand All @@ -16,7 +17,6 @@
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
9740EEBB1CF902C7004384FC /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
Expand All @@ -42,6 +42,7 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
54CE9D792210C22D5C6E8F8E /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -50,7 +51,6 @@
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEB71CF902C7004384FC /* app.flx */ = {isa = PBXFileReference; lastKnownFileType = file; name = app.flx; path = Flutter/app.flx; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -92,9 +92,9 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
9740EEB71CF902C7004384FC /* app.flx */,
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
Expand Down Expand Up @@ -161,7 +161,6 @@
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
96D9A8465C60EEE798E7F303 /* [CP] Embed Pods Frameworks */,
18512D816A7A23D58E333AC8 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -209,10 +208,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9740EEBB1CF902C7004384FC /* app.flx in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
Expand All @@ -222,21 +221,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
18512D816A7A23D58E333AC8 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -276,7 +260,7 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
"${PODS_ROOT}/../../../../../dev/flutter/bin/cache/artifacts/engine/ios/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
Expand Down
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
5 changes: 4 additions & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: appcenter_example
description: Demonstrates how to use the appcenter plugin.

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.0
cupertino_icons: ^0.1.2

dev_dependencies:
flutter_test:
Expand Down
4 changes: 2 additions & 2 deletions src/appcenter/lib/appcenter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class AppCenter {
'app_secret': app_secret,
});

static Future<String> start(String app_secret, List<String> services) => _channel.invokeMethod('start', <String, dynamic>{
static Future<dynamic> start(String app_secret, List<String> services) => _channel.invokeMethod('start', <String, dynamic>{
'app_secret': app_secret,
'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
5 changes: 5 additions & 0 deletions src/appcenter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ description: Visual Studio App Center plugin for Flutter applications.
version: 0.0.1
author: Aloïs Deniel<[email protected]>
homepage: https://github.com/aloisdeniel/flutter_plugin_appcenter

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
flutter:
sdk: flutter

flutter:
plugin:
androidPackage: com.aloisdeniel.flutter.appcenter
Expand Down
2 changes: 1 addition & 1 deletion src/appcenter_analytics/lib/appcenter_analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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<dynamic> get isEnabled => _channel.invokeMethod('isEnabled');

static Future setEnabled(bool isEnabled) => _channel.invokeMethod('setEnabled', <String, bool>{
'isEnabled': isEnabled,
Expand Down
3 changes: 3 additions & 0 deletions src/appcenter_analytics/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version: 0.0.1
author: Aloïs Deniel<[email protected]>
homepage: https://github.com/aloisdeniel/flutter_plugin_appcenter

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
Expand Down
2 changes: 1 addition & 1 deletion src/appcenter_crashes/lib/appcenter_crashes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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<dynamic> get isEnabled => _channel.invokeMethod('isEnabled');

static Future setEnabled(bool isEnabled) => _channel.invokeMethod('setEnabled', <String, bool>{
'isEnabled': isEnabled,
Expand Down
3 changes: 3 additions & 0 deletions src/appcenter_crashes/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version: 0.0.1
author: Aloïs Deniel<[email protected]>
homepage: https://github.com/aloisdeniel/flutter_plugin_appcenter

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
Expand Down