Skip to content
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
14 changes: 13 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group 'com.amir_p.power'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.5.20' // Updated version
repositories {
google()
jcenter()
Expand Down Expand Up @@ -36,6 +36,18 @@ android {
lintOptions {
disable 'InvalidPackage'
}
namespace 'com.example.power'
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace is not correct. This namespace is for the android project of the example app not the plugin.


compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
Expand Down
3 changes: 1 addition & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amir_p.power">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
9 changes: 0 additions & 9 deletions android/src/main/kotlin/com/amir_p/power/PowerPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry.Registrar

/** PowerPlugin */
public class PowerPlugin : FlutterPlugin, MethodCallHandler {
Expand All @@ -28,14 +27,6 @@ public class PowerPlugin : FlutterPlugin, MethodCallHandler {
channel.setMethodCallHandler(this);
}

companion object {
@JvmStatic
fun registerWith(registrar: Registrar) {
val channel = MethodChannel(registrar.messenger(), "com.amir_p/power")
channel.setMethodCallHandler(PowerPlugin(registrar.context()))
}
}

override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
if (call.method == "getPowerMode") {
val powerManager: PowerManager = applicationContext.getSystemService(Context.POWER_SERVICE) as PowerManager
Expand Down
32 changes: 0 additions & 32 deletions example/ios/.gitignore

This file was deleted.

26 changes: 0 additions & 26 deletions example/ios/Flutter/AppFrameworkInfo.plist

This file was deleted.

2 changes: 0 additions & 2 deletions example/ios/Flutter/Debug.xcconfig

This file was deleted.

2 changes: 0 additions & 2 deletions example/ios/Flutter/Release.xcconfig

This file was deleted.

41 changes: 0 additions & 41 deletions example/ios/Podfile

This file was deleted.

22 changes: 0 additions & 22 deletions example/ios/Podfile.lock

This file was deleted.

Loading