Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hoàng Văn Đạt
mypoint_flutter_app
Commits
6b980613
"lib/features/home/home_screen.dart" did not exist on "f1723336d7a3cd57db4ab2e06ecbe4c48a4ed662"
Commit
6b980613
authored
Nov 14, 2025
by
DatHV
Browse files
update project structure
parent
bfff9e47
Changes
507
Show whitespace changes
Inline
Side-by-side
lib/config
s
/callbacks.dart
→
lib/
app/
config/callbacks.dart
View file @
6b980613
File moved
lib/config
s
/constants.dart
→
lib/
app/
config/constants.dart
View file @
6b980613
File moved
lib/env_loader.dart
→
lib/
app/config/
env_loader.dart
View file @
6b980613
...
@@ -75,7 +75,7 @@ Future<Map<String, dynamic>?> _tryLoadFromMethodChannel() async {
...
@@ -75,7 +75,7 @@ Future<Map<String, dynamic>?> _tryLoadFromMethodChannel() async {
final
json
=
jsonDecode
(
result
)
as
Map
<
String
,
dynamic
>;
final
json
=
jsonDecode
(
result
)
as
Map
<
String
,
dynamic
>;
return
json
;
return
json
;
}
else
if
(
result
is
Map
)
{
}
else
if
(
result
is
Map
)
{
final
map
=
Map
<
String
,
dynamic
>.
from
(
result
as
Map
);
final
map
=
Map
<
String
,
dynamic
>.
from
(
result
);
return
map
;
return
map
;
}
}
}
catch
(
_
)
{}
}
catch
(
_
)
{}
...
...
lib/
base
/app_navigator.dart
→
lib/
app/routing
/app_navigator.dart
View file @
6b980613
...
@@ -2,13 +2,13 @@ import 'package:flutter/foundation.dart';
...
@@ -2,13 +2,13 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart'
;
import
'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart'
;
import
'../config
s
/constants.dart'
;
import
'../config/constants.dart'
;
import
'../preference/data_preference.dart'
;
import
'../
../shared/
preference
s
/data_preference.dart'
;
import
'../
resources
/base_color.dart'
;
import
'../
../core/theme
/base_color.dart'
;
import
'../shared/router_gage.dart'
;
import
'../
../
shared/router_gage.dart'
;
import
'../widgets/alert/custom_alert_dialog.dart'
;
import
'../
../shared/
widgets/alert/custom_alert_dialog.dart'
;
import
'../widgets/alert/data_alert_model.dart'
;
import
'../
../shared/
widgets/alert/data_alert_model.dart'
;
import
'../widgets/alert/popup_data_model.dart'
;
import
'../
../shared/
widgets/alert/popup_data_model.dart'
;
class
AppNavigator
{
class
AppNavigator
{
static
final
GlobalKey
<
NavigatorState
>
key
=
GlobalKey
<
NavigatorState
>();
static
final
GlobalKey
<
NavigatorState
>
key
=
GlobalKey
<
NavigatorState
>();
...
...
lib/
deferred
/deferred_routes.dart
→
lib/
app/routing
/deferred_routes.dart
View file @
6b980613
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'../../features/flash_sale/flash_sale_screen.dart'
import
'../screen/flash_sale/flash_sale_screen.dart'
deferred
as
flash_sale
show
FlashSaleScreen
;
deferred
as
flash_sale
show
FlashSaleScreen
;
import
'../
screen
/data_network_service/data_network_service_screen.dart'
import
'../
../features
/data_network_service/data_network_service_screen.dart'
deferred
as
data_network_service
show
DataNetworkServiceScreen
;
deferred
as
data_network_service
show
DataNetworkServiceScreen
;
import
'../
screen
/webview/payment_web_view_screen.dart'
import
'../
../features
/webview/payment_web_view_screen.dart'
deferred
as
payment_web_view
show
PaymentWebViewScreen
;
deferred
as
payment_web_view
show
PaymentWebViewScreen
;
import
'../
screen
/achievement/achievement_list_screen.dart'
import
'../
../features
/achievement/achievement_list_screen.dart'
deferred
as
achievement_list
show
AchievementListScreen
;
deferred
as
achievement_list
show
AchievementListScreen
;
import
'../
screen
/affiliate/affiliate_tab_screen.dart'
import
'../
../features
/affiliate/affiliate_tab_screen.dart'
deferred
as
affiliate_tab
show
AffiliateTabScreen
;
deferred
as
affiliate_tab
show
AffiliateTabScreen
;
import
'../
screen
/history_point/history_point_screen.dart'
import
'../
../features
/history_point/history_point_screen.dart'
deferred
as
history_point
show
HistoryPointScreen
;
deferred
as
history_point
show
HistoryPointScreen
;
import
'../
screen
/bank_account_manager/bank_account_manager_screen.dart'
import
'../
../features
/bank_account_manager/bank_account_manager_screen.dart'
deferred
as
bank_account_manager
show
BankAccountManagerScreen
;
deferred
as
bank_account_manager
show
BankAccountManagerScreen
;
import
'../
screen
/vplay_game_center/vplay_game_center_screen.dart'
import
'../
../features
/vplay_game_center/vplay_game_center_screen.dart'
deferred
as
vplay_game_center
show
VplayGameCenterScreen
;
deferred
as
vplay_game_center
show
VplayGameCenterScreen
;
import
'../
screen
/health_book/health_book_screen.dart'
import
'../
../features
/health_book/health_book_screen.dart'
deferred
as
health_book
show
HealthBookScreen
;
deferred
as
health_book
show
HealthBookScreen
;
import
'../
screen
/invite_friend_campaign/invite_friend_campaign_screen.dart'
import
'../
../features
/invite_friend_campaign/invite_friend_campaign_screen.dart'
deferred
as
invite_friend
show
InviteFriendCampaignScreen
;
deferred
as
invite_friend
show
InviteFriendCampaignScreen
;
import
'../
screen
/quiz_campaign/quiz_campaign_screen.dart'
import
'../
../features
/quiz_campaign/quiz_campaign_screen.dart'
deferred
as
survey_question
show
SurveyQuestionScreen
;
deferred
as
survey_question
show
SurveyQuestionScreen
;
import
'../
screen
/device_manager/device_manager_screen.dart'
import
'../
../features
/device_manager/device_manager_screen.dart'
deferred
as
device_manager
show
DeviceManagerScreen
;
deferred
as
device_manager
show
DeviceManagerScreen
;
import
'../
screen
/order_menu/order_menu_screen.dart'
import
'../
../features
/order_menu/order_menu_screen.dart'
deferred
as
order_menu
show
OrderMenuScreen
;
deferred
as
order_menu
show
OrderMenuScreen
;
import
'../
screen
/location_address/location_address_screen.dart'
import
'../
../features
/location_address/location_address_screen.dart'
deferred
as
location_address
show
LocationAddressScreen
;
deferred
as
location_address
show
LocationAddressScreen
;
import
'../
screen
/membership/membership_screen.dart'
import
'../
../features
/membership/membership_screen.dart'
deferred
as
membership
show
MembershipScreen
;
deferred
as
membership
show
MembershipScreen
;
import
'../
screen
/mobile_card/product_mobile_card_screen.dart'
import
'../
../features
/mobile_card/product_mobile_card_screen.dart'
deferred
as
product_mobile_card
show
ProductMobileCardScreen
;
deferred
as
product_mobile_card
show
ProductMobileCardScreen
;
import
'../
screen
/history_point_cashback/history_point_cashback_screen.dart'
import
'../
../features
/history_point_cashback/history_point_cashback_screen.dart'
deferred
as
history_point_cashback
show
HistoryPointCashBackScreen
;
deferred
as
history_point_cashback
show
HistoryPointCashBackScreen
;
import
'../
screen
/electric_payment/electric_payment_screen.dart'
import
'../
../features
/electric_payment/electric_payment_screen.dart'
deferred
as
electric_payment
show
ElectricPaymentScreen
;
deferred
as
electric_payment
show
ElectricPaymentScreen
;
import
'../
screen
/electric_payment/electric_payment_history_screen.dart'
import
'../
../features
/electric_payment/electric_payment_history_screen.dart'
deferred
as
electric_payment_history
show
ElectricPaymentHistoryScreen
;
deferred
as
electric_payment_history
show
ElectricPaymentHistoryScreen
;
import
'../
screen
/traffic_service/traffic_service_screen.dart'
import
'../
../features
/traffic_service/traffic_service_screen.dart'
deferred
as
traffic_service
show
TrafficServiceScreen
;
deferred
as
traffic_service
show
TrafficServiceScreen
;
import
'../
screen
/traffic_service/traffic_service_detail_screen.dart'
import
'../
../features
/traffic_service/traffic_service_detail_screen.dart'
deferred
as
traffic_service_detail
show
TrafficServiceDetailScreen
;
deferred
as
traffic_service_detail
show
TrafficServiceDetailScreen
;
import
'../
screen
/campaign7day/campaign_7day_screen.dart'
import
'../
../features
/campaign7day/campaign_7day_screen.dart'
deferred
as
campaign_7day
show
Campaign7DayScreen
;
deferred
as
campaign_7day
show
Campaign7DayScreen
;
import
'../
screen
/daily_checkin/daily_checkin_screen.dart'
import
'../
../features
/daily_checkin/daily_checkin_screen.dart'
deferred
as
daily_checkin
show
DailyCheckInScreen
;
deferred
as
daily_checkin
show
DailyCheckInScreen
;
import
'../
screen
/transaction/transactions_history_screen.dart'
import
'../
../features
/transaction/transactions_history_screen.dart'
deferred
as
transactions_history
show
TransactionHistoryScreen
;
deferred
as
transactions_history
show
TransactionHistoryScreen
;
import
'../
screen
/news/news_list_screen.dart'
import
'../
../features
/news/news_list_screen.dart'
deferred
as
news_list
show
NewsListScreen
;
deferred
as
news_list
show
NewsListScreen
;
import
'../
screen
/qr_code/qr_code_screen.dart'
import
'../
../features
/qr_code/qr_code_screen.dart'
deferred
as
qr_code
show
QRCodeScreen
;
deferred
as
qr_code
show
QRCodeScreen
;
import
'../
screen
/affiliate_brand_detail/affiliate_brand_detail_screen.dart'
import
'../
../features
/affiliate_brand_detail/affiliate_brand_detail_screen.dart'
deferred
as
affiliate_brand_detail
show
AffiliateBrandDetailScreen
;
deferred
as
affiliate_brand_detail
show
AffiliateBrandDetailScreen
;
import
'../
screen
/affiliate_brand_detail/affiliate_brand_list_screen.dart'
import
'../
../features
/affiliate_brand_detail/affiliate_brand_list_screen.dart'
deferred
as
affiliate_brand_list
show
AffiliateBrandListScreen
;
deferred
as
affiliate_brand_list
show
AffiliateBrandListScreen
;
import
'../
screen
/affiliate_brand_detail/affiliate_category_grid_screen.dart'
import
'../
../features
/affiliate_brand_detail/affiliate_category_grid_screen.dart'
deferred
as
affiliate_category_grid
show
AffiliateCategoryGridScreen
;
deferred
as
affiliate_category_grid
show
AffiliateCategoryGridScreen
;
import
'../
screen
/contacts/contacts_list_screen.dart'
import
'../
../features
/contacts/contacts_list_screen.dart'
deferred
as
contacts_list
show
ContactsListScreen
;
deferred
as
contacts_list
show
ContactsListScreen
;
import
'../
screen
/health_book/health_book_card_detail.dart'
import
'../
../features
/health_book/health_book_card_detail.dart'
deferred
as
health_book_card_detail
show
HealthBookCardDetail
;
deferred
as
health_book_card_detail
show
HealthBookCardDetail
;
import
'../
screen
/interested_categories/interestied_categories_screen.dart'
import
'../
../features
/interested_categories/interestied_categories_screen.dart'
deferred
as
interest_categories
show
InterestCategoriesScreen
;
deferred
as
interest_categories
show
InterestCategoriesScreen
;
import
'../
screen
/support/support_screen.dart'
import
'../
../features
/support/support_screen.dart'
deferred
as
support
show
SupportScreen
;
deferred
as
support
show
SupportScreen
;
import
'../
screen
/topup/topup_screen.dart'
import
'../
../features
/topup/topup_screen.dart'
deferred
as
topup
show
PhoneTopUpScreen
;
deferred
as
topup
show
PhoneTopUpScreen
;
import
'../
screen
/transaction/history/transaction_history_detail_screen.dart'
import
'../
../features
/transaction/history/transaction_history_detail_screen.dart'
deferred
as
transaction_history_detail
show
TransactionHistoryDetailScreen
;
deferred
as
transaction_history_detail
show
TransactionHistoryDetailScreen
;
import
'../
screen
/transaction/transaction_detail_screen.dart'
import
'../
../features
/transaction/transaction_detail_screen.dart'
deferred
as
transaction_detail
show
TransactionDetailScreen
;
deferred
as
transaction_detail
show
TransactionDetailScreen
;
import
'../
screen
/voucher/detail/voucher_detail_screen.dart'
import
'../
../features
/voucher/detail/voucher_detail_screen.dart'
deferred
as
voucher_detail
show
VoucherDetailScreen
;
deferred
as
voucher_detail
show
VoucherDetailScreen
;
import
'../
screen
/voucher/mobile_card/my_mobile_card_detail_widget.dart'
import
'../
../features
/voucher/mobile_card/my_mobile_card_detail_widget.dart'
deferred
as
mobile_card_detail
show
MyMobileCardDetailScreen
;
deferred
as
mobile_card_detail
show
MyMobileCardDetailScreen
;
import
'../
screen
/voucher/mobile_card/my_mobile_card_list_widget.dart'
import
'../
../features
/voucher/mobile_card/my_mobile_card_list_widget.dart'
deferred
as
mobile_card_list
show
MyMobileCardListScreen
;
deferred
as
mobile_card_list
show
MyMobileCardListScreen
;
import
'../
screen
/voucher/my_voucher/my_product_list_widget.dart'
import
'../
../features
/voucher/my_voucher/my_product_list_widget.dart'
deferred
as
my_voucher_list
show
MyVoucherListScreen
;
deferred
as
my_voucher_list
show
MyVoucherListScreen
;
typedef
DeferredScreenBuilder
=
Widget
Function
(
BuildContext
context
);
typedef
DeferredScreenBuilder
=
Widget
Function
(
BuildContext
context
);
...
...
lib/
directional
/directional_action_type.dart
→
lib/
app/routing
/directional_action_type.dart
View file @
6b980613
File moved
lib/firebase/notification_parse_payload.dart
→
lib/
core/
firebase/notification_parse_payload.dart
View file @
6b980613
File moved
lib/firebase/push_notification.dart
→
lib/
core/
firebase/push_notification.dart
View file @
6b980613
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'../directional/directional_action_type.dart'
;
import
'../directional/directional_screen.dart'
;
import
'package:firebase_messaging/firebase_messaging.dart'
;
import
'package:firebase_messaging/firebase_messaging.dart'
;
import
'../../app/routing/directional_action_type.dart'
;
import
'../../shared/navigation/directional_screen.dart'
;
enum
NotificationType
{
fcm
,
moengage
}
enum
NotificationType
{
fcm
,
moengage
}
class
NotificationRouter
{
class
NotificationRouter
{
...
...
lib/firebase/push_setup.dart
→
lib/
core/
firebase/push_setup.dart
View file @
6b980613
...
@@ -4,8 +4,8 @@ import 'package:firebase_core/firebase_core.dart';
...
@@ -4,8 +4,8 @@ import 'package:firebase_core/firebase_core.dart';
import
'package:firebase_messaging/firebase_messaging.dart'
;
import
'package:firebase_messaging/firebase_messaging.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter_local_notifications/flutter_local_notifications.dart'
;
import
'package:flutter_local_notifications/flutter_local_notifications.dart'
;
import
'package:mypoint_flutter_app/firebase/push_notification.dart'
;
import
'package:mypoint_flutter_app/
core/
firebase/push_notification.dart'
;
import
'../
core/
platform/firebase/firebase_options.dart'
;
import
'../platform/firebase/firebase_options.dart'
;
import
'notification_parse_payload.dart'
;
import
'notification_parse_payload.dart'
;
@pragma
(
'vm:entry-point'
)
// bắt buộc cho background isolate
@pragma
(
'vm:entry-point'
)
// bắt buộc cho background isolate
...
@@ -167,7 +167,7 @@ Future<void> initFirebaseAndFcm() async {
...
@@ -167,7 +167,7 @@ Future<void> initFirebaseAndFcm() async {
});
});
// Initial message sẽ được xử lý sau khi runApp trong main.dart
// Initial message sẽ được xử lý sau khi runApp trong main.dart
// Lấy token để test gửi (bật cho mobile, tắt cho web)
// Lấy token để test gửi (bật cho mobile, tắt cho web)
if
(
messaging
!=
null
&&
!
kIsWeb
)
{
if
(!
kIsWeb
)
{
try
{
try
{
final
token
=
await
messaging
.
getToken
();
final
token
=
await
messaging
.
getToken
();
debugPrint
(
'FCM token:
$token
'
);
debugPrint
(
'FCM token:
$token
'
);
...
...
lib/firebase/push_token_service.dart
→
lib/
core/
firebase/push_token_service.dart
View file @
6b980613
import
'package:firebase_messaging/firebase_messaging.dart'
;
import
'package:firebase_messaging/firebase_messaging.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:mypoint_flutter_app/network
ing
/restful_api_client_all_request.dart'
;
import
'package:mypoint_flutter_app/
core/
network/restful_api_client_all_request.dart'
;
import
'package:mypoint_flutter_app/network
ing
/restful_api_viewmodel.dart'
;
import
'package:mypoint_flutter_app/
core/
network/restful_api_viewmodel.dart'
;
import
'package:mypoint_flutter_app/preference/data_preference.dart'
;
import
'package:mypoint_flutter_app/
shared/
preference
s
/data_preference.dart'
;
class
PushTokenService
extends
RestfulApiViewModel
{
class
PushTokenService
extends
RestfulApiViewModel
{
static
final
PushTokenService
_instance
=
PushTokenService
.
_internal
();
static
final
PushTokenService
_instance
=
PushTokenService
.
_internal
();
...
...
lib/core/network/api/affiliate_api.dart
0 → 100644
View file @
6b980613
import
'package:mypoint_flutter_app/shared/widgets/base_view/base_response_model.dart'
;
import
'package:mypoint_flutter_app/app/config/api_paths.dart'
;
import
'package:mypoint_flutter_app/app/config/callbacks.dart'
;
import
'package:mypoint_flutter_app/core/network/restful_api_client.dart'
;
import
'package:mypoint_flutter_app/shared/preferences/data_preference.dart'
;
import
'../../../features/affiliate/model/affiliate_category_model.dart'
;
import
'../../../features/affiliate/model/affiliate_brand_model.dart'
;
import
'../../../features/affiliate/model/affiliate_product_top_sale_model.dart'
;
import
'../../../features/affiliate/model/cashback_overview_model.dart'
;
import
'../../../features/affiliate_brand_detail/models/affiliate_brand_detail_model.dart'
;
import
'../../../features/home/models/banner_model.dart'
;
class
AffiliateApi
{
AffiliateApi
(
this
.
client
);
final
RestfulAPIClient
client
;
Future
<
BaseResponseModel
<
List
<
AffiliateCategoryModel
>>>
affiliateCategoryGetList
()
async
{
final
token
=
DataPreference
.
instance
.
token
??
""
;
final
body
=
{
"access_token"
:
token
};
return
client
.
requestNormal
(
APIPaths
.
affiliateCategoryGetList
,
Method
.
POST
,
body
,
(
data
)
{
final
list
=
data
as
List
<
dynamic
>;
return
list
.
map
((
e
)
=>
AffiliateCategoryModel
.
fromJson
(
e
)).
toList
();
});
}
Future
<
BaseResponseModel
<
List
<
AffiliateBrandModel
>>>
affiliateBrandGetList
({
String
?
categoryCode
})
async
{
final
token
=
DataPreference
.
instance
.
token
??
""
;
final
body
=
{
"access_token"
:
token
};
if
((
categoryCode
??
''
).
isNotEmpty
)
{
body
[
'category_code'
]
=
categoryCode
!;
}
return
client
.
requestNormal
(
APIPaths
.
affiliateBrandGetList
,
Method
.
POST
,
body
,
(
data
)
{
final
list
=
data
as
List
<
dynamic
>;
return
list
.
map
((
e
)
=>
AffiliateBrandModel
.
fromJson
(
e
)).
toList
();
});
}
Future
<
BaseResponseModel
<
List
<
BannerModel
>>>
affiliateGetBanners
()
async
{
final
token
=
DataPreference
.
instance
.
token
??
""
;
final
body
=
{
"position_code"
:
"BANNER_CASHBACK"
,
"access_token"
:
token
};
return
client
.
requestNormal
(
APIPaths
.
adsBannerByContextRequest
,
Method
.
POST
,
body
,
(
data
)
{
final
json
=
data
as
Json
;
final
banners
=
json
[
'banners'
];
if
(
banners
is
List
)
{
return
banners
.
map
((
e
)
=>
BannerModel
.
fromJson
(
e
)).
toList
();
}
return
[];
});
}
Future
<
BaseResponseModel
<
List
<
AffiliateProductTopSaleModel
>>>
affiliateProductTopSale
()
async
{
final
token
=
DataPreference
.
instance
.
token
??
""
;
final
body
=
{
"access_token"
:
token
};
return
client
.
requestNormal
(
APIPaths
.
affiliateProductTopSale
,
Method
.
POST
,
body
,
(
data
)
{
final
list
=
data
as
List
<
dynamic
>;
return
list
.
map
((
e
)
=>
AffiliateProductTopSaleModel
.
fromJson
(
e
)).
toList
();
});
}
Future
<
BaseResponseModel
<
CashbackOverviewModel
>>
getCashBackOverview
()
async
{
return
client
.
requestNormal
(
APIPaths
.
getCashbackOverview
,
Method
.
GET
,
{},
(
data
)
{
return
CashbackOverviewModel
.
fromJson
(
data
as
Json
);
});
}
Future
<
BaseResponseModel
<
AffiliateBrandDetailModel
>>
getAffiliateBrandDetail
(
String
brandId
)
async
{
final
token
=
DataPreference
.
instance
.
token
??
""
;
final
body
=
{
"access_token"
:
token
,
"brand_id"
:
brandId
};
return
client
.
requestNormal
(
APIPaths
.
affiliateBrandGetDetail
,
Method
.
POST
,
body
,
(
data
)
{
return
AffiliateBrandDetailModel
.
fromJson
(
data
as
Json
);
});
}
}
lib/network
ing
/api/game_api.dart
→
lib/
core/
network/api/game_api.dart
View file @
6b980613
import
'../../base/base_response_model.dart'
;
import
'../../../app/config/api_paths.dart'
;
import
'../../configs/api_paths.dart'
;
import
'../../../shared/widgets/base_view/base_response_model.dart'
;
import
'../../configs/callbacks.dart'
;
import
'../../../app/config/callbacks.dart'
;
import
'../../../features/game/models/game_bundle_item_model.dart'
;
import
'../../../features/game/models/game_bundle_response.dart'
;
import
'../restful_api_client.dart'
;
import
'../restful_api_client.dart'
;
import
'../../screen/game/models/game_bundle_item_model.dart'
;
import
'../../screen/game/models/game_bundle_response.dart'
;
class
GameApi
{
class
GameApi
{
GameApi
(
this
.
client
);
GameApi
(
this
.
client
);
...
@@ -21,26 +21,11 @@ class GameApi {
...
@@ -21,26 +21,11 @@ class GameApi {
Future
<
BaseResponseModel
<
GameBundleItemModel
>>
getGameDetail
(
String
id
)
{
Future
<
BaseResponseModel
<
GameBundleItemModel
>>
getGameDetail
(
String
id
)
{
final
path
=
APIPaths
.
getGameDetail
.
replaceAll
(
'%@'
,
id
);
final
path
=
APIPaths
.
getGameDetail
.
replaceAll
(
'%@'
,
id
);
return
client
.
requestNormal
(
return
client
.
requestNormal
(
path
,
Method
.
POST
,
const
{},
(
data
)
=>
GameBundleItemModel
.
fromJson
(
data
as
Json
));
path
,
Method
.
POST
,
const
{},
(
data
)
=>
GameBundleItemModel
.
fromJson
(
data
as
Json
),
);
}
}
Future
<
BaseResponseModel
<
GameBundleItemModel
>>
submitGameCard
(
Future
<
BaseResponseModel
<
GameBundleItemModel
>>
submitGameCard
(
String
gameId
,
String
itemId
)
{
String
gameId
,
final
path
=
APIPaths
.
submitGameCard
.
replaceFirst
(
'%@'
,
gameId
).
replaceFirst
(
'%@'
,
itemId
);
String
itemId
,
return
client
.
requestNormal
(
path
,
Method
.
POST
,
const
{},
(
data
)
=>
GameBundleItemModel
.
fromJson
(
data
as
Json
));
)
{
final
path
=
APIPaths
.
submitGameCard
.
replaceFirst
(
'%@'
,
gameId
)
.
replaceFirst
(
'%@'
,
itemId
);
return
client
.
requestNormal
(
path
,
Method
.
POST
,
const
{},
(
data
)
=>
GameBundleItemModel
.
fromJson
(
data
as
Json
),
);
}
}
}
}
lib/network
ing
/api/location_api.dart
→
lib/
core/
network/api/location_api.dart
View file @
6b980613
import
'../../
base/base_response_model
.dart'
;
import
'../../
../app/config/api_paths
.dart'
;
import
'../../
configs/api_paths
.dart'
;
import
'../../
../shared/widgets/base_view/base_response_model
.dart'
;
import
'../../config
s
/callbacks.dart'
;
import
'../../
../app/
config/callbacks.dart'
;
import
'../../
networking/restful_api_client
.dart'
;
import
'../../
../features/location_address/models/district_address_model
.dart'
;
import
'../../
preference/data_preference
.dart'
;
import
'../../
../features/location_address/models/province_address_model
.dart'
;
import
'../../
screen/location_address/models/district_address_model
.dart'
;
import
'../../
../shared/preferences/data_preference
.dart'
;
import
'../
../screen/location_address/models/province_address_model
.dart'
;
import
'../
restful_api_client
.dart'
;
class
LocationApi
{
class
LocationApi
{
LocationApi
(
this
.
client
);
LocationApi
(
this
.
client
);
...
@@ -22,9 +22,7 @@ class LocationApi {
...
@@ -22,9 +22,7 @@ class LocationApi {
);
);
}
}
Future
<
BaseResponseModel
<
DistrictAddressResponse
>>
locationDistrictGetList
(
Future
<
BaseResponseModel
<
DistrictAddressResponse
>>
locationDistrictGetList
(
String
provinceCode
)
{
String
provinceCode
,
)
{
final
token
=
DataPreference
.
instance
.
token
??
''
;
final
token
=
DataPreference
.
instance
.
token
??
''
;
final
body
=
{
'access_token'
:
token
,
'province_code'
:
provinceCode
};
final
body
=
{
'access_token'
:
token
,
'province_code'
:
provinceCode
};
return
client
.
requestNormal
(
return
client
.
requestNormal
(
...
...
lib/network
ing
/api/notification_api.dart
→
lib/
core/
network/api/notification_api.dart
View file @
6b980613
import
'../../
base/base_response_model
.dart'
;
import
'../../
../app/config/api_paths
.dart'
;
import
'../../
configs/api_paths
.dart'
;
import
'../../
../shared/widgets/base_view/base_response_model
.dart'
;
import
'../../config
s
/callbacks.dart'
;
import
'../../
../app/
config/callbacks.dart'
;
import
'../../
networking/restful_api_client
.dart'
;
import
'../../
../features/notification/models/notification_unread_model
.dart'
;
import
'../../
preference/data_preference
.dart'
;
import
'../../
../features/notification/models/category_notify_item_model
.dart'
;
import
'../../
screen/home
/models/notification_
unread
_model.dart'
;
import
'../../
../features/notification
/models/notification_
detail
_model.dart'
;
import
'../../
screen
/notification/models/
category_notify_item
_model.dart'
;
import
'../../
../features
/notification/models/
notification_list_data
_model.dart'
;
import
'../../
screen/notification/models/notification_detail_model
.dart'
;
import
'../../
../shared/preferences/data_preference
.dart'
;
import
'../
../screen/notification/models/notification_list_data_model
.dart'
;
import
'../
restful_api_client
.dart'
;
class
NotificationApi
{
class
NotificationApi
{
NotificationApi
(
this
.
client
);
NotificationApi
(
this
.
client
);
...
...
lib/network
ing
/api/product_api.dart
→
lib/
core/
network/api/product_api.dart
View file @
6b980613
import
'../../
base/base_response_model
.dart'
;
import
'../../
../app/config/api_paths
.dart'
;
import
'../../
configs/api_paths
.dart'
;
import
'../../
../shared/widgets/base_view/base_response_model
.dart'
;
import
'../../config
s
/callbacks.dart'
;
import
'../../
../app/
config/callbacks.dart'
;
import
'../../
networking/restful_api_client
.dart'
;
import
'../../
../features/data_network_service/product_network_data_model
.dart'
;
import
'../../
preference/data_preference
.dart'
;
import
'../../
../features/voucher/models/my_product_model
.dart'
;
import
'../../
screen/data_network_service/product_network_data_model
.dart'
;
import
'../../
../features/mobile_card/models/mobile_service_redeem_data
.dart'
;
import
'../../
screen/home
/models/
my_
product_model.dart'
;
import
'../../
../features/mobile_card
/models/product_
mobile_card_
model.dart'
;
import
'../../
screen
/mobile_card/models/
mobile_service_redeem_data
.dart'
;
import
'../../
../features
/mobile_card/models/
usable_voucher_model
.dart'
;
import
'../../
screen/mobile_card/models/product_mobile_card
_model.dart'
;
import
'../../
../features/topup/models/brand_network
_model.dart'
;
import
'../../
screen/mobile_card/models/usable_voucher
_model.dart'
;
import
'../../
../features/traffic_service/traffic_service
_model.dart'
;
import
'../../
screen/topup/models/brand_network
_model.dart'
;
import
'../../
../features/transaction/model/order_product_payment_response
_model.dart'
;
import
'../../
screen/traffic_service/traffic_service
_model.dart'
;
import
'../../
../features/transaction/model/payment_bank_account_info
_model.dart'
;
import
'../../
screen
/transaction/model/
order_product_payment_response
_model.dart'
;
import
'../../
../features
/transaction/model/
payment_method
_model.dart'
;
import
'../../
screen
/transaction/model/p
ayment_bank_account_info
_model.dart'
;
import
'../../
../features
/transaction/model/p
review_order_payment
_model.dart'
;
import
'../../
screen/transaction/model/payment_method
_model.dart'
;
import
'../../
../features/voucher/models/like_product_response
_model.dart'
;
import
'../../
screen/transaction/model/preview_order_payment_model
.dart'
;
import
'../../
../features/voucher/models/my_mobile_card_response
.dart'
;
import
'../../
screen
/voucher/models/
like
_product_
response_model
.dart'
;
import
'../../
../features
/voucher/models/
my
_product_
status_type
.dart'
;
import
'../../
screen
/voucher/models/
my_mobile_card_response
.dart'
;
import
'../../
../features
/voucher/models/
product_brand_model
.dart'
;
import
'../../
screen
/voucher/models/
my_
product_
status_type
.dart'
;
import
'../../
../features
/voucher/models/product_
model
.dart'
;
import
'../../
screen
/voucher/models/product_
brand
_model.dart'
;
import
'../../
../features
/voucher/models/product_
store
_model.dart'
;
import
'../../
screen
/voucher/models/product_
model
.dart'
;
import
'../../
../features
/voucher/models/product_
type
.dart'
;
import
'../../
screen
/voucher/models/product_
stor
e_model.dart'
;
import
'../../
../features
/voucher/models/
search_
product_
respons
e_model.dart'
;
import
'../../
screen/voucher/models/product_typ
e.dart'
;
import
'../../
../shared/preferences/data_preferenc
e.dart'
;
import
'../
../screen/voucher/models/search_product_response_model
.dart'
;
import
'../
restful_api_client
.dart'
;
class
ProductApi
{
class
ProductApi
{
ProductApi
(
this
.
client
);
ProductApi
(
this
.
client
);
...
...
lib/network
ing
/api/website_api.dart
→
lib/
core/
network/api/website_api.dart
View file @
6b980613
import
'../../
base/base_response_model
.dart'
;
import
'../../
../app/config/api_paths
.dart'
;
import
'../../
configs/api_paths
.dart'
;
import
'../../
../shared/widgets/base_view/base_response_model
.dart'
;
import
'../../config
s
/callbacks.dart'
;
import
'../../
../app/
config/callbacks.dart'
;
import
'../../
networking/restful_api_client
.dart'
;
import
'../../
../features/faqs/faqs_model
.dart'
;
import
'../../
preference/data_preference
.dart'
;
import
'../../
../features/pageDetail/model/campaign_detail_model
.dart'
;
import
'../../
screen/faqs/faqs_model
.dart'
;
import
'../../
../features/pageDetail/model/detail_page_rule_type
.dart'
;
import
'../../
screen/pageDetail/model/campaign_detail_model
.dart'
;
import
'../../
../shared/preferences/data_preference
.dart'
;
import
'../
../screen/pageDetail/model/detail_page_rule_type
.dart'
;
import
'../
restful_api_client
.dart'
;
class
WebsiteApi
{
class
WebsiteApi
{
WebsiteApi
(
this
.
client
);
WebsiteApi
(
this
.
client
);
...
...
lib/network
ing
/dio_extra_keys.dart
→
lib/
core/
network/dio_extra_keys.dart
View file @
6b980613
File moved
lib/network
ing
/dio_http_service.dart
→
lib/
core/
network/dio_http_service.dart
View file @
6b980613
import
'package:dio/dio.dart'
;
import
'package:dio/dio.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'../env_loader.dart'
;
import
'../
../app/config/
env_loader.dart'
;
import
'interceptor/auth_interceptor.dart'
;
import
'interceptor/auth_interceptor.dart'
;
import
'interceptor/exception_interceptor.dart'
;
import
'interceptor/exception_interceptor.dart'
;
import
'interceptor/logger_interceptor.dart'
;
import
'interceptor/logger_interceptor.dart'
;
...
...
lib/network
ing
/error_mapper.dart
→
lib/
core/
network/error_mapper.dart
View file @
6b980613
File moved
lib/network
ing
/interceptor/auth_interceptor.dart
→
lib/
core/
network/interceptor/auth_interceptor.dart
View file @
6b980613
import
'dart:async'
;
import
'dart:async'
;
import
'package:dio/dio.dart'
;
import
'package:dio/dio.dart'
;
import
'../../base/app_navigator.dart'
;
import
'../../../app/config/api_paths.dart'
;
import
'../../configs/api_paths.dart'
;
import
'../../../app/config/constants.dart'
;
import
'../../configs/constants.dart'
;
import
'../../../app/routing/app_navigator.dart'
;
import
'../dio_extra_keys.dart'
;
import
'../../../shared/preferences/data_preference.dart'
;
import
'../../services/logout_service.dart'
;
import
'../../services/logout_service.dart'
;
import
'../../services/token_refresh_service.dart'
;
import
'../../services/token_refresh_service.dart'
;
import
'package:mypoint_flutter_app/preference/data_preference.dart'
;
import
'../dio_extra_keys.dart'
;
import
'../dio_http_service.dart'
;
import
'../dio_http_service.dart'
;
class
AuthInterceptor
extends
Interceptor
{
class
AuthInterceptor
extends
Interceptor
{
static
const
_kAuthHandledKey
=
'__auth_handled__'
;
static
const
_kAuthHandledKey
=
'__auth_handled__'
;
static
Completer
<
bool
>?
_refreshCompleter
;
static
Completer
<
bool
>?
_refreshCompleter
;
...
...
Prev
1
2
3
4
5
6
…
26
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment