Skip to content

Commit a1ee74c

Browse files
committed
update model name
1 parent 647ceec commit a1ee74c

File tree

97 files changed

+783
-536
lines changed

Some content is hidden

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

97 files changed

+783
-536
lines changed

assets/locale/en.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,7 @@
164164
"order_successfully": "Order successfully",
165165
"cancel_successfully": "Cancel successfully",
166166
"add_successfully": "Add successfully",
167-
"save": "Save"
167+
"save": "Save",
168+
"district": "District",
169+
"ward": "Ward"
168170
}

assets/locale/vi.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,8 @@
139139
"order_successfully": "Đặt hàng thành công",
140140
"cancel_successfully": "Hủy đơn hàng thành công",
141141
"add_successfully": "Thêm thành công",
142-
"save": "Lưu"
142+
"save": "Lưu",
143+
"city": "Thành phố/ Tỉnh",
144+
"district": "Quận / Huyện",
145+
"ward": "Phường / Xã"
143146
}

lib/configs/router.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 'package:e_commerce_app/bottom_navigation.dart';
2+
import 'package:e_commerce_app/data/models/models.dart';
23
import 'package:e_commerce_app/presentation/screens/detail_image/detail_image_screen.dart';
34
import 'package:e_commerce_app/presentation/screens/message/message_screen.dart';
45
import 'package:e_commerce_app/presentation/screens/detail_order/detail_order_screen.dart';
56
import 'package:e_commerce_app/presentation/screens/map/map_screen.dart';
67
import 'package:e_commerce_app/presentation/screens/my_orders/my_orders_screen.dart';
78
import 'package:e_commerce_app/presentation/screens/search/search_screen.dart';
89
import 'package:flutter/material.dart';
9-
import 'package:e_commerce_app/data/entities/entites.dart';
1010
import 'package:e_commerce_app/presentation/screens/delivery_address/delivery_address_screen.dart';
1111
import 'package:e_commerce_app/presentation/screens/categories/categories_screen.dart';
1212
import 'package:e_commerce_app/presentation/screens/cart/cart_screen.dart';
@@ -82,7 +82,7 @@ class AppRouter {
8282
return MaterialPageRoute(
8383
builder: (_) => FeedbacksScreen(product: product));
8484
case CATEGORIES:
85-
var category = settings.arguments as Category;
85+
var category = settings.arguments as CategoryModel;
8686
return MaterialPageRoute(
8787
builder: (_) => CategoriesScreen(category: category));
8888
case CART:
@@ -94,12 +94,12 @@ class AppRouter {
9494
builder: (_) => MyOrdersScreen(),
9595
);
9696
case DETAIL_ORDER:
97-
var order = settings.arguments as Order;
97+
var order = settings.arguments as OrderModel;
9898
return MaterialPageRoute(
9999
builder: (_) => DetailOrderScreen(order: order));
100100
case DELIVERY_ADDRESS:
101101
return MaterialPageRoute(
102-
builder: (_) => DeliveryAddressScreen(),
102+
builder: (_) => DeliveryAddressModelScreen(),
103103
);
104104
case MAP:
105105
return MaterialPageRoute(

lib/configs/theme.dart

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:e_commerce_app/configs/size_config.dart';
12
import 'package:e_commerce_app/constants/color_constant.dart';
23
import 'package:e_commerce_app/constants/constants.dart';
34
import 'package:flutter/material.dart';
@@ -6,15 +7,16 @@ class AppTheme {
67
static final ThemeData currentTheme = ThemeData(
78
scaffoldBackgroundColor: COLOR_CONST.backgroundColor,
89
fontFamily: "Roboto",
9-
appBarTheme: appBarTheme,
10-
textTheme: textTheme,
10+
appBarTheme: _appBarTheme,
11+
textTheme: _textTheme,
1112
floatingActionButtonTheme: FloatingActionButtonThemeData(
1213
backgroundColor: COLOR_CONST.primaryColor,
1314
),
1415
visualDensity: VisualDensity.adaptivePlatformDensity,
16+
inputDecorationTheme: _inputDecorationThem,
1517
);
1618

17-
static final appBarTheme = AppBarTheme(
19+
static final _appBarTheme = AppBarTheme(
1820
color: Colors.white,
1921
shadowColor: COLOR_CONST.cardShadowColor,
2022
elevation: 0.4,
@@ -25,9 +27,18 @@ class AppTheme {
2527
textTheme: TextTheme(headline6: FONT_CONST.BOLD_DEFAULT_20),
2628
);
2729

28-
static final textTheme = TextTheme(
29-
bodyText1: TextStyle(color: COLOR_CONST.textColor),
30-
bodyText2: TextStyle(color: COLOR_CONST.textColor));
30+
static final _textTheme = TextTheme(
31+
bodyText1: TextStyle(color: COLOR_CONST.textColor),
32+
bodyText2: TextStyle(color: COLOR_CONST.textColor),
33+
);
34+
35+
static final _inputDecorationThem = InputDecorationTheme(
36+
contentPadding: EdgeInsets.symmetric(horizontal: SizeConfig.defaultPadding),
37+
border: OutlineInputBorder(
38+
borderRadius: BorderRadius.circular(5),
39+
borderSide: BorderSide(color: COLOR_CONST.textColor),
40+
),
41+
);
3142

3243
/// Singleton factory
3344
static final AppTheme _instance = AppTheme._internal();

lib/constants/key_constant.dart

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
abstract class KEY_CONST {
2+
//error description
3+
static const request_send_timeout = "request_send_timeout";
4+
static const request_cancelled = "request_cancelled";
5+
static const request_connect_timeout = "request_connect_timeout";
6+
static const no_internet = "no_internet";
7+
static const request_receive_timeout = "request_receive_timeout";
8+
static const not_found = "Not found.";
9+
static const error = "Error";
10+
static const unknown_error = "Unknown_error";
11+
}
12+
13+
class MovieListType {
14+
static String popular = "popular";
15+
static String nowPlaying = "now_playing";
16+
static String topRated = "top_rated";
17+
static String upcoming = "upcoming";
18+
}

lib/data/entities/delivery_address.dart

-70
This file was deleted.

lib/data/entities/entites.dart

-9
This file was deleted.

lib/data/entities/banner.dart renamed to lib/data/models/banner_model.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import 'package:equatable/equatable.dart';
22

3-
class BannerItem extends Equatable {
3+
class BannerModel extends Equatable {
44
final String id;
55
final String imageUrl;
66

7-
BannerItem({required this.id, required this.imageUrl});
7+
BannerModel({required this.id, required this.imageUrl});
88

99
/// Json data from server turns into model data
10-
static BannerItem fromMap(Map<String, dynamic> data) {
11-
return BannerItem(
10+
static BannerModel fromMap(Map<String, dynamic> data) {
11+
return BannerModel(
1212
id: data["id"] ?? "",
1313
imageUrl: data["imageUrl"] ?? "",
1414
);
@@ -24,7 +24,7 @@ class BannerItem extends Equatable {
2424

2525
@override
2626
String toString() {
27-
return 'BannerItem{id: $id, url: $imageUrl}';
27+
return 'BannerModel{id: $id, url: $imageUrl}';
2828
}
2929

3030
@override

lib/data/entities/cart_item.dart renamed to lib/data/models/cart_item_model.dart

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import 'package:e_commerce_app/data/entities/entites.dart';
1+
import 'package:e_commerce_app/data/models/models.dart';
22
import 'package:equatable/equatable.dart';
33

44
/// Cart item model
5-
class CartItem extends Equatable {
5+
class CartItemModel extends Equatable {
66
/// Cart item id
77
final String id;
88

@@ -19,7 +19,7 @@ class CartItem extends Equatable {
1919
final Product? productInfo;
2020

2121
/// Constructor
22-
CartItem({
22+
CartItemModel({
2323
required this.id,
2424
required this.productId,
2525
required this.price,
@@ -28,8 +28,8 @@ class CartItem extends Equatable {
2828
});
2929

3030
/// Json data from server turns into model data
31-
static CartItem fromMap(Map<String, dynamic> data) {
32-
return CartItem(
31+
static CartItemModel fromMap(Map<String, dynamic> data) {
32+
return CartItemModel(
3333
id: data["id"] ?? "",
3434
productId: data["productId"],
3535
price: data["price"],
@@ -48,14 +48,14 @@ class CartItem extends Equatable {
4848
}
4949

5050
/// Clone and update
51-
CartItem cloneWith({
51+
CartItemModel cloneWith({
5252
id,
5353
productId,
5454
productInfo,
5555
price,
5656
quantity,
5757
}) {
58-
return CartItem(
58+
return CartItemModel(
5959
id: id ?? this.id,
6060
productId: productId ?? this.productId,
6161
productInfo: productInfo ?? this.productInfo,

lib/data/entities/category.dart renamed to lib/data/models/category_model.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import 'package:equatable/equatable.dart';
22

3-
/// Category model
4-
class Category extends Equatable {
3+
/// CategoryModel model
4+
class CategoryModel extends Equatable {
55
final String id;
66
final String name;
77
final String imageUrl;
88

9-
const Category({
9+
const CategoryModel({
1010
required this.id,
1111
required this.name,
1212
required this.imageUrl,
1313
});
1414

1515
/// Json data from server turns into model data
16-
static Category fromMap(String id, Map<String, dynamic> data) {
17-
return Category(
16+
static CategoryModel fromMap(String id, Map<String, dynamic> data) {
17+
return CategoryModel(
1818
id: data["id"] ?? "",
1919
name: data["name"] ?? "",
2020
imageUrl: data["imageUrl"] ?? "",

0 commit comments

Comments
 (0)