Skip to content

Commit 73f5836

Browse files
Update build.gradle and settings.gradle files, and fix color scheme in material_controls.dart and material_desktop_controls.dart
1 parent ce44206 commit 73f5836

File tree

5 files changed

+63
-41
lines changed

5 files changed

+63
-41
lines changed

example/android/app/build.gradle

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
7+
18
def localProperties = new Properties()
29
def localPropertiesFile = rootProject.file('local.properties')
310
if (localPropertiesFile.exists()) {
@@ -6,11 +13,6 @@ if (localPropertiesFile.exists()) {
613
}
714
}
815

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1416
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1517
if (flutterVersionCode == null) {
1618
flutterVersionCode = '1'
@@ -21,26 +23,33 @@ if (flutterVersionName == null) {
2123
flutterVersionName = '1.0'
2224
}
2325

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26+
def keystoreProperties = new Properties()
27+
def keystorePropertiesFile = rootProject.file('key.properties')
28+
if (keystorePropertiesFile.exists()) {
29+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
30+
}
2731

2832
android {
29-
namespace "com.example.example"
30-
31-
compileSdkVersion 34
33+
compileSdk = 34
3234

3335
sourceSets {
3436
main.java.srcDirs += 'src/main/kotlin'
3537
}
38+
lintOptions {
39+
disable 'InvalidPackage'
40+
checkReleaseBuilds false
41+
}
42+
compileOptions {
43+
sourceCompatibility = JavaVersion.VERSION_1_8
44+
targetCompatibility = JavaVersion.VERSION_1_8
45+
}
3646

3747
defaultConfig {
38-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
39-
applicationId "com.example.example"
40-
minSdkVersion 21
41-
targetSdkVersion 33
42-
versionCode flutterVersionCode.toInteger()
43-
versionName flutterVersionName
48+
applicationId = "com.example.example"
49+
minSdk = 24
50+
targetSdk = 33
51+
versionCode = flutterVersionCode.toInteger()
52+
versionName = flutterVersionName
4453
}
4554

4655
buildTypes {
@@ -50,12 +59,18 @@ android {
5059
signingConfig signingConfigs.debug
5160
}
5261
}
62+
63+
buildFeatures {
64+
viewBinding true
65+
}
5366
}
5467

5568
flutter {
5669
source '../..'
5770
}
5871

5972
dependencies {
60-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
73+
implementation 'androidx.appcompat:appcompat:1.4.1'
74+
implementation 'com.google.android.material:material:1.5.0'
6175
}
76+

example/android/build.gradle

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,19 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.22'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.4.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
4+
maven {
5+
url 'https://maven.google.com'
6+
}
7+
jcenter()
178
mavenCentral()
189
}
1910
}
2011

2112
rootProject.buildDir = '../build'
2213
subprojects {
2314
project.buildDir = "${rootProject.buildDir}/${project.name}"
15+
}
16+
subprojects {
2417
project.evaluationDependsOn(':app')
2518
}
2619

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.3.0" apply false
22+
id "org.jetbrains.kotlin.android" version "2.0.0" apply false
23+
}
24+
25+
include ":app"

lib/src/material/material_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ class _MaterialControlsState extends State<MaterialControls>
612612
playedColor: Theme.of(context).colorScheme.secondary,
613613
handleColor: Theme.of(context).colorScheme.secondary,
614614
bufferedColor:
615-
Theme.of(context).colorScheme.background.withOpacity(0.5),
615+
Theme.of(context).colorScheme.surface.withOpacity(0.5),
616616
backgroundColor: Theme.of(context).disabledColor.withOpacity(.5),
617617
),
618618
),

lib/src/material/material_desktop_controls.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ class _MaterialDesktopControlsState extends State<MaterialDesktopControls>
589589
playedColor: Theme.of(context).colorScheme.secondary,
590590
handleColor: Theme.of(context).colorScheme.secondary,
591591
bufferedColor:
592-
Theme.of(context).colorScheme.background.withOpacity(0.5),
592+
Theme.of(context).colorScheme.surface.withOpacity(0.5),
593593
backgroundColor: Theme.of(context).disabledColor.withOpacity(.5),
594594
),
595595
),

0 commit comments

Comments
 (0)