60 lines
1.8 KiB
Dart
60 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:SEFER/constant/colors.dart';
|
|
import 'package:SEFER/constant/style.dart';
|
|
import 'package:SEFER/controller/home/payment/captain_wallet_controller.dart';
|
|
import 'package:SEFER/controller/payment/payment_controller.dart';
|
|
|
|
class PointsCaptain extends StatelessWidget {
|
|
PaymentController paymentController = Get.put(PaymentController());
|
|
CaptainWalletController captainWalletController =
|
|
Get.put(CaptainWalletController());
|
|
|
|
PointsCaptain({
|
|
super.key,
|
|
required this.kolor,
|
|
required this.countPoint,
|
|
required this.pricePoint,
|
|
});
|
|
final Color kolor;
|
|
final String countPoint;
|
|
double pricePoint;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: () async {
|
|
await paymentController.makePaymentStripe(pricePoint, 'USD', () async {
|
|
await captainWalletController.addDriverPayment('visa', pricePoint);
|
|
await captainWalletController.addDriverWallet('visa', countPoint);
|
|
await captainWalletController.getCaptainWalletFromBuyPoints();
|
|
});
|
|
},
|
|
child: Container(
|
|
width: Get.width * .22,
|
|
height: Get.width * .15,
|
|
margin: const EdgeInsets.all(4),
|
|
decoration: BoxDecoration(
|
|
color: kolor,
|
|
border: Border.all(color: AppColor.accentColor),
|
|
borderRadius: BorderRadius.circular(12),
|
|
shape: BoxShape.rectangle,
|
|
),
|
|
child: Center(
|
|
child: Column(
|
|
children: [
|
|
Text(
|
|
'$countPoint ${'Point'.tr}',
|
|
style: AppStyle.subtitle,
|
|
),
|
|
Text(
|
|
'$pricePoint\$',
|
|
style: AppStyle.title,
|
|
),
|
|
],
|
|
),
|
|
)),
|
|
);
|
|
}
|
|
}
|