Skip to content

Commit

Permalink
Merge pull request #2 from Azzamubaidillah/safePoint
Browse files Browse the repository at this point in the history
v1.1
  • Loading branch information
Azzamubaidillah authored Feb 15, 2022
2 parents 6821887 + 8f82ef9 commit c1192c6
Show file tree
Hide file tree
Showing 32 changed files with 615 additions and 427 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
upload-keystore.jks
/android/key.properties
19 changes: 16 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}


apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
Expand Down Expand Up @@ -52,11 +59,17 @@ android {
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
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
signingConfig signingConfigs.release
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.azzam.chatkuy">
<application
android:label="chatkuy"
android:label="Chatkuy"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
Expand Down
Binary file added assets/image/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion assets/lottie/empty.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/forgot.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/hello.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/login.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/main-laptop-duduk.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/newPassword.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/ojek.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/password.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/payment.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/pesawat.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/register.json

This file was deleted.

1 change: 0 additions & 1 deletion assets/lottie/sent.json

This file was deleted.

20 changes: 20 additions & 0 deletions lib/app/controllers/auth_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,26 @@ class AuthController extends GetxController {
Get.defaultDialog(title: "Success", middleText: "Update status success");
}

void updatePhotoUrl(String url) async {
String date = DateTime.now().toIso8601String();
// Update firebase
CollectionReference users = firestore.collection('users');

await users.doc(_currentUser!.email).update({
"photoUrl": url,
"updatedTime": date,
});

// Update model
user.update((user) {
user!.photoUrl = url;
user.updatedTime = date;
});

user.refresh();
Get.defaultDialog(
title: "Success", middleText: "Change photo profile success");
}
// SEARCH

void addNewConnection(String friendEmail) async {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import 'dart:io';

import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
Expand All @@ -10,6 +13,23 @@ class ChangeProfileController extends GetxController {

XFile? pickedImage = null;

FirebaseStorage storage = FirebaseStorage.instance;

Future<String?> uploadImage(String uid) async {
Reference storageRef = storage.ref("$uid.png");
File file = File(pickedImage!.path);

try {
await storageRef.putFile(file);
final photoUrl = await storageRef.getDownloadURL();
resetImage();
return photoUrl;
} catch (err) {
print(err);
return null;
}
}

void resetImage() {
pickedImage = null;
update();
Expand Down
Loading

0 comments on commit c1192c6

Please sign in to comment.