Skip to content

Commit e693246

Browse files
feat: 🚀 upgrade SDK, deps, and fix any deprecations in the way + FVM (#18)
* add fvm * upgrade all deps to latest possible, and do any required changes - path_provider, shared_preferences, url_launcher doesn't support iOS 11 anymore - freezed was left at 2.5.2 instead of 2.5.3 because of analyzer version issues * fix almost all deprecations and things that got removed * disable impeller on android * setup firebase with flutterfire, and run it on iOS * disable m3 * fix android not working and follow docs of flutter_local_notifications for both iOS and Android * remove a launch.json in android folder related to dart :D * migrate to the declarative way of gradle plugin https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply * make android work after recreating the folder!!! * remove PopScope, it doesn't work as expected and not needed
1 parent 596b83d commit e693246

Some content is hidden

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

61 files changed

+772
-622
lines changed

‎.fvmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"flutter": "3.22.1"
3+
}

‎.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,12 @@ assets/icons/*
6060
/assets/icons/bottom-nav/*
6161
!/assets/icons/bottom-nav/p_*
6262

63-
6463
/assets/icons/fav/*
6564
!/assets/icons/fav/p_*
6665

6766
/assets/icons/settings/*
6867
!/assets/icons/settings/p_*
6968

70-
7169
/assets/images/*
7270
!/assets/images/p_*
7371

@@ -88,10 +86,16 @@ assets/icons/*
8886
!/assets/images/home-cards/light/p_*
8987
!/assets/images/home-cards/dark/p_*
9088

91-
9289
# Exclude some assets
9390
!assets/json/
9491

9592
# Google Service File
9693
android/app/google-services.json
97-
GoogleService-Info.plist
94+
GoogleService-Info.plist
95+
96+
# FVM Version Cache
97+
.fvm/
98+
99+
# firebase stuff from flutterfire
100+
firebase.json
101+
lib/firebase_options.dart

‎.metadata

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "12fccda598477eddd19f93040a1dba24f915b9be"
7+
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
88
channel: "stable"
99

1010
project_type: app
@@ -13,11 +13,14 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 12fccda598477eddd19f93040a1dba24f915b9be
17-
base_revision: 12fccda598477eddd19f93040a1dba24f915b9be
16+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
17+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
1818
- platform: android
19-
create_revision: 12fccda598477eddd19f93040a1dba24f915b9be
20-
base_revision: 12fccda598477eddd19f93040a1dba24f915b9be
19+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
20+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
21+
- platform: ios
22+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
23+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
2124

2225
# User provided section
2326

‎.vscode/settings.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"dart.lineLength": 80,
3-
"editor.formatOnPaste": true,
4-
"editor.formatOnSave": true,
5-
"editor.formatOnType": true,
6-
}
2+
"dart.lineLength": 80,
3+
"editor.formatOnPaste": true,
4+
"editor.formatOnSave": true,
5+
"editor.formatOnType": true,
6+
"dart.flutterSdkPath": ".fvm/versions/3.22.1"
7+
}

‎README.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,42 @@ This project contains the codebase for the Android version that is on Play Store
2626

2727
## How to run
2828

29-
*Note: the assets were replaced by placeholders, so the version you will run locally is different in look than the version in stores.*
29+
_Note: the assets were replaced by placeholders, so the version you will run locally is different in look than the version in stores._
30+
3031
### 1. Firebase Setup
32+
3133
It's important to put your own Firebase service file in order to run the app, as it uses Remote Config and Firebase Messaging.
3234

3335
1. Create a [new Firebase project](https://console.firebase.google.com/).
34-
2. Add a new Android or iOS app, depending on which device you want to use, and follow the configuration steps to connect Noor to your Firebase project.
36+
2. Add a new Android or iOS app, depending on which device you want to use, and follow the configuration steps to connect Noor to your Firebase project. This could help: https://firebase.google.com/docs/flutter/setup
3537
3. Go to Remote Config page.
3638
4. Add a new parameter with name `noorThker`, with any value of your choice.
3739
5. Go to Cloud Messaging page, and enable it for your project.
3840
6. To setup the cloud function that trigger a notification each time the Remote Config variable changes on the console, find the code in [this repo](https://github.com/Maryom/Noor_RemoteConfig).
3941

40-
### 2. Run
42+
> **NOTE:** You can't really run the app without it, so make sure to set it up.
43+
>
44+
> The app needs some files generated the `flutterfire_cli`, specifically `lib/firebase_options.dart`, `android/app/google-services.json`, and `ios/Runner/GoogleService-Info.plist`.
45+
>
46+
> So make sure to follow the link in **step 2** if you haven't already.
47+
48+
### 2. (optional) FVM Setup
49+
50+
FVM is used to make sure everyone working on the project uses the same version. It is also easier to maintain since the `.fvmrc` file has the config you need to get started quickly.
51+
52+
It also makes it easy for **Noor** to stay on an older version without needing to do lots of upgrades and downgrades, since developers usually work on projects with different versions.
53+
54+
> FVM website: [https://fvm.app/](https://fvm.app/)
55+
56+
Once FVM is installed, run the following command to get things ready:
57+
58+
```
59+
fvm use 3.22.1
60+
```
61+
62+
> Be sure to check `.fvmrc` for the correct version this project uses, in case the version above is old.
63+
64+
### 3. Run
4165

4266
1. Clone the project:
4367

@@ -51,7 +75,18 @@ git clone https://github.com/pr-Mais/noor.git
5175
flutter pub get
5276
```
5377

54-
4. Run:
78+
3. (for android only) Edit the `android/app/build.gradle`:
79+
80+
This will allow you to sign the app with the debug keystore, no need to make a keystore just for development :D
81+
82+
```diff
83+
- // signingConfig signingConfigs.debug
84+
- signingConfig signingConfigs.release
85+
+ signingConfig signingConfigs.debug
86+
+ // signingConfig signingConfigs.release
87+
```
88+
89+
1. Run:
5590

5691
```bash
5792
flutter run
@@ -65,6 +100,6 @@ If you encounter any bug while using the apps in store, or running it locally, p
65100
For features request, contact us on [[email protected]](mailto:[email protected]?subject=%D8%A7%D9%82%D8%AA%D8%B1%D8%A7%D8%AD&body=%D8%A7%D9%84%D8%B3%D9%84%D8%A7%D9%85%20%D8%B9%D9%84%D9%8A%D9%83%D9%85%D8%8C)
66101

67102
## Credits
103+
68104
Shout out to the amazing designer [Shaikha Alqahtani](https://twitter.com/Ishaiookh).
69105
<br/> The iOS version from Noor was made with native Swift by [Maryam Aljamea](https://twitter.com/0_1Mary).
70-

‎android/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
99
# Remember to never publicly share your keystore.
1010
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
1111
key.properties
12+
**/*.keystore
13+
**/*.jks

‎android/app/build.gradle

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
plugins {
22
id "com.android.application"
3+
// START: FlutterFire Configuration
4+
id 'com.google.gms.google-services'
5+
// END: FlutterFire Configuration
36
id "kotlin-android"
7+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
48
id "dev.flutter.flutter-gradle-plugin"
5-
id 'com.google.gms.google-services'
69
}
710

811
def localProperties = new Properties()
9-
def localPropertiesFile = rootProject.file('local.properties')
12+
def localPropertiesFile = rootProject.file("local.properties")
1013
if (localPropertiesFile.exists()) {
11-
localPropertiesFile.withReader('UTF-8') { reader ->
14+
localPropertiesFile.withReader("UTF-8") { reader ->
1215
localProperties.load(reader)
1316
}
1417
}
@@ -23,63 +26,53 @@ if (keyPropertiesFile.exists()) {
2326

2427
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
2528
if (flutterVersionCode == null) {
26-
flutterVersionCode = '1'
29+
flutterVersionCode = "1"
2730
}
2831

29-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
32+
def flutterVersionName = localProperties.getProperty("flutter.versionName")
3033
if (flutterVersionName == null) {
31-
flutterVersionName = '1.0'
34+
flutterVersionName = "1.0"
3235
}
3336

3437
android {
35-
namespace 'com.noor.sa'
36-
compileSdkVersion 33
37-
ndkVersion flutter.ndkVersion
38+
namespace = "com.noor.sa"
39+
compileSdk = 34
40+
ndkVersion = flutter.ndkVersion
3841

3942
compileOptions {
40-
sourceCompatibility JavaVersion.VERSION_1_8
41-
targetCompatibility JavaVersion.VERSION_1_8
42-
}
43-
44-
kotlinOptions {
45-
jvmTarget = '1.8'
46-
}
47-
48-
sourceSets {
49-
main.java.srcDirs += 'src/main/kotlin'
43+
sourceCompatibility = JavaVersion.VERSION_1_8
44+
targetCompatibility = JavaVersion.VERSION_1_8
5045
}
5146

5247
defaultConfig {
53-
applicationId "com.noor.sa"
54-
minSdkVersion 21
55-
targetSdkVersion flutter.targetSdkVersion
56-
versionCode flutterVersionCode.toInteger()
57-
versionName flutterVersionName
48+
applicationId = "com.noor.sa"
49+
minSdk = 21
50+
targetSdk = flutter.targetSdkVersion
51+
versionCode = flutterVersionCode.toInteger()
52+
versionName = flutterVersionName
53+
// i added this back cuz it was there before the android folder recreation
5854
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5955
}
6056

61-
signingConfigs {
62-
release {
63-
keyAlias keyProperties['keyAlias']
64-
keyPassword keyProperties['keyPassword']
65-
storeFile keyProperties['storeFile'] ? file(keyProperties['storeFile']) : null
66-
storePassword keyProperties['storePassword']
67-
}
68-
}
69-
buildTypes {
70-
release {
57+
signingConfigs {
58+
release {
59+
keyAlias keyProperties['keyAlias']
60+
keyPassword keyProperties['keyPassword']
61+
storeFile keyProperties['storeFile'] ? file(keyProperties['storeFile']) : null
62+
storePassword keyProperties['storePassword']
63+
}
64+
}
65+
66+
buildTypes {
67+
release {
68+
// signingConfig signingConfigs.debug
7169
signingConfig signingConfigs.release
7270
shrinkResources false
7371
minifyEnabled true
74-
}
75-
}
72+
}
73+
}
7674
}
7775

7876
flutter {
79-
source '../..'
77+
source = "../.."
8078
}
81-
82-
dependencies {
83-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
84-
}
85-
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.noor.sa">
3-
<!-- Flutter needs it to communicate with the running application
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->
66
<uses-permission android:name="android.permission.INTERNET"/>
7-
<uses-permission android:name="android.permission.VIBRATE"/>
8-
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
97
</manifest>

0 commit comments

Comments
 (0)