Skip to content

Commit d090973

Browse files
committed
update
1 parent f291054 commit d090973

File tree

19 files changed

+42
-41
lines changed

19 files changed

+42
-41
lines changed

android/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
In most cases you can leave this as-is, but you if you want to provide
66
additional functionality it is fine to subclass or reimplement
77
FlutterApplication and put your custom class here. -->
8+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
10+
<uses-permission android:name="android.permission.CAMERA" />
811
<application
912
android:label="Peachy"
1013
android:icon="@mipmap/ic_launcher"

lib/configs/config.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ export 'router.dart';
33
export 'size_config.dart';
44
export 'theme.dart';
55
export 'application.dart';
6-
export 'enum.dart';

lib/configs/enum.dart

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/configs/router.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:e_commerce_app/bottom_navigation.dart';
2-
import 'package:e_commerce_app/presentation/screens/chat/chat_screen.dart';
2+
import 'package:e_commerce_app/presentation/screens/message/message_screen.dart';
33
import 'package:e_commerce_app/presentation/screens/detail_order_screen.dart/detail_order_screen.dart';
44
import 'package:e_commerce_app/presentation/screens/map/map_screen.dart';
55
import 'package:e_commerce_app/presentation/screens/my_orders/my_orders_screen.dart';
@@ -36,7 +36,7 @@ class AppRouter {
3636
static const String MAP = '/map';
3737
static const String CATEGORIES = '/categories';
3838
static const String SETTING = '/setting';
39-
static const String CHAT = '/chat';
39+
static const String MESSAGES = '/messages';
4040
static const String SEARCH = '/search';
4141

4242
static Route<dynamic> generateRoute(RouteSettings settings) {
@@ -108,9 +108,9 @@ class AppRouter {
108108
return MaterialPageRoute(
109109
builder: (_) => MapScreen(),
110110
);
111-
case CHAT:
111+
case MESSAGES:
112112
return MaterialPageRoute(
113-
builder: (_) => ChatScreen(),
113+
builder: (_) => MessagesScreen(),
114114
);
115115
case SEARCH:
116116
return MaterialPageRoute(

lib/data/entities/category.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,6 @@ class Category extends Equatable {
3030
};
3131
}
3232

33-
/// Represent to all category
34-
static const all = Category(
35-
id: "default",
36-
name: "All products",
37-
imageUrl: "",
38-
);
39-
4033
@override
4134
String toString() {
4235
return this.name;

lib/data/entities/entites.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export 'feedback.dart';
66
export 'category.dart';
77
export 'order.dart';
88
export 'delivery_address.dart';
9+
export 'message.dart';

lib/data/entities/order.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Order extends Equatable {
107107
priceOfGoods,
108108
deliveryFee,
109109
coupon,
110-
createdAt
110+
createdAt,
111111
];
112112
}
113113

lib/data/repository/app_repository.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class AppRepository {
99
static final cartRepository = FirebaseCartRepository();
1010
static final orderRepository = FirebaseOrderRepository();
1111
static final feedbackRepository = FirebaseFeedbackRepository();
12+
static final messageRepository = FirebaseMessageRepository();
1213
static final storageRepository = StorageRepository();
1314

1415
/// Singleton factory

lib/data/repository/repository.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ export 'order_repository/order_repo.dart';
1212
export 'order_repository/firebase_order_repo.dart';
1313
export 'feedback_repository/feedback_repo.dart';
1414
export 'feedback_repository/firebase_feedback_repo.dart';
15+
export 'message_repository/message_repo.dart';
16+
export 'message_repository/firebase_message_repo.dart';
1517
export 'storage_repository/storage_repo.dart';
1618
export 'app_repository.dart';

lib/data/repository/storage_repository/storage_repo.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
import 'dart:io';
2+
import 'dart:typed_data';
23

34
import 'package:firebase_storage/firebase_storage.dart';
45

56
class StorageRepository {
67
static const String bucketRef = "gs://e-commerce-flutter-526ce.appspot.com";
78
FirebaseStorage storage = FirebaseStorage.instanceFor(bucket: bucketRef);
89

9-
/// Return photo URL
10-
Future<String> uploadImage(String ref, File file) async {
10+
/// Return image URL
11+
Future<String> uploadImageFile(String ref, File file) async {
1112
var storageRef = storage.ref().child(ref);
1213
var uploadTask = await storageRef.putFile(file);
1314

1415
String downloadURL = await uploadTask.ref.getDownloadURL();
1516
return downloadURL;
1617
}
1718

19+
/// Return photo URL
20+
Future<String> uploadImageData(String ref, Uint8List fileData) async {
21+
var storageRef = storage.ref().child(ref);
22+
var uploadTask = await storageRef.putData(fileData);
23+
24+
String downloadURL = await uploadTask.ref.getDownloadURL();
25+
return downloadURL;
26+
}
27+
1828
///Singleton factory
1929
static final StorageRepository _instance = StorageRepository._internal();
2030

0 commit comments

Comments
 (0)