-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: dart version submitted without quotes, cleanup unused code, fix…
… lint errors
- Loading branch information
Showing
17 changed files
with
60 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.0.4 | ||
|
||
- The initial release of TelemetryDeck SDK for Flutter | ||
|
||
## 0.0.3 | ||
|
||
- The initial release of TelemetryDeck SDK for Flutter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
android/src/test/kotlin/com/telemetrydeck/telemetrydecksdk/TelemetrydecksdkPluginTest.kt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:telemetrydecksdk/version_reader.dart'; | ||
import 'package:telemetrydecksdk/versions.dart'; | ||
|
||
class TelemetryProvider { | ||
final versionReader = DartVersionReader(); | ||
|
||
/// Adds Flutter specific payload attributes to outgoing signals before passing them to the native platform API. | ||
/// This method will overwrite the default `telemetryClientVersion`. | ||
Future<Map<String, String>> enrich(Map<String, String>? payload) async { | ||
Map<String, String> result = payload ?? {}; | ||
result['telemetryClientVersion'] = "Flutter $telemetryClientVersion"; | ||
result['dartVersion'] = versionReader.readVersion(); | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'dart:io'; | ||
|
||
class DartVersionReader { | ||
String readVersion() { | ||
final version = Platform.version; | ||
return version.replaceAll("\"", "'"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:telemetrydecksdk/telemetry_provider.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:telemetrydecksdk/versions.dart'; | ||
|
||
void main() { | ||
test('appends flutter sdk telemetry attributes', () async { | ||
final sut = TelemetryProvider(); | ||
|
||
final result = await sut.enrich({}); | ||
// assert the keys 'key1' is present in the result | ||
expect( | ||
result, | ||
containsPair( | ||
'telemetryClientVersion', "Flutter $telemetryClientVersion")); | ||
expect(result, containsPair('dartVersion', isNotNull)); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1 @@ | ||
import 'package:flutter/services.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:telemetrydecksdk/telemetrydecksdk_method_channel.dart'; | ||
|
||
void main() { | ||
TestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
MethodChannelTelemetrydecksdk platform = MethodChannelTelemetrydecksdk(); | ||
const MethodChannel channel = MethodChannel('telemetrydecksdk'); | ||
|
||
setUp(() { | ||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler( | ||
channel, | ||
(MethodCall methodCall) async { | ||
return '42'; | ||
}, | ||
); | ||
}); | ||
|
||
tearDown(() { | ||
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); | ||
}); | ||
|
||
test('getPlatformVersion', () async { | ||
expect(await platform.getPlatformVersion(), '42'); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:telemetrydecksdk/version_reader.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
test('returns dart version without double quotes', () async { | ||
final sut = DartVersionReader(); | ||
|
||
expect(sut.readVersion(), isNot(contains('"'))); | ||
}); | ||
} |