Skip to content

Commit

Permalink
Merge pull request #6 from shuence/Screen-Responsive-and-BottomBar
Browse files Browse the repository at this point in the history
Fixed Bug or App Crashing
  • Loading branch information
shuence authored May 4, 2024
2 parents fe72dd0 + 3f7d2ad commit 5fce076
Show file tree
Hide file tree
Showing 29 changed files with 732 additions and 383 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ app.*.map.json
/android/app/release

# Firebase Related
**/google-services.json
**/GoogleService-Info.plist
**/firebase_app_id_file.json
**/firebase_options.dart

.firebaserc
.metadata
.firebase/hosting.LmZpcmViYXNlXHNwb29uc2hhcmUtbWVhbHNcaG9zdGluZw.cache
Expand Down
59 changes: 59 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spoonshare">

<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Location permissions -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<!-- Storage permissions -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<!-- Camera permissions -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<!-- Application -->
<application
android:label="spoonshare"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">

<meta-data android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}"/>

<!-- Main Activity -->
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">

<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- Other Activities, Services, etc. -->

<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2"
/>
</application>
</manifest>
102 changes: 49 additions & 53 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,44 @@ if (localPropertiesFile.exists()) {
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') ?: '1'
def flutterVersionName = localProperties.getProperty('flutter.versionName') ?: '1.0'

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
namespace "com.example.spoonsharemeals"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileSdkVersion 34
buildToolsVersion "30.0.3"
lint {
baseline = file("lint-baseline.xml")
}

defaultConfig {
applicationId "com.spoonsharemeal"
minSdkVersion 20
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -44,39 +68,7 @@ android {
}

secrets {
// Optionally specify a different file name containing your secrets.
// The plugin defaults to "local.properties"
propertiesFileName = "secrets.properties"

// A properties file containing default secret values. This file can be
// checked in version control.
defaultPropertiesFileName = "local.defaults.properties"

// Configure which keys should be ignored by the plugin by providing regular expressions.
// "sdk.dir" is ignored by default.
ignoreList.add("keyToIgnore") // Ignore the key "keyToIgnore"
ignoreList.add("sdk.*") // Ignore all keys matching the regexp "sdk.*"
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.spoonsharemeals.spoonsharemeals"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 20
compileSdkVersion 34
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
propertiesFileName = "secrets.properties"
}
}

Expand All @@ -87,13 +79,17 @@ flutter {
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-perf")
implementation ('com.google.firebase:firebase-analytics')
implementation ('com.google.firebase:firebase-auth')
implementation ('com.google.firebase:firebase-firestore')
implementation ('com.google.firebase:firebase-storage')
implementation ('com.google.firebase:firebase-database')
implementation ('com.google.firebase:firebase-messaging')
implementation ('com.google.maps.android:android-maps-utils:2.2.5')
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-database'
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.android.gms:play-services-maps:18.0.1'
implementation 'com.google.android.play:app-update:2.1.0'
}

// Apply Google services plugin at the end to ensure it has the necessary configurations.
apply plugin: 'com.google.gms.google-services'
46 changes: 46 additions & 0 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"project_info": {
"project_number": "247631837332",
"project_id": "spoonshare-10",
"storage_bucket": "spoonshare-10.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:247631837332:android:1ba855f7386a048b311c81",
"android_client_info": {
"package_name": "com.spoonsharemeal"
}
},
"oauth_client": [
{
"client_id": "247631837332-qj02onp7rmo8e0mnaqf688d5dp0clq51.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDERHyVbBJSm8matFIuZpTYPPqJQ5HbLMQ"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "247631837332-qj02onp7rmo8e0mnaqf688d5dp0clq51.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "247631837332-d29a3itsoe7ja2ei6oem0rtmhlq9k9ba.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.spoonshare"
}
}
]
}
}
}
],
"configuration_version": "1"
}
7 changes: 5 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yourapp">
package="com.spoonsharemeal">

<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />

<!-- Location permissions -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE " />

<!-- Storage permissions -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />


<!-- Camera permissions -->
<uses-permission android:name="android.permission.CAMERA" />
Expand All @@ -20,7 +23,7 @@

<!-- Application -->
<application
android:label="spoonsharemeals"
android:label="SpoonShare"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.spoonsharemeal

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity()
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:7.3.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23"
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
Expand All @@ -30,3 +30,5 @@ subprojects {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}


2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
Binary file added android/pepk.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/secrets.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MAPS_API_KEY=AIzaSyAt_FvhrrZYZ9TZMtTRtL4qRKIVO2QyhSQ
MAPS_API_KEY=AIzaSyDERHyVbBJSm8matFIuZpTYPPqJQ5HbLMQ
Binary file modified assets/images/recycle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5fce076

Please sign in to comment.