Skip to content

Commit

Permalink
build(battery_plus)!: Target Java 17 on Android (#2727)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuberen committed Mar 19, 2024
1 parent aa826de commit ca2c35a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/battery_plus/battery_plus/android/build.gradle
Expand Up @@ -29,12 +29,12 @@ android {
namespace 'dev.fluttercommunity.plus.battery'

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

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = 17
}

defaultConfig {
Expand Down
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Expand Up @@ -31,12 +31,12 @@ android {
namespace 'io.flutter.plugins.batteryexample.example'

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

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = 17
}

sourceSets {
Expand Down
7 changes: 6 additions & 1 deletion packages/battery_plus/battery_plus/example/lib/main.dart
Expand Up @@ -65,8 +65,13 @@ class _MyHomePageState extends State<MyHomePage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Current battery state:',
style: TextStyle(fontSize: 24),
),
const SizedBox(height: 8),
Text(
'$_batteryState',
'${_batteryState?.name}',
style: const TextStyle(fontSize: 24),
),
const SizedBox(height: 24),
Expand Down

0 comments on commit ca2c35a

Please sign in to comment.