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
fa01087d
Commit
fa01087d
authored
Jul 04, 2025
by
DatHV
Browse files
update brand, detail..
parent
c8abf95b
Changes
108
Show whitespace changes
Inline
Side-by-side
lib/screen/history_point_cashback/models/history_point_cashback_model.dart
0 → 100644
View file @
fa01087d
import
'package:flutter/material.dart'
;
import
'package:mypoint_flutter_app/extensions/datetime_extensions.dart'
;
import
'../../../extensions/date_format.dart'
;
class
HistoryPointCashBackResponse
{
final
double
points
;
final
List
<
HistoryPointCashBackOrderModel
>?
orders
;
HistoryPointCashBackResponse
({
required
this
.
points
,
this
.
orders
});
factory
HistoryPointCashBackResponse
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
return
HistoryPointCashBackResponse
(
points:
(
json
[
'points'
]
??
0
).
toDouble
(),
orders:
(
json
[
'orders'
]
as
List
<
dynamic
>?)
?.
map
((
e
)
=>
HistoryPointCashBackOrderModel
.
fromJson
(
e
))
.
toList
(),
);
}
}
class
HistoryPointCashBackOrderModel
{
final
String
?
status
;
final
double
?
orderAtTime
;
final
String
?
code
,
brand
,
logo
;
final
double
?
price
;
final
int
id
,
points
;
final
List
<
ProductRefundModel
>
products
;
HistoryPointCashBackOrderModel
({
required
this
.
status
,
required
this
.
orderAtTime
,
required
this
.
code
,
required
this
.
brand
,
required
this
.
logo
,
required
this
.
price
,
required
this
.
id
,
required
this
.
points
,
required
this
.
products
,
});
String
get
timeShow
{
if
(
orderAtTime
==
null
)
return
''
;
final
date
=
DateTime
.
fromMillisecondsSinceEpoch
(((
orderAtTime
??
0
)
*
1000
).
toInt
());
return
date
.
toFormattedString
();
}
factory
HistoryPointCashBackOrderModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
return
HistoryPointCashBackOrderModel
(
status:
json
[
'status'
],
orderAtTime:
(
json
[
'order_at_time'
]
as
num
?)?.
toDouble
(),
code:
json
[
'code'
],
brand:
json
[
'brand'
],
logo:
json
[
'logo'
],
price:
(
json
[
'price'
]
as
num
?)?.
toDouble
(),
id:
json
[
'id'
],
points:
json
[
'points'
],
products:
(
json
[
'products'
]
as
List
<
dynamic
>?)
?.
map
((
e
)
=>
ProductRefundModel
.
fromJson
(
e
))
.
toList
()
??
[],
);
}
int
get
productQuantity
=>
products
.
fold
(
0
,
(
sum
,
item
)
=>
sum
+
item
.
quantity
);
}
class
ProductRefundModel
{
final
String
?
name
,
logo
,
brand
;
final
String
code
;
final
double
price
;
final
int
quantity
,
points
;
final
String
?
status
;
ProductRefundModel
({
required
this
.
name
,
required
this
.
logo
,
required
this
.
brand
,
required
this
.
code
,
required
this
.
price
,
required
this
.
quantity
,
required
this
.
points
,
required
this
.
status
,
});
factory
ProductRefundModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
return
ProductRefundModel
(
name:
json
[
'name'
],
logo:
json
[
'logo'
],
brand:
json
[
'brand'
],
code:
json
[
'code'
],
price:
(
json
[
'price'
]
as
num
).
toDouble
(),
quantity:
json
[
'quantity'
],
points:
json
[
'points'
],
status:
json
[
'status'
],
);
}
}
enum
CashBackPointOrderStatus
{
pending
,
approved
,
confirmed
,
reject
,
}
extension
OrderStatusX
on
CashBackPointOrderStatus
{
String
get
tag
{
switch
(
this
)
{
case
CashBackPointOrderStatus
.
pending
:
return
"Chờ xử lý"
;
case
CashBackPointOrderStatus
.
approved
:
return
"Tạm duyệt"
;
case
CashBackPointOrderStatus
.
confirmed
:
return
"Đã hoàn"
;
case
CashBackPointOrderStatus
.
reject
:
return
"Đã huỷ"
;
}
}
String
get
rawValue
{
switch
(
this
)
{
case
CashBackPointOrderStatus
.
pending
:
return
"PENDING"
;
case
CashBackPointOrderStatus
.
approved
:
return
"APPROVED"
;
case
CashBackPointOrderStatus
.
confirmed
:
return
"CONFIRMED"
;
case
CashBackPointOrderStatus
.
reject
:
return
"REJECTED"
;
}
}
Color
get
color
{
switch
(
this
)
{
case
CashBackPointOrderStatus
.
pending
:
return
Colors
.
orange
;
case
CashBackPointOrderStatus
.
approved
:
return
Colors
.
yellow
.
shade900
;
case
CashBackPointOrderStatus
.
confirmed
:
return
Colors
.
green
;
case
CashBackPointOrderStatus
.
reject
:
return
Colors
.
red
;
}
}
}
\ No newline at end of file
lib/screen/home/custom_widget/achievement_carousel_widget.dart
View file @
fa01087d
...
@@ -53,7 +53,7 @@ class AchievementCard extends StatelessWidget {
...
@@ -53,7 +53,7 @@ class AchievementCard extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
imageUrl
=
achievement
.
images
?.
first
.
imageUrl
;
final
imageUrl
=
(
achievement
.
images
?.
isNotEmpty
==
true
)
?
achievement
.
images
?.
first
.
imageUrl
:
""
;
return
GestureDetector
(
return
GestureDetector
(
onTap:
onTap
,
onTap:
onTap
,
child:
ClipRRect
(
child:
ClipRRect
(
...
...
lib/screen/home/custom_widget/affiliate_brand_grid_widget.dart
View file @
fa01087d
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:mypoint_flutter_app/extensions/string_extension.dart'
;
import
'package:mypoint_flutter_app/extensions/string_extension.dart'
;
import
'../../
shopping
/model/affiliate_brand_model.dart'
;
import
'../../
affiliate
/model/affiliate_brand_model.dart'
;
import
'../../voucher/sub_widget/voucher_section_title.dart'
;
import
'../../voucher/sub_widget/voucher_section_title.dart'
;
import
'../models/main_section_config_model.dart'
;
import
'../models/main_section_config_model.dart'
;
...
...
lib/screen/home/custom_widget/brand_grid_widget.dart
View file @
fa01087d
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:mypoint_flutter_app/extensions/string_extension.dart'
;
import
'package:mypoint_flutter_app/extensions/string_extension.dart'
;
import
'package:mypoint_flutter_app/widgets/image_loader.dart'
;
import
'package:mypoint_flutter_app/widgets/image_loader.dart'
;
import
'../../shopping/model/affiliate_brand_model.dart'
;
import
'../../voucher/sub_widget/voucher_section_title.dart'
;
import
'../../voucher/sub_widget/voucher_section_title.dart'
;
import
'../models/brand_model.dart'
;
import
'../models/brand_model.dart'
;
import
'../models/main_section_config_model.dart'
;
import
'../models/main_section_config_model.dart'
;
...
...
lib/screen/home/custom_widget/header_home.dart
View file @
fa01087d
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
import
'package:mypoint_flutter_app/extensions/num_extension.dart'
;
import
'package:mypoint_flutter_app/widgets/image_loader.dart'
;
import
'package:mypoint_flutter_app/widgets/image_loader.dart'
;
import
'../../../preference/data_preference.dart'
;
import
'../../../preference/data_preference.dart'
;
import
'../../../preference/point/header_home_model.dart'
;
import
'../../../preference/point/header_home_model.dart'
;
...
@@ -17,7 +18,7 @@ class HomeGreetingHeader extends StatelessWidget {
...
@@ -17,7 +18,7 @@ class HomeGreetingHeader extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
final
width
=
MediaQuery
.
of
(
context
).
size
.
width
;
final
width
=
MediaQuery
.
of
(
context
).
size
.
width
;
final
heightSize
=
heightContent
??
(
width
*
86
/
375
+
112
);
final
heightSize
=
heightContent
??
(
width
*
86
/
375
+
112
);
final
name
=
DataPreference
.
instance
.
full
Name
;
final
name
=
DataPreference
.
instance
.
display
Name
;
final
level
=
DataPreference
.
instance
.
rankName
??
"Hạng Đồng"
;
final
level
=
DataPreference
.
instance
.
rankName
??
"Hạng Đồng"
;
double
heightWhiteBox
=
112
;
double
heightWhiteBox
=
112
;
...
@@ -99,7 +100,7 @@ class HomeGreetingHeader extends StatelessWidget {
...
@@ -99,7 +100,7 @@ class HomeGreetingHeader extends StatelessWidget {
children:
[
children:
[
_buildStatItem
(
_buildStatItem
(
icon:
"assets/images/ic_point_gray.png"
,
icon:
"assets/images/ic_point_gray.png"
,
value:
dataHeader
.
totalPointActive
.
toString
(),
value:
(
dataHeader
.
totalPointActive
??
0
).
money
(
CurrencyUnit
.
none
),
//
.toString(),
onTap:
_onPointTap
,
onTap:
_onPointTap
,
),
),
SizedBox
(
width:
12
),
SizedBox
(
width:
12
),
...
...
lib/screen/home/custom_widget/main_service_grid_widget.dart
View file @
fa01087d
...
@@ -20,7 +20,7 @@ class MainServiceGrid extends StatelessWidget {
...
@@ -20,7 +20,7 @@ class MainServiceGrid extends StatelessWidget {
children:
[
children:
[
if
((
sectionConfig
?.
name
??
""
).
isNotEmpty
)
if
((
sectionConfig
?.
name
??
""
).
isNotEmpty
)
HeaderSectionTitle
(
HeaderSectionTitle
(
title:
sectionConfig
?.
name
??
""
,
title:
sectionConfig
?.
name
??
""
,
onViewAll:
sectionConfig
?.
buttonViewAll
?.
directionalScreen
!=
null
?
_handleTapRightButton
:
null
,
onViewAll:
sectionConfig
?.
buttonViewAll
?.
directionalScreen
!=
null
?
_handleTapRightButton
:
null
,
),
),
SizedBox
(
SizedBox
(
...
@@ -55,8 +55,18 @@ class MainServiceGrid extends StatelessWidget {
...
@@ -55,8 +55,18 @@ class MainServiceGrid extends StatelessWidget {
width:
64
,
width:
64
,
height:
64
,
height:
64
,
padding:
const
EdgeInsets
.
all
(
10
),
padding:
const
EdgeInsets
.
all
(
10
),
child:
item
.
serviceIcon
!=
null
&&
item
.
serviceIcon
!.
isNotEmpty
child:
?
Image
.
asset
(
item
.
serviceIcon
!,
fit:
BoxFit
.
contain
)
item
.
serviceIcon
!=
null
&&
item
.
serviceIcon
!.
isNotEmpty
?
Image
.
asset
(
item
.
serviceIcon
!,
fit:
BoxFit
.
contain
,
errorBuilder:
(
context
,
error
,
stackTrace
)
=>
loadNetworkImage
(
url:
item
.
imageUrl
,
fit:
BoxFit
.
contain
,
placeholderAsset:
'assets/images/ic_logo.png'
,
),
)
:
loadNetworkImage
(
:
loadNetworkImage
(
url:
item
.
imageUrl
,
url:
item
.
imageUrl
,
fit:
BoxFit
.
contain
,
fit:
BoxFit
.
contain
,
...
@@ -78,7 +88,7 @@ class MainServiceGrid extends StatelessWidget {
...
@@ -78,7 +88,7 @@ class MainServiceGrid extends StatelessWidget {
style:
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
10
,
fontWeight:
FontWeight
.
bold
),
style:
const
TextStyle
(
color:
Colors
.
white
,
fontSize:
10
,
fontWeight:
FontWeight
.
bold
),
),
),
),
),
)
)
,
],
],
),
),
Text
(
Text
(
...
@@ -86,7 +96,7 @@ class MainServiceGrid extends StatelessWidget {
...
@@ -86,7 +96,7 @@ class MainServiceGrid extends StatelessWidget {
item
.
serviceName
??
''
,
item
.
serviceName
??
''
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
const
TextStyle
(
fontSize:
13
),
style:
const
TextStyle
(
fontSize:
13
),
)
)
,
],
],
),
),
),
),
...
...
lib/screen/home/header_home_viewmodel.dart
View file @
fa01087d
...
@@ -20,7 +20,9 @@ class HeaderHomeViewModel extends RestfulApiViewModel {
...
@@ -20,7 +20,9 @@ class HeaderHomeViewModel extends RestfulApiViewModel {
}
}
Future
<
void
>
freshData
()
async
{
Future
<
void
>
freshData
()
async
{
if
(
_headerHomeData
.
value
==
null
)
{
await
_getDynamicHeaderHome
();
await
_getDynamicHeaderHome
();
}
await
_getNotificationUnread
();
await
_getNotificationUnread
();
}
}
...
...
lib/screen/home/home_screen.dart
View file @
fa01087d
...
@@ -7,7 +7,6 @@ import 'package:mypoint_flutter_app/screen/home/custom_widget/product_grid_widge
...
@@ -7,7 +7,6 @@ import 'package:mypoint_flutter_app/screen/home/custom_widget/product_grid_widge
import
'package:mypoint_flutter_app/screen/home/pipi_detail_screen.dart'
;
import
'package:mypoint_flutter_app/screen/home/pipi_detail_screen.dart'
;
import
'package:mypoint_flutter_app/shared/router_gage.dart'
;
import
'package:mypoint_flutter_app/shared/router_gage.dart'
;
import
'../../preference/point/header_home_model.dart'
;
import
'../../preference/point/header_home_model.dart'
;
import
'../shopping/sub_widget/build_affiliate_brand.dart'
;
import
'../voucher/sub_widget/voucher_section_title.dart'
;
import
'../voucher/sub_widget/voucher_section_title.dart'
;
import
'custom_widget/achievement_carousel_widget.dart'
;
import
'custom_widget/achievement_carousel_widget.dart'
;
import
'custom_widget/affiliate_brand_grid_widget.dart'
;
import
'custom_widget/affiliate_brand_grid_widget.dart'
;
...
@@ -77,6 +76,7 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -77,6 +76,7 @@ class _HomeScreenState extends State<HomeScreen> {
services:
_viewModel
.
services
,
services:
_viewModel
.
services
,
sectionConfig:
_viewModel
.
getMainSectionConfigModel
(
HeaderSectionType
.
topButton
),
sectionConfig:
_viewModel
.
getMainSectionConfigModel
(
HeaderSectionType
.
topButton
),
onTap:
(
item
)
{
onTap:
(
item
)
{
print
(
"item serviceName serviceName
${item.serviceName}
${item.clickActionType}
${item.clickActionParam}
"
);
item
.
directionalScreen
?.
begin
();
item
.
directionalScreen
?.
begin
();
},
},
),
),
...
...
lib/screen/home/home_tab_viewmodel.dart
View file @
fa01087d
...
@@ -3,8 +3,8 @@ import 'package:flutter/services.dart';
...
@@ -3,8 +3,8 @@ import 'package:flutter/services.dart';
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
import
'package:mypoint_flutter_app/networking/restful_api_request.dart'
;
import
'package:mypoint_flutter_app/networking/restful_api_request.dart'
;
import
'../../base/restful_api_viewmodel.dart'
;
import
'../../base/restful_api_viewmodel.dart'
;
import
'../affiliate/model/affiliate_brand_model.dart'
;
import
'../faqs/faqs_model.dart'
;
import
'../faqs/faqs_model.dart'
;
import
'../shopping/model/affiliate_brand_model.dart'
;
import
'../voucher/models/product_model.dart'
;
import
'../voucher/models/product_model.dart'
;
import
'models/achievement_model.dart'
;
import
'models/achievement_model.dart'
;
import
'models/banner_model.dart'
;
import
'models/banner_model.dart'
;
...
...
lib/screen/main_tab_screen/main_tab_screen.dart
View file @
fa01087d
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
import
'../../resouce/base_color.dart'
;
import
'../../resouce/base_color.dart'
;
import
'../affiliate/affiliate_tab_screen.dart'
;
import
'../game/game_tab_screen.dart'
;
import
'../game/game_tab_screen.dart'
;
import
'../home/header_home_viewmodel.dart'
;
import
'../home/header_home_viewmodel.dart'
;
import
'../home/home_screen.dart'
;
import
'../home/home_screen.dart'
;
import
'../personal/personal_screen.dart'
;
import
'../personal/personal_screen.dart'
;
import
'../shopping/affiliate_tab_screen.dart'
;
import
'../voucher/voucher_tab_screen.dart'
;
import
'../voucher/voucher_tab_screen.dart'
;
class
MainTabScreen
extends
StatefulWidget
{
class
MainTabScreen
extends
StatefulWidget
{
...
...
lib/screen/membership/member_level_header_widget.dart
View file @
fa01087d
...
@@ -32,7 +32,7 @@ class MemberLevelHeaderWidget extends StatelessWidget {
...
@@ -32,7 +32,7 @@ class MemberLevelHeaderWidget extends StatelessWidget {
}
}
Widget
_buildCardHeader
()
{
Widget
_buildCardHeader
()
{
final
name
=
DataPreference
.
instance
.
full
Name
;
final
name
=
DataPreference
.
instance
.
display
Name
;
return
Column
(
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
...
...
lib/screen/membership/membership_screen.dart
View file @
fa01087d
...
@@ -24,6 +24,7 @@ class _MembershipScreenState extends BaseState<MembershipScreen> with BasicState
...
@@ -24,6 +24,7 @@ class _MembershipScreenState extends BaseState<MembershipScreen> with BasicState
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
_viewModel
=
Get
.
put
(
MembershipViewModel
());
_viewModel
=
Get
.
put
(
MembershipViewModel
());
// _viewModel.getMembershipLevelInfo();
}
}
@override
@override
...
@@ -81,7 +82,7 @@ class _MembershipScreenState extends BaseState<MembershipScreen> with BasicState
...
@@ -81,7 +82,7 @@ class _MembershipScreenState extends BaseState<MembershipScreen> with BasicState
],
],
),
),
const
SizedBox
(
height:
8
),
const
SizedBox
(
height:
8
),
HtmlWidget
(
item
.
content
??
"
"
),
HtmlWidget
(
"
item.content ?? "
),
],
],
),
),
);
);
...
...
lib/screen/membership/membership_viewmodel.dart
View file @
fa01087d
import
'dart:convert'
;
import
'dart:convert'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get.dart'
;
import
'package:mypoint_flutter_app/extensions/collection_extension.dart'
;
import
'package:mypoint_flutter_app/extensions/collection_extension.dart'
;
import
'package:mypoint_flutter_app/networking/restful_api_request.dart'
;
import
'package:mypoint_flutter_app/networking/restful_api_request.dart'
;
import
'../../base/restful_api_viewmodel.dart'
;
import
'../../base/restful_api_viewmodel.dart'
;
import
'models/membership_info_response.dart'
;
import
'models/membership_info_response.dart'
;
import
'models/membership_level_model.dart'
;
import
'models/membership_level_model.dart'
;
...
@@ -24,14 +22,14 @@ class MembershipViewModel extends RestfulApiViewModel {
...
@@ -24,14 +22,14 @@ class MembershipViewModel extends RestfulApiViewModel {
if
(
levels
==
null
||
levels
!.
isEmpty
)
{
if
(
levels
==
null
||
levels
!.
isEmpty
)
{
return
null
;
return
null
;
}
}
return
levels
?.
safe
(
selectedTab
.
value
)?.
conditions
;
return
levels
?.
safe
(
selectedTab
.
value
)?.
conditions
?.
whereType
<
MembershipLevelTermAndConditionModel
>().
toList
()
;
}
}
@override
@override
onInit
()
{
onInit
()
{
super
.
onInit
();
super
.
onInit
();
//
getMembershipLevelInfo();
getMembershipLevelInfo
();
loadMembershipInfoFromAssets
();
//
loadMembershipInfoFromAssets();
}
}
_makeSelectedLevel
()
{
_makeSelectedLevel
()
{
...
@@ -39,10 +37,7 @@ class MembershipViewModel extends RestfulApiViewModel {
...
@@ -39,10 +37,7 @@ class MembershipViewModel extends RestfulApiViewModel {
selectedLevel
=
null
;
selectedLevel
=
null
;
return
;
return
;
}
}
selectedLevel
=
levels
!.
firstWhere
(
selectedLevel
=
levels
!.
firstWhere
((
e
)
=>
e
.
levelStartAtDate
?.
isNotEmpty
==
true
,
orElse:
()
=>
levels
!.
first
);
(
e
)
=>
e
.
levelStartAtDate
?.
isNotEmpty
==
true
,
orElse:
()
=>
levels
!.
first
,
);
}
}
loadMembershipInfoFromAssets
()
async
{
loadMembershipInfoFromAssets
()
async
{
...
@@ -57,7 +52,12 @@ class MembershipViewModel extends RestfulApiViewModel {
...
@@ -57,7 +52,12 @@ class MembershipViewModel extends RestfulApiViewModel {
showLoading
();
showLoading
();
try
{
try
{
final
response
=
await
client
.
getMembershipLevelInfo
();
final
response
=
await
client
.
getMembershipLevelInfo
();
print
(
"getMembershipLevelInfo"
);
print
(
response
.
data
?.
membershipRule
);
print
(
response
.
data
?.
levels
?.
first
?.
condition
);
print
(
response
.
data
?.
levels
?.
first
?.
conditions
);
membershipInfo
.
value
=
response
.
data
;
membershipInfo
.
value
=
response
.
data
;
_makeSelectedLevel
();
hideLoading
();
hideLoading
();
}
catch
(
e
)
{
}
catch
(
e
)
{
hideLoading
();
hideLoading
();
...
...
lib/screen/membership/models/membership_level_model.dart
View file @
fa01087d
...
@@ -46,17 +46,20 @@ class MembershipLevelModel {
...
@@ -46,17 +46,20 @@ class MembershipLevelModel {
@JsonKey
(
name:
'downgrade_level_when_counter_is_less_than'
)
@JsonKey
(
name:
'downgrade_level_when_counter_is_less_than'
)
final
String
?
downgradePointThreshold
;
final
String
?
downgradePointThreshold
;
@JsonKey
(
name:
'downgrade_level_when_counter_gmv_is_less_than'
)
//
@JsonKey(name: 'downgrade_level_when_counter_gmv_is_less_than')
final
String
?
downgradeGmvThreshold
;
//
final String? downgradeGmvThreshold;
@JsonKey
(
name:
'upgrade_to_membership_level_id'
)
@JsonKey
(
name:
'upgrade_to_membership_level_id'
)
final
String
?
upgradeToLevelId
;
final
String
?
upgradeToLevelId
;
@JsonKey
(
name:
'membership_level_term_and_condition'
)
final
String
?
condition
;
@JsonKey
(
name:
'downgrade_to_membership_level_id'
)
@JsonKey
(
name:
'downgrade_to_membership_level_id'
)
final
String
?
downgradeToLevelId
;
final
String
?
downgradeToLevelId
;
@JsonKey
(
name:
'membership_level_term_and_conditions'
)
@JsonKey
(
name:
'membership_level_term_and_conditions'
)
final
List
<
MembershipLevelTermAndConditionModel
>?
conditions
;
final
List
<
MembershipLevelTermAndConditionModel
?
>?
conditions
;
@JsonKey
(
name:
'accumulated_counter'
)
@JsonKey
(
name:
'accumulated_counter'
)
final
AccumulatedCounter
?
accumulatedCounter
;
final
AccumulatedCounter
?
accumulatedCounter
;
...
@@ -77,7 +80,8 @@ class MembershipLevelModel {
...
@@ -77,7 +80,8 @@ class MembershipLevelModel {
this
.
upgradePointThreshold
,
this
.
upgradePointThreshold
,
this
.
upgradeGmvThreshold
,
this
.
upgradeGmvThreshold
,
this
.
downgradePointThreshold
,
this
.
downgradePointThreshold
,
this
.
downgradeGmvThreshold
,
// this.downgradeGmvThreshold,
this
.
condition
,
this
.
upgradeToLevelId
,
this
.
upgradeToLevelId
,
this
.
downgradeToLevelId
,
this
.
downgradeToLevelId
,
this
.
conditions
,
this
.
conditions
,
...
...
lib/screen/membership/models/membership_level_model.g.dart
View file @
fa01087d
...
@@ -26,14 +26,16 @@ MembershipLevelModel _$MembershipLevelModelFromJson(
...
@@ -26,14 +26,16 @@ MembershipLevelModel _$MembershipLevelModelFromJson(
json
[
'upgrade_when_counter_gmv_is_greater_or_equal'
]
as
String
?,
json
[
'upgrade_when_counter_gmv_is_greater_or_equal'
]
as
String
?,
downgradePointThreshold:
downgradePointThreshold:
json
[
'downgrade_level_when_counter_is_less_than'
]
as
String
?,
json
[
'downgrade_level_when_counter_is_less_than'
]
as
String
?,
downgradeGmvThreshold:
condition:
json
[
'membership_level_term_and_condition'
]
as
String
?,
json
[
'downgrade_level_when_counter_gmv_is_less_than'
]
as
String
?,
upgradeToLevelId:
json
[
'upgrade_to_membership_level_id'
]
as
String
?,
upgradeToLevelId:
json
[
'upgrade_to_membership_level_id'
]
as
String
?,
downgradeToLevelId:
json
[
'downgrade_to_membership_level_id'
]
as
String
?,
downgradeToLevelId:
json
[
'downgrade_to_membership_level_id'
]
as
String
?,
conditions:
conditions:
(
json
[
'membership_level_term_and_conditions'
]
as
List
<
dynamic
>?)
(
json
[
'membership_level_term_and_conditions'
]
as
List
<
dynamic
>?)
?.
map
(
?.
map
(
(
e
)
=>
MembershipLevelTermAndConditionModel
.
fromJson
(
(
e
)
=>
e
==
null
?
null
:
MembershipLevelTermAndConditionModel
.
fromJson
(
e
as
Map
<
String
,
dynamic
>,
e
as
Map
<
String
,
dynamic
>,
),
),
)
)
...
@@ -66,9 +68,8 @@ Map<String, dynamic> _$MembershipLevelModelToJson(
...
@@ -66,9 +68,8 @@ Map<String, dynamic> _$MembershipLevelModelToJson(
'upgrade_when_counter_is_greater_or_equal'
:
instance
.
upgradePointThreshold
,
'upgrade_when_counter_is_greater_or_equal'
:
instance
.
upgradePointThreshold
,
'upgrade_when_counter_gmv_is_greater_or_equal'
:
instance
.
upgradeGmvThreshold
,
'upgrade_when_counter_gmv_is_greater_or_equal'
:
instance
.
upgradeGmvThreshold
,
'downgrade_level_when_counter_is_less_than'
:
instance
.
downgradePointThreshold
,
'downgrade_level_when_counter_is_less_than'
:
instance
.
downgradePointThreshold
,
'downgrade_level_when_counter_gmv_is_less_than'
:
instance
.
downgradeGmvThreshold
,
'upgrade_to_membership_level_id'
:
instance
.
upgradeToLevelId
,
'upgrade_to_membership_level_id'
:
instance
.
upgradeToLevelId
,
'membership_level_term_and_condition'
:
instance
.
condition
,
'downgrade_to_membership_level_id'
:
instance
.
downgradeToLevelId
,
'downgrade_to_membership_level_id'
:
instance
.
downgradeToLevelId
,
'membership_level_term_and_conditions'
:
instance
.
conditions
,
'membership_level_term_and_conditions'
:
instance
.
conditions
,
'accumulated_counter'
:
instance
.
accumulatedCounter
,
'accumulated_counter'
:
instance
.
accumulatedCounter
,
...
...
lib/screen/membership/models/membership_level_term_and_condition_model.dart
View file @
fa01087d
import
'package:json_annotation/json_annotation.dart'
;
import
'package:json_annotation/json_annotation.dart'
;
part
'membership_level_term_and_condition_model.g.dart'
;
//
part 'membership_level_term_and_condition_model.g.dart';
@JsonSerializable
()
//
@JsonSerializable()
class
MembershipLevelTermAndConditionModel
{
class
MembershipLevelTermAndConditionModel
{
final
String
?
icon
;
final
String
?
icon
;
final
String
?
title
;
final
String
?
title
;
final
String
?
content
;
final
String
?
content
;
MembershipLevelTermAndConditionModel
({
MembershipLevelTermAndConditionModel
({
this
.
icon
,
this
.
title
,
this
.
content
});
this
.
icon
,
this
.
title
,
this
.
content
,
});
factory
MembershipLevelTermAndConditionModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
factory
MembershipLevelTermAndConditionModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
{
_$MembershipLevelTermAndConditionModelFromJson
(
json
);
return
MembershipLevelTermAndConditionModel
(
Map
<
String
,
dynamic
>
toJson
()
=>
_$MembershipLevelTermAndConditionModelToJson
(
this
);
icon:
json
[
'icon'
]
as
String
?,
title:
json
[
'title'
]
as
String
?,
content:
json
[
'content'
]
as
String
?,
);
}
Map
<
String
,
dynamic
>
toJson
()
=>
{
'icon'
:
icon
,
'title'
:
title
,
'content'
:
content
};
}
}
\ No newline at end of file
lib/screen/membership/models/membership_level_term_and_condition_model.g.dart
deleted
100644 → 0
View file @
c8abf95b
// GENERATED CODE - DO NOT MODIFY BY HAND
part of
'membership_level_term_and_condition_model.dart'
;
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
MembershipLevelTermAndConditionModel
_$MembershipLevelTermAndConditionModelFromJson
(
Map
<
String
,
dynamic
>
json
)
=>
MembershipLevelTermAndConditionModel
(
icon:
json
[
'icon'
]
as
String
?,
title:
json
[
'title'
]
as
String
?,
content:
json
[
'content'
]
as
String
?,
);
Map
<
String
,
dynamic
>
_$MembershipLevelTermAndConditionModelToJson
(
MembershipLevelTermAndConditionModel
instance
,
)
=>
<
String
,
dynamic
>{
'icon'
:
instance
.
icon
,
'title'
:
instance
.
title
,
'content'
:
instance
.
content
,
};
lib/screen/mobile_card/models/mobile_service_redeem_data.dart
0 → 100644
View file @
fa01087d
import
'package:json_annotation/json_annotation.dart'
;
part
'mobile_service_redeem_data.g.dart'
;
@JsonSerializable
()
class
MobileServiceRedeemData
{
@JsonKey
(
name:
'item_ids'
)
final
String
?
itemId
;
@JsonKey
(
name:
'customer_balance'
)
final
CustomerBalance
?
customerBalance
;
MobileServiceRedeemData
({
this
.
itemId
,
this
.
customerBalance
});
factory
MobileServiceRedeemData
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$MobileServiceRedeemDataFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$MobileServiceRedeemDataToJson
(
this
);
}
@JsonSerializable
()
class
CustomerBalance
{
@JsonKey
(
name:
'amount_active'
)
final
String
?
amountActive
;
CustomerBalance
({
this
.
amountActive
});
factory
CustomerBalance
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$CustomerBalanceFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$CustomerBalanceToJson
(
this
);
}
\ No newline at end of file
lib/screen/mobile_card/models/mobile_service_redeem_data.g.dart
0 → 100644
View file @
fa01087d
// GENERATED CODE - DO NOT MODIFY BY HAND
part of
'mobile_service_redeem_data.dart'
;
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
MobileServiceRedeemData
_$MobileServiceRedeemDataFromJson
(
Map
<
String
,
dynamic
>
json
,
)
=>
MobileServiceRedeemData
(
itemId:
json
[
'item_ids'
]
as
String
?,
customerBalance:
json
[
'customer_balance'
]
==
null
?
null
:
CustomerBalance
.
fromJson
(
json
[
'customer_balance'
]
as
Map
<
String
,
dynamic
>,
),
);
Map
<
String
,
dynamic
>
_$MobileServiceRedeemDataToJson
(
MobileServiceRedeemData
instance
,
)
=>
<
String
,
dynamic
>{
'item_ids'
:
instance
.
itemId
,
'customer_balance'
:
instance
.
customerBalance
,
};
CustomerBalance
_$CustomerBalanceFromJson
(
Map
<
String
,
dynamic
>
json
)
=>
CustomerBalance
(
amountActive:
json
[
'amount_active'
]
as
String
?);
Map
<
String
,
dynamic
>
_$CustomerBalanceToJson
(
CustomerBalance
instance
)
=>
<
String
,
dynamic
>{
'amount_active'
:
instance
.
amountActive
};
lib/screen/mobile_card/models/product_mobile_card_model.dart
0 → 100644
View file @
fa01087d
import
'package:json_annotation/json_annotation.dart'
;
part
'product_mobile_card_model.g.dart'
;
@JsonSerializable
(
explicitToJson:
true
)
class
ProductMobileCardModel
{
final
String
?
id
;
@JsonKey
(
name:
'product_model_code'
)
final
String
?
productModelCode
;
final
String
?
code
;
final
String
?
name
;
@JsonKey
(
name:
'data_duration_apply'
)
final
String
?
dataDurationApply
;
@JsonKey
(
name:
'description'
)
final
String
?
productDescription
;
@JsonKey
(
name:
'start_time'
)
final
String
?
startTime
;
@JsonKey
(
name:
'end_time'
)
final
String
?
endTime
;
@JsonKey
(
name:
'limit_quantity_per_transaction'
)
final
String
?
limitQuantityPerTransaction
;
@JsonKey
(
name:
'brand_id'
)
final
String
?
brandId
;
@JsonKey
(
name:
'brand_code'
)
final
String
?
brandCode
;
@JsonKey
(
name:
'brand_name'
)
final
String
?
brandName
;
@JsonKey
(
name:
'point_reward'
)
final
String
?
pointReward
;
@JsonKey
(
name:
'brand_logo'
)
final
String
?
brandLogo
;
final
List
<
MobileCardImageModel
>?
images
;
final
MobileCardLanguageModel
?
language
;
final
List
<
MobileCardPriceModel
>?
prices
;
ProductMobileCardModel
({
this
.
id
,
this
.
productModelCode
,
this
.
code
,
this
.
name
,
this
.
dataDurationApply
,
this
.
productDescription
,
this
.
startTime
,
this
.
endTime
,
this
.
limitQuantityPerTransaction
,
this
.
brandId
,
this
.
brandCode
,
this
.
brandName
,
this
.
pointReward
,
this
.
brandLogo
,
this
.
images
,
this
.
language
,
this
.
prices
,
});
factory
ProductMobileCardModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$ProductMobileCardModelFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$ProductMobileCardModelToJson
(
this
);
}
@JsonSerializable
()
class
ProductMobileCardResponse
{
final
List
<
ProductMobileCardModel
>?
products
;
ProductMobileCardResponse
({
this
.
products
});
factory
ProductMobileCardResponse
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$ProductMobileCardResponseFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$ProductMobileCardResponseToJson
(
this
);
}
@JsonSerializable
()
class
MobileCardImageModel
{
final
String
?
id
;
final
String
?
caption
;
@JsonKey
(
name:
'image_url'
)
final
String
?
imageUrl
;
MobileCardImageModel
({
this
.
id
,
this
.
caption
,
this
.
imageUrl
});
factory
MobileCardImageModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$MobileCardImageModelFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$MobileCardImageModelToJson
(
this
);
}
@JsonSerializable
()
class
MobileCardLanguageModel
{
final
String
?
content
;
@JsonKey
(
name:
'term_and_condition'
)
final
String
?
termAndCondition
;
@JsonKey
(
name:
'stock_remark'
)
final
String
?
stockRemark
;
MobileCardLanguageModel
({
this
.
content
,
this
.
termAndCondition
,
this
.
stockRemark
,
});
factory
MobileCardLanguageModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$MobileCardLanguageModelFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$MobileCardLanguageModelToJson
(
this
);
}
@JsonSerializable
()
class
MobileCardPriceModel
{
@JsonKey
(
name:
'channel_code'
)
final
String
?
channelCode
;
@JsonKey
(
name:
'channel_name'
)
final
String
?
channelName
;
@JsonKey
(
name:
'pay_point'
)
final
String
?
payPoint
;
@JsonKey
(
name:
'original_price'
)
final
String
?
originalPrice
;
@JsonKey
(
name:
'pool_code'
)
final
String
?
poolCode
;
@JsonKey
(
name:
'sub_pool_code'
)
final
String
?
subPoolCode
;
@JsonKey
(
name:
'currency_code'
)
final
String
?
currencyCode
;
MobileCardPriceModel
({
this
.
channelCode
,
this
.
channelName
,
this
.
payPoint
,
this
.
originalPrice
,
this
.
poolCode
,
this
.
subPoolCode
,
this
.
currencyCode
,
});
factory
MobileCardPriceModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$MobileCardPriceModelFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$MobileCardPriceModelToJson
(
this
);
}
\ No newline at end of file
Prev
1
2
3
4
5
6
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