-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
186 changed files
with
2,814 additions
and
2,113 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import 'package:firebase_storage/firebase_storage.dart'; | ||
import 'package:universal_io/io.dart'; | ||
import 'package:uuid/uuid.dart'; | ||
|
||
class CloudStorage { | ||
CloudStorage(this._instance); | ||
|
||
final FirebaseStorage _instance; | ||
|
||
Reference createContactImage(String userId) => | ||
_instance.ref().child('$userId/contacts').child('${const Uuid().v1()}.jpg'); | ||
Future<({String src, String path})> create(String directory, {required String filePath}) { | ||
final Reference ref = _instance.ref().child('$directory/${const Uuid().v4()}.jpg'); | ||
|
||
Reference createReferenceImage(String userId) => | ||
_instance.ref().child('$userId/references').child('${const Uuid().v1()}.jpg'); | ||
return ref | ||
.putFile(File(filePath)) | ||
.then((_) => ref.getDownloadURL()) | ||
.then((String src) => (src: src, path: ref.fullPath)); | ||
} | ||
|
||
Future<void> delete({required String src}) => _instance.refFromURL(src).delete(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
import 'package:tailor_made/domain.dart'; | ||
|
||
class MockUser implements User { | ||
const MockUser([this.uid = '1']); | ||
|
||
@override | ||
final String uid; | ||
} | ||
|
||
class AccountsMockImpl extends Accounts { | ||
@override | ||
Future<void> signInWithGoogle() async { | ||
return; | ||
} | ||
|
||
@override | ||
Stream<User?> get onAuthStateChanged async* { | ||
yield const MockUser(); | ||
Stream<String?> get onAuthStateChanged async* { | ||
yield '1'; | ||
} | ||
|
||
@override | ||
|
@@ -24,29 +17,20 @@ class AccountsMockImpl extends Accounts { | |
} | ||
|
||
@override | ||
Future<void> readNotice(AccountModel account) async { | ||
return; | ||
} | ||
|
||
@override | ||
Future<void> sendRating(AccountModel account) async { | ||
Future<void> signUp(AccountEntity account) async { | ||
return; | ||
} | ||
|
||
@override | ||
Future<void> signUp(AccountModel account) async { | ||
return; | ||
} | ||
|
||
@override | ||
Stream<AccountModel> getAccount(String? userId) async* { | ||
yield const AccountModel( | ||
Future<AccountEntity?> getAccount(String userId) async { | ||
return const AccountEntity( | ||
reference: ReferenceEntity(id: 'id', path: 'path'), | ||
uid: '1', | ||
notice: 'Hello', | ||
phoneNumber: 123456789, | ||
email: '[email protected]', | ||
displayName: 'Jogboms', | ||
status: AccountModelStatus.enabled, | ||
status: AccountStatus.enabled, | ||
rating: 5, | ||
hasPremiumEnabled: true, | ||
hasReadNotice: false, | ||
|
@@ -55,4 +39,17 @@ class AccountsMockImpl extends Accounts { | |
storeName: 'Jogboms', | ||
); | ||
} | ||
|
||
@override | ||
Future<bool> updateAccount( | ||
String userId, { | ||
required String id, | ||
required String path, | ||
String? storeName, | ||
bool? hasSendRating, | ||
int? rating, | ||
bool? hasReadNotice, | ||
}) async { | ||
return true; | ||
} | ||
} |
Oops, something went wrong.