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
e92ea8bf
Commit
e92ea8bf
authored
Mar 11, 2025
by
DatHV
Browse files
update logic
parent
5413611e
Changes
24
Hide whitespace changes
Inline
Side-by-side
lib/screen/pageDetail/model/campaign_detail_model.dart
View file @
e92ea8bf
...
...
@@ -2,6 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
import
'campaign_detail_item_model.dart'
;
part
'campaign_detail_model.g.dart'
;
@JsonSerializable
()
class
CampaignDetailModel
{
final
String
?
title
;
...
...
@@ -16,9 +17,15 @@ class CampaignDetailModel {
final
String
?
buttonName
;
@JsonKey
(
name:
"button_text_color"
)
final
String
?
buttonTextColor
;
@JsonKey
(
name:
"button_click_action_type"
)
final
String
?
buttonClickActionType
;
@JsonKey
(
name:
"button_click_action_param"
)
final
String
?
buttonClickActionParam
;
final
List
<
CampaignDetailItemModel
>?
items
;
CampaignDetailModel
({
this
.
buttonClickActionParam
,
this
.
buttonClickActionType
,
this
.
title
,
this
.
publishDate
,
this
.
thumbnail
,
...
...
@@ -38,10 +45,9 @@ class CampaignDetailResponseModel {
@JsonKey
(
name:
"page_detail"
)
CampaignDetailModel
?
pageDetail
;
CampaignDetailResponseModel
({
this
.
pageDetail
,
});
CampaignDetailResponseModel
({
this
.
pageDetail
});
factory
CampaignDetailResponseModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$CampaignDetailResponseModelFromJson
(
json
);
factory
CampaignDetailResponseModel
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
_$CampaignDetailResponseModelFromJson
(
json
);
Map
<
String
,
dynamic
>
toJson
()
=>
_$CampaignDetailResponseModelToJson
(
this
);
}
\ No newline at end of file
}
lib/screen/pageDetail/model/campaign_detail_model.g.dart
View file @
e92ea8bf
...
...
@@ -8,6 +8,8 @@ part of 'campaign_detail_model.dart';
CampaignDetailModel
_$CampaignDetailModelFromJson
(
Map
<
String
,
dynamic
>
json
)
=>
CampaignDetailModel
(
buttonClickActionParam:
json
[
'button_click_action_param'
]
as
String
?,
buttonClickActionType:
json
[
'button_click_action_type'
]
as
String
?,
title:
json
[
'title'
]
as
String
?,
publishDate:
json
[
'publish_at_date'
]
as
String
?,
thumbnail:
json
[
'thumbnail'
]
as
String
?,
...
...
@@ -34,6 +36,8 @@ Map<String, dynamic> _$CampaignDetailModelToJson(
'button_color'
:
instance
.
buttonColor
,
'button_name'
:
instance
.
buttonName
,
'button_text_color'
:
instance
.
buttonTextColor
,
'button_click_action_type'
:
instance
.
buttonClickActionType
,
'button_click_action_param'
:
instance
.
buttonClickActionParam
,
'items'
:
instance
.
items
,
};
...
...
lib/screen/support/support_screen.dart
View file @
e92ea8bf
...
...
@@ -6,6 +6,7 @@ import 'package:url_launcher/url_launcher.dart';
import
'../../resouce/base_color.dart'
;
import
'../../widgets/back_button.dart'
;
import
'../faqs/faqs_screen.dart'
;
import
'../pageDetail/campaign_detail_screen.dart'
;
import
'../pageDetail/model/detail_page_rule_type.dart'
;
...
...
@@ -40,7 +41,7 @@ class _SupportScreenState extends State<SupportScreen> {
}
break
;
case
SupportItemType
.
question
:
Get
.
to
(
CampaignDetailScreen
(
type:
DetailPageRuleType
.
decree
));
Get
.
to
(
FAQScreen
(
));
case
SupportItemType
.
termsOfUse
:
Get
.
to
(
CampaignDetailScreen
(
type:
DetailPageRuleType
.
termsOfUse
));
case
SupportItemType
.
privacyPolicy
:
...
...
@@ -96,7 +97,6 @@ class _SupportScreenState extends State<SupportScreen> {
);
}
/// 🎯 Chuyển đổi `SupportItemType` thành icon phù hợp
IconData
_getIcon
(
SupportItemType
type
)
{
switch
(
type
)
{
case
SupportItemType
.
mail
:
...
...
@@ -116,7 +116,6 @@ class _SupportScreenState extends State<SupportScreen> {
}
}
/// 🎯 Xác định có hiển thị mũi tên `>` hay không
bool
_hasArrow
(
SupportItemType
type
)
{
return
type
==
SupportItemType
.
question
||
type
==
SupportItemType
.
termsOfUse
||
...
...
lib/widgets/back_button.dart
View file @
e92ea8bf
...
...
@@ -18,8 +18,8 @@ class CustomBackButton extends StatelessWidget {
children:
[
Center
(
child:
Container
(
height:
3
6
,
width:
3
6
,
height:
3
2
,
width:
3
2
,
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
BaseColor
.
second300
,
width:
1
),
borderRadius:
BorderRadius
.
circular
(
8
),
...
...
Prev
1
2
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