Skip to content

Commit 4cb3cb2

Browse files
committed
chore: resume and finalize previously staged changes with updates
1 parent 7f0b89b commit 4cb3cb2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1220
-1666
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,7 @@
1-
# Fresh Notes App
1+
> [!CAUTION]
22
3-
## Table of contents
4-
- [Fresh Notes App](#fresh-notes-app)
5-
- [Table of contents](#table-of-contents)
6-
- [About](#about)
7-
- [Story](#story)
8-
- [Setup](#setup)
3+
> This project is outdated and is no longer supported, it was never production-ready and published, we highly recommend to not use it or explore the code in it due to the code quality.
4+
> It wasn't meant to be published or a high-quality code project from the start due to some reasons.
5+
> We recommened that you check other related repostiories.
96
10-
## About
11-
A cross-platform, open-source notes app written in Flutter, Kotlin, Swift, Typescript and Firebase
12-
13-
### Story
14-
We are all interested in building mobile apps for iOS and Android, so we had to use macOS to write and build native iOS applications using Xcode, when using any operating system I usually take a lot of notes and I needed an notes app and I prefer it to not be a third party so I used Notes app on macOS but after updating to macOS 14.1 the notes app never working and it doesn't matter what I do I always getting crashes
15-
16-
<details>
17-
<summary>Tap to show/hide screenshot</summary>
18-
<br>
19-
20-
![macOS Notes crash](./assets/images/macos_notes_crash.png)
21-
22-
</details>
23-
24-
it's known to be limited on AppleOS and it's closed so there is not much I can do, so I create this little app and usually I prefer my repositories to public so I decided to also publish it even though that wasn't my plan
25-
26-
## Setup
27-
1. Setup Flutter, Android Studio, Xcode on your local machine
28-
2. Run the script `./scripts/fallbacks.sh`
29-
3. Install the [Firebase CLI](https://firebase.google.com/docs/cli)
30-
4. Configure Firebase with your Flutter app using the offical [documentation](https://firebase.google.com/docs/flutter/setup), you are welcome to setup it manually, I prefer to do it manually but to make it faster to setup the app for new anyone I will use the automated CLI
31-
5. Create Firebase Firestore index
32-
33-
Composite indexes: <br>
34-
userId: Ascending <br>
35-
updatedAt: Descending <br>
36-
__name__ Descending <br>
37-
38-
Instead of defining a composite index manually, try to run all the queries in the app by testing everything to get a links for generating the required index. and you will get a url to open Like:
39-
[https://console.firebase.google.com/v1/r/project/mynotes-eb717/firestore/indexes?....](https://console.firebase.google.com/v1/r/project/mynotes-eb717/firestore/indexes?create_composite=Cktwcm9qZWN0cy9teW5vdGVzLWViNzE3L2RhdGFiYXNlcy8oZGVmYXVsdCkvY29sbGVjdGlvbkdyb3Vwcy9ub3Rlcy9pbmRleGVzL18QARoKCgZ1c2VySWQQARoNCgl1cGRhdGVkQXQQAhoMCghfX25hbWVfXxAC)
40-
41-
6. Configure App check in firebase for Android and iOS (optional)
42-
7. Setup App Links for Android and Universal Links for iOS (optional)
43-
8. Update the `constants.dart` in the scripts folder (optional)
44-
45-
<!-- 1. Firebase: First setup firebase for both android/ios, register the apps and download the configurations and put
46-
them in the desire place, "google-services.json" for android, ios "GoogleService-Info.plist"
47-
already ignored in the .gitignore
48-
49-
1. Permissions
50-
51-
Android:
52-
`
53-
<uses-feature
54-
android:name="android.hardware.camera"
55-
android:required="false" />
56-
57-
<uses-permission android:name="android.permission.INTERNET" />
58-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
59-
<uses-permission android:name="android.permission.CAMERA" />
60-
<uses-permission
61-
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
62-
android:maxSdkVersion="29" />
63-
`
64-
65-
Ios:
66-
"<key>NSCameraUsageDescription</key>
67-
<string>We need access to the photo library so you take a photo</string>
68-
<key>NSPhotoLibraryUsageDescription</key>
69-
<string>We need access to the photo library so you pick image</string>
70-
<key>NSPhotoLibraryAddUsageDescription</key>
71-
<string>To save images into the library, we need permission from you</string>
72-
<key>FirebaseAutomaticScreenReportingEnabled</key>
73-
<false/>"
74-
75-
2. Localizations in Android and iOS
76-
iOS in info.plist:
77-
`
78-
<key>CFBundleLocalizations</key>
79-
<array>
80-
<string>en</string>
81-
<string>ar</string>
82-
</array>
83-
`
84-
Android:
85-
Create a file called res/xml/locales_config.xml and specify your app's languages, including your app's ultimate fallback locale, which is the locale specified in res/values/strings.xml.
86-
`
87-
<?xml version="1.0" encoding="utf-8"?>
88-
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
89-
<locale android:name="en"/>
90-
<locale android:name="ar"/>
91-
</locale-config>
92-
`
93-
In the manifest, add a line pointing to this new file:
94-
<manifest>
95-
...
96-
<application
97-
...
98-
android:localeConfig="@xml/locales_config">
99-
</application>
100-
</manifest>
101-
Specify supported languages in Gradle
102-
If not already present, specify the same languages using the resourceConfigurations property in your app's module-level build.gradle file:
103-
104-
`
105-
android {
106-
...
107-
defaultConfig {
108-
resourceConfigurations += ["en", "ar"]
109-
}
110-
}
111-
`
112-
113-
114-
4. Create firebase firestore index
115-
116-
Composite indexes:
117-
userId: Ascending
118-
updatedAt: Descending
119-
__name__ Descending
120-
121-
Instead of defining a composite index manually, try to run all the queries in the app by testing everything to get a links for generating the required index. and you will get a url to open
122-
[Like: https://console.firebase.google.com/v1/r/project/mynotes-eb717/firestore/indexes?create_composite=Cktwcm9qZWN0cy9teW5vdGVzLWViNzE3L2RhdGFiYXNlcy8oZGVmYXVsdCkvY29sbGVjdGlvbkdyb3Vwcy9ub3Rlcy9pbmRleGVzL18QARoKCgZ1c2VySWQQARoNCgl1cGRhdGVkQXQQAhoMCghfX25hbWVfXxAC](https://console.firebase.google.com/v1/r/project/mynotes-eb717/firestore/indexes?create_composite=Cktwcm9qZWN0cy9teW5vdGVzLWViNzE3L2RhdGFiYXNlcy8oZGVmYXVsdCkvY29sbGVjdGlvbkdyb3Vwcy9ub3Rlcy9pbmRleGVzL18QARoKCgZ1c2VySWQQARoNCgl1cGRhdGVkQXQQAhoMCghfX25hbWVfXxAC)
123-
124-
5. Configure App check in firebase for Android and iOS
125-
126-
6. configure iOS app notification permissions and etc...
127-
128-
7. Don't forgot to change app name, app icons, notifications icons, branding and applicationId and everything that is releated to this app when republish it again -->
7+
We might fully rewrite it in the future however it's most likely won't be soon, it will still be supported since some users already installed the pre-alpha version.

android/app/build.gradle

Lines changed: 12 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
11
plugins {
22
id "com.android.application"
33
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
45
id "dev.flutter.flutter-gradle-plugin"
56
}
67

7-
def localProperties = new Properties()
8-
def localPropertiesFile = rootProject.file('local.properties')
9-
if (localPropertiesFile.exists()) {
10-
localPropertiesFile.withReader('UTF-8') { reader ->
11-
localProperties.load(reader)
12-
}
13-
}
14-
15-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16-
if (flutterVersionCode == null) {
17-
flutterVersionCode = '1'
18-
}
19-
20-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21-
if (flutterVersionName == null) {
22-
flutterVersionName = '1.0'
23-
}
24-
258
def keystoreProperties = new Properties()
269
def keystorePropertiesFile = rootProject.file('key.properties')
2710
if (keystorePropertiesFile.exists()) {
@@ -30,39 +13,29 @@ if (keystorePropertiesFile.exists()) {
3013

3114
android {
3215
namespace "net.freshplatform.fresh_notes"
33-
// compileSdkVersion flutter.compileSdkVersion
34-
compileSdkVersion 34
35-
ndkVersion flutter.ndkVersion
36-
// One or more plugins require a higher Android NDK version.
37-
ndkVersion "25.1.8937393"
16+
compileSdk = flutter.compileSdkVersion
17+
ndkVersion = flutter.ndkVersion
3818

3919
compileOptions {
40-
coreLibraryDesugaringEnabled true
41-
sourceCompatibility JavaVersion.VERSION_1_8
42-
targetCompatibility JavaVersion.VERSION_1_8
20+
sourceCompatibility = JavaVersion.VERSION_1_8
21+
targetCompatibility = JavaVersion.VERSION_1_8
4322
}
4423

4524
kotlinOptions {
46-
jvmTarget = "1.8"
25+
jvmTarget = JavaVersion.VERSION_1_8
4726
}
4827

4928
sourceSets {
5029
main.java.srcDirs += 'src/main/kotlin'
5130
}
5231

53-
androidResources {
54-
// generateLocaleConfig = true
55-
}
56-
5732
defaultConfig {
5833
applicationId "net.freshplatform.fresh_notes"
59-
// You can update the following values to match your application needs.
60-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
61-
minSdkVersion 23
62-
targetSdkVersion 34
63-
targetSdkVersion flutter.targetSdkVersion
64-
versionCode flutterVersionCode.toInteger()
65-
versionName flutterVersionName
34+
// TODO: Use flutter.minSdkVersion once remove super_clipboard
35+
minSdk = 23
36+
targetSdk = flutter.targetSdkVersion
37+
versionCode = flutter.versionCode
38+
versionName = flutter.versionName
6639
}
6740

6841
signingConfigs {
@@ -93,29 +66,10 @@ android {
9366
}
9467
}
9568

96-
// buildFeatures {
97-
// compose true
98-
// }
99-
// composeOptions {
100-
// kotlinCompilerExtensionVersion "1.5.1"
101-
// }
102-
10369
}
10470

10571
flutter {
10672
source '../..'
10773
}
10874

109-
dependencies {
110-
// implementation "androidx.glance:glance:1.0.0"
111-
// implementation "androidx.glance:glance-appwidget:1.0.0"
112-
// implementation "androidx.glance:glance-material3:1.0.0"
113-
114-
// Flutter local notifications:
115-
//noinspection GradleDependency
116-
implementation 'androidx.window:window:1.0.0'
117-
//noinspection GradleDependency
118-
implementation 'androidx.window:window-java:1.0.0'
119-
//noinspection GradleDependency
120-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
121-
}
75+
dependencies {}

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,11 @@
55
<uses-feature
66
android:name="android.hardware.camera"
77
android:required="false" />
8+
<uses-feature
9+
android:name="android.hardware.camera.autofocus"
10+
android:required="false" />
811

912
<uses-permission android:name="android.permission.INTERNET" />
10-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
11-
<uses-permission android:name="android.permission.CAMERA" />
12-
<uses-permission
13-
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
14-
android:maxSdkVersion="32"
15-
tools:ignore="ScopedStorage" /> <!-- schedule notifications -->
16-
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
17-
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
18-
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
19-
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
2013

2114
<application
2215
android:name="${applicationName}"
@@ -72,24 +65,6 @@
7265
android:name="flutterEmbedding"
7366
android:value="2" />
7467

75-
<!-- Flutter Local Notifications Plugin -->
76-
77-
<receiver
78-
android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver"
79-
android:exported="false" />
80-
<receiver
81-
android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"
82-
android:exported="false">
83-
<intent-filter>
84-
<action android:name="android.intent.action.BOOT_COMPLETED" />
85-
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
86-
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
87-
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
88-
</intent-filter>
89-
</receiver>
90-
91-
<!-- Super clipboard Plugin -->
92-
9368
<provider
9469
android:name="com.superlist.super_native_extensions.DataProvider"
9570
android:authorities="net.freshplatform.fresh_notes.SuperClipboardDataProvider"

android/build.gradle

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10-
}
11-
}
12-
131
allprojects {
142
repositories {
153
google()
164
mavenCentral()
175
}
186
}
197

20-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
219
subprojects {
2210
project.buildDir = "${rootProject.buildDir}/${project.name}"
2311
}
2412
subprojects {
25-
project.evaluationDependsOn(':app')
13+
project.evaluationDependsOn(":app")
2614
}
2715

2816
tasks.register("clean", Delete) {

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip

0 commit comments

Comments
 (0)