Skip to content

Commit 50ebe3b

Browse files
Refactor: Improve type safety in MixpanelFlutterHelper & Remove Plug… (#181)
* Refactor: Improve type safety in MixpanelFlutterHelper & Remove PluginRegistry.Registrar Usage - Remove PluginRegistry.Registrar Usage - Changed `toMap` method to use `HashMap<>` instead of `HashMap` - Changed `toList` method to use `ArrayList<>` instead of `ArrayList` - Changed Iterator to use `Iterator<String>` instead of `Iterator` - Changed List to use `List<Object>` instead of `List` * Update Gradle configuration and dependencies - Update `gradle-wrapper.properties` to use Gradle version 8.10.2. - Update `settings.gradle` to use Android application plugin version 8.8.1 --------- Co-authored-by: Jared McFarland <[email protected]>
1 parent 9ad67d9 commit 50ebe3b

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.pub/
66
.idea
77
build/
8+
.cxx

android/src/main/java/com/mixpanel/mixpanel_flutter/MixpanelFlutterHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ static public JSONObject getMergedProperties(JSONObject properties, JSONObject m
2323
}
2424

2525
static public Map<String, Object> toMap(JSONObject object) throws JSONException {
26-
Map<String, Object> map = new HashMap();
27-
Iterator keys = object.keys();
26+
Map<String, Object> map = new HashMap<>();
27+
Iterator<String> keys = object.keys();
2828
while (keys.hasNext()) {
2929
String key = (String) keys.next();
3030
map.put(key, fromJson(object.get(key)));
3131
}
3232
return map;
3333
}
3434

35-
static public List toList(JSONArray array) throws JSONException {
36-
List list = new ArrayList();
35+
static public List<Object> toList(JSONArray array) throws JSONException {
36+
List<Object> list = new ArrayList();
3737
for (int i = 0; i < array.length(); i++) {
3838
list.add(fromJson(array.get(i)));
3939
}

example/android/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
org.gradle.jvmargs=-Xmx4G
22
android.useAndroidX=true
33
android.enableJetifier=true
4+
android.defaults.buildfeatures.buildconfig=true
5+
android.nonTransitiveRClass=false
6+
android.nonFinalResIds=false

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
36
zipStoreBase=GRADLE_USER_HOME
47
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

example/android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pluginManagement {
2323

2424
plugins {
2525
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26-
id "com.android.application" version "7.3.0" apply false
26+
id "com.android.application" version '8.8.1' apply false
2727
}
2828

2929
include ":app"

0 commit comments

Comments
 (0)