Skip to content

Commit 4ac3689

Browse files
committed
Lets try this
1 parent 7d78d0d commit 4ac3689

File tree

10 files changed

+342
-216
lines changed

10 files changed

+342
-216
lines changed

android/app/build.gradle

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,10 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

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-
}
1315

1416
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1517
if (flutterVersionCode == null) {
@@ -21,9 +23,6 @@ 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"
2726

2827
def keystoreProperties = new Properties()
2928
def keystorePropertiesFile = rootProject.file('key.properties')
@@ -32,17 +31,18 @@ if (keystorePropertiesFile.exists()) {
3231
}
3332

3433
android {
35-
compileSdkVersion 33
34+
compileSdkVersion 34
3635

3736
sourceSets {
3837
main.java.srcDirs += 'src/main/kotlin'
3938
}
4039

40+
namespace 'com.trisven.safenotes'
4141
defaultConfig {
4242

4343
applicationId "com.trisven.safenotes"
4444
minSdkVersion 25
45-
targetSdkVersion 33
45+
targetSdkVersion 34
4646
versionCode flutterVersionCode.toInteger()
4747
versionName flutterVersionName
4848
}
@@ -69,13 +69,19 @@ android {
6969
}
7070
}
7171

72+
compileOptions {
73+
sourceCompatibility JavaVersion.VERSION_17
74+
targetCompatibility JavaVersion.VERSION_17
75+
}
76+
77+
kotlinOptions {
78+
jvmTarget=17
79+
}
80+
7281
}
7382

7483
flutter {
7584
source '../..'
7685
}
7786

78-
dependencies {
79-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
80-
}
8187
//android.buildTypes.release.ndk.debugSymbolLevel = 'FULL'

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.trisven.safenotes">
2+
>
33
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
44
<application
55
android:label="Safe Notes"

android/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
buildscript {
2-
ext.kotlin_version = '1.6.0'
1+
allprojects {
32
repositories {
43
google()
54
jcenter()
65
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
126
}
137

14-
allprojects {
15-
repositories {
16-
google()
17-
jcenter()
8+
subprojects {
9+
afterEvaluate { project ->
10+
if (project.hasProperty('android')) {
11+
project.android {
12+
if (namespace == null) {
13+
namespace project.group
14+
}
15+
}
16+
}
1817
}
1918
}
2019

2120
rootProject.buildDir = '../build'
2221
subprojects {
2322
project.buildDir = "${rootProject.buildDir}/${project.name}"
2423
project.evaluationDependsOn(':app')
24+
2525
}
2626

27-
task clean(type: Delete) {
27+
tasks.register("clean", Delete) {
2828
delete rootProject.buildDir
2929
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
1+
#Sat Nov 30 00:02:22 IST 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

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 "8.5.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
23+
}
24+
25+
include ":app"

lib/model/app_theme.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AppThemes {
2929
FloatingActionButtonThemeData(backgroundColor: Colors.grey),
3030
colorScheme: ColorScheme.dark(primary: Colors.blue)
3131
.copyWith(
32-
primaryContainer: Colors.grey, background: const Color(0xFF212121))
32+
primaryContainer: Colors.grey, surface: const Color(0xFF212121))
3333
.copyWith(secondary: Colors.white),
3434
);
3535

@@ -44,7 +44,7 @@ class AppThemes {
4444
),
4545
colorScheme: ColorScheme.light(primary: const Color(0xff303F9F))
4646
.copyWith(
47-
primaryContainer: Colors.grey, background: const Color(0xFFE5E5E5))
47+
primaryContainer: Colors.grey, surface: const Color(0xFFE5E5E5))
4848
.copyWith(secondary: Colors.black),
4949
);
5050
}

lib/page/edit_safe_note_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _AddEditNotePageState extends State<AddEditNotePage>
4444
@override
4545
void initState() {
4646
super.initState();
47-
WidgetsBinding.instance?.addObserver(this);
47+
WidgetsBinding.instance.addObserver(this);
4848
title = widget.note?.title ?? '';
4949
title = emptyTitle(title);
5050
description = widget.note?.description ?? '';
@@ -53,7 +53,7 @@ class _AddEditNotePageState extends State<AddEditNotePage>
5353

5454
@override
5555
void dispose() {
56-
WidgetsBinding.instance?.removeObserver(this);
56+
WidgetsBinding.instance.removeObserver(this);
5757
super.dispose();
5858
}
5959

lib/page/safe_notes_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ class _NotesPageState extends State<NotesPage> {
575575
child: Text('Unencrypted (Unsecure)'),
576576
style: ButtonStyle(
577577
//Highlight dangers of insecure export
578-
backgroundColor: MaterialStateProperty.all<Color>(
578+
backgroundColor: WidgetStateProperty.all<Color>(
579579
Colors.redAccent.shade700)),
580580
onPressed: () {
581581
ExportEncryptionControl.setIsExportEncrypted(false);

0 commit comments

Comments
 (0)