Commit c285d072 authored by DatHV's avatar DatHV
Browse files

update game center

parent 8d264762
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../shared/router_gage.dart';
import '../../../widgets/custom_empty_widget.dart'; import '../../../widgets/custom_empty_widget.dart';
import '../../../widgets/custom_navigation_bar.dart'; import '../../../widgets/custom_navigation_bar.dart';
import '../../../widgets/custom_search_navigation_bar.dart'; import '../../../widgets/custom_search_navigation_bar.dart';
...@@ -79,7 +80,12 @@ class _VoucherListScreenState extends State<VoucherListScreen> { ...@@ -79,7 +80,12 @@ class _VoucherListScreenState extends State<VoucherListScreen> {
); );
} }
final product = _viewModel.products[index]; final product = _viewModel.products[index];
return VoucherListItem(product: product); return GestureDetector(
onTap: () {
Get.toNamed(voucherDetailScreen, arguments: product.id);
},
child: VoucherListItem(product: product),
);
}, },
), ),
); );
......
import 'package:get/get_navigation/src/routes/get_route.dart'; import 'package:get/get_navigation/src/routes/get_route.dart';
import '../screen/game/game_cards/game_card_screen.dart';
import '../screen/login/login_screen.dart'; import '../screen/login/login_screen.dart';
import '../screen/main_tab_screen/main_tab_screen.dart'; import '../screen/main_tab_screen/main_tab_screen.dart';
import '../screen/onboarding/onboarding_screen.dart'; import '../screen/onboarding/onboarding_screen.dart';
...@@ -14,6 +15,7 @@ const mainScreen = '/main'; ...@@ -14,6 +15,7 @@ const mainScreen = '/main';
const settingScreen = '/setting'; const settingScreen = '/setting';
const vouchersScreen = '/vouchers'; const vouchersScreen = '/vouchers';
const voucherDetailScreen = '/voucherDetail'; const voucherDetailScreen = '/voucherDetail';
const gameCardScreen = '/gameCardScreen';
class RouterPage { class RouterPage {
static List<GetPage> pages() { static List<GetPage> pages() {
...@@ -31,6 +33,7 @@ class RouterPage { ...@@ -31,6 +33,7 @@ class RouterPage {
GetPage(name: settingScreen, page: () => const SettingScreen()), GetPage(name: settingScreen, page: () => const SettingScreen()),
GetPage(name: vouchersScreen, page: () => VoucherListScreen(),), GetPage(name: vouchersScreen, page: () => VoucherListScreen(),),
GetPage(name: voucherDetailScreen, page: () => VoucherDetailScreen(),), GetPage(name: voucherDetailScreen, page: () => VoucherDetailScreen(),),
GetPage(name: gameCardScreen, page: () => GameCardScreen(),),
]; ];
} }
} }
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import '../extensions/num_extension.dart';
import '../screen/voucher/models/cash_type.dart';
class CustomPointText extends StatelessWidget {
final int point;
final CashType? type;
bool get isFree => point == 0;
CurrencyUnit get currencyUnit => type == CashType.point ? CurrencyUnit.point : CurrencyUnit.vnd;
const CustomPointText({
super.key,
required this.point,
this.type,
});
@override
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset('assets/images/ic_point.png', width: 16, height: 16),
const SizedBox(width: 4),
Text(
isFree ? 'Miễn phí' : point.money(currencyUnit),
style: TextStyle(
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
],
);
}
}
...@@ -22,14 +22,14 @@ class PriceTagWidget extends StatelessWidget { ...@@ -22,14 +22,14 @@ class PriceTagWidget extends StatelessWidget {
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Image.asset('assets/images/ic_point.png', width: 16, height: 14), Image.asset('assets/images/ic_point.png', width: 16, height: 16),
const SizedBox(width: 4), const SizedBox(width: 4),
Text( Text(
isFree ? 'Miễn phí' : point.money(CurrencyUnit.none), isFree ? 'Miễn phí' : point.money(CurrencyUnit.none),
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.bold,
), ),
), ),
], ],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment