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
75178f29
Commit
75178f29
authored
May 27, 2025
by
DatHV
Browse files
update notify screen,
voucher QR code
parent
33ec1dde
Changes
24
Hide whitespace changes
Inline
Side-by-side
lib/screen/voucher/sub_widget/voucher_item_list.dart
View file @
75178f29
...
@@ -22,7 +22,7 @@ class VoucherItemList extends StatelessWidget {
...
@@ -22,7 +22,7 @@ class VoucherItemList extends StatelessWidget {
final
product
=
items
[
index
];
final
product
=
items
[
index
];
return
GestureDetector
(
return
GestureDetector
(
onTap:
()
{
onTap:
()
{
Get
.
toNamed
(
voucherDetailScreen
,
arguments:
product
.
id
);
Get
.
toNamed
(
voucherDetailScreen
,
arguments:
{
"productId"
:
product
.
id
}
);
},
},
child:
VoucherListItem
(
product:
product
),
child:
VoucherListItem
(
product:
product
),
);
);
...
...
lib/screen/voucher/voucher_code_card_screen.dart
0 → 100644
View file @
75178f29
import
'package:barcode_widget/barcode_widget.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:mypoint_flutter_app/resouce/base_color.dart'
;
import
'package:mypoint_flutter_app/widgets/back_button.dart'
;
import
'package:mypoint_flutter_app/widgets/dashed_line.dart'
;
import
'package:qr_flutter/qr_flutter.dart'
;
import
'../../widgets/custom_point_text_tag.dart'
;
import
'../../widgets/image_loader.dart'
;
import
'models/product_model.dart'
;
class
VoucherCodeCardScreen
extends
StatelessWidget
{
final
ProductModel
product
;
const
VoucherCodeCardScreen
({
super
.
key
,
required
this
.
product
});
@override
Widget
build
(
BuildContext
context
)
{
final
code
=
product
.
item
?.
codeSecret
??
''
;
final
password
=
product
.
item
?.
password
??
""
;
final
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
return
Scaffold
(
backgroundColor:
BaseColor
.
primary500
,
appBar:
AppBar
(
leading:
CustomBackButton
(),
backgroundColor:
Colors
.
transparent
),
body:
Stack
(
children:
[
Column
(
children:
[
Container
(
margin:
const
EdgeInsets
.
all
(
16
),
padding:
const
EdgeInsets
.
all
(
16
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
)),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
product
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
24
,
fontWeight:
FontWeight
.
bold
),
textAlign:
TextAlign
.
center
,
),
const
SizedBox
(
height:
8
),
if
(
product
.
expire
.
isNotEmpty
)
Text
.
rich
(
TextSpan
(
children:
[
const
TextSpan
(
text:
'Hạn dùng: '
,
style:
TextStyle
(
color:
Colors
.
black87
,
fontSize:
14
)),
TextSpan
(
text:
product
.
expire
,
style:
const
TextStyle
(
color:
BaseColor
.
primary500
,
fontWeight:
FontWeight
.
bold
,
fontSize:
14
,
),
),
],
),
),
const
SizedBox
(
height:
8
),
QrImageView
(
data:
code
,
size:
screenWidth
/
2.2
,
embeddedImage:
const
AssetImage
(
'assets/images/ic_logo.png'
),
embeddedImageStyle:
QrEmbeddedImageStyle
(
size:
Size
(
screenWidth
/
9
,
screenWidth
/
9
)),
),
const
SizedBox
(
height:
8
),
BarcodeWidget
(
data:
code
,
barcode:
Barcode
.
code128
(),
height:
60
,
width:
screenWidth
/
1.5
,
drawText:
false
,
),
const
SizedBox
(
height:
12
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
code
,
style:
const
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
bold
)),
const
SizedBox
(
width:
8
),
GestureDetector
(
onTap:
()
{
Clipboard
.
setData
(
ClipboardData
(
text:
code
));
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
'Đã sao chép mã'
)));
},
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
12
,
vertical:
4
),
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
Colors
.
red
),
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
const
Text
(
'Copy'
,
style:
TextStyle
(
color:
Colors
.
red
,
fontWeight:
FontWeight
.
w600
)),
),
),
],
),
const
SizedBox
(
height:
12
),
if
(
password
.
isNotEmpty
)
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
"Mật khẩu"
,
style:
const
TextStyle
(
fontSize:
14
,
color:
Colors
.
black54
)),
const
SizedBox
(
width:
8
),
Text
(
password
,
style:
const
TextStyle
(
fontSize:
18
,
fontWeight:
FontWeight
.
bold
)),
const
SizedBox
(
width:
8
),
GestureDetector
(
onTap:
()
{
Clipboard
.
setData
(
ClipboardData
(
text:
password
));
ScaffoldMessenger
.
of
(
context
,
).
showSnackBar
(
const
SnackBar
(
content:
Text
(
'Đã sao chép mật khẩu'
)));
},
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
12
,
vertical:
4
),
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
Colors
.
red
),
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
const
Text
(
'Copy'
,
style:
TextStyle
(
color:
Colors
.
red
,
fontWeight:
FontWeight
.
w600
),
),
),
),
],
),
DashedLine
(),
const
SizedBox
(
height:
12
),
Row
(
children:
[
CircleAvatar
(
radius:
12
,
backgroundColor:
Colors
.
transparent
,
child:
ClipOval
(
child:
loadNetworkImage
(
url:
product
.
brand
?.
logo
??
""
,
width:
24
,
height:
24
,
fit:
BoxFit
.
cover
,
placeholderAsset:
'assets/images/ic_logo.png'
,
),
),
),
const
SizedBox
(
width:
8
),
Expanded
(
child:
Text
(
product
.
brand
?.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
))),
CustomPointText
(
point:
product
.
amountToBePaid
??
0
,
type:
product
.
price
?.
method
),
],
),
],
),
),
],
),
Positioned
(
bottom:
MediaQuery
.
of
(
context
).
padding
.
bottom
+
8
,
left:
0
,
child:
SizedBox
(
width:
200
,
height:
200
,
child:
Image
.
asset
(
'assets/images/ic_scan_tutorial.png'
,
fit:
BoxFit
.
cover
),
),
),
],
),
);
}
}
lib/screen/voucher/voucher_list/voucher_list_screen.dart
View file @
75178f29
...
@@ -83,12 +83,7 @@ class _VoucherListScreenState extends State<VoucherListScreen> {
...
@@ -83,12 +83,7 @@ class _VoucherListScreenState extends State<VoucherListScreen> {
final
product
=
_viewModel
.
products
[
index
];
final
product
=
_viewModel
.
products
[
index
];
return
GestureDetector
(
return
GestureDetector
(
onTap:
()
{
onTap:
()
{
// // TODO
Get
.
toNamed
(
voucherDetailScreen
,
arguments:
{
"productId"
:
product
.
id
});
Get
.
toNamed
(
transactionHistoryDetailScreen
,
arguments:
{
'orderId'
:
"02744757-a5ef-420d-a737-c0bc93d767b7"
,
'canBack'
:
true
,
});
// Get.toNamed(voucherDetailScreen, arguments: product.id);
},
},
child:
VoucherListItem
(
product:
product
),
child:
VoucherListItem
(
product:
product
),
);
);
...
...
pubspec.yaml
View file @
75178f29
...
@@ -49,6 +49,8 @@ dependencies:
...
@@ -49,6 +49,8 @@ dependencies:
pin_code_fields
:
pin_code_fields
:
intl
:
^0.18.1
intl
:
^0.18.1
webview_flutter
:
^4.2.2
webview_flutter
:
^4.2.2
qr_flutter
:
^4.0.0
barcode_widget
:
^2.0.1
game_miniapp
:
game_miniapp
:
path
:
../mini_app/game_miniapp
path
:
../mini_app/game_miniapp
dev_dependencies
:
dev_dependencies
:
...
...
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