This commit is contained in:
Hamza-Ayed
2024-05-29 16:09:37 +03:00
parent 058fb67a41
commit 4af52f4392
44 changed files with 9509 additions and 2044 deletions

View File

@@ -1,4 +1,5 @@
import 'package:SEFER/controller/functions/tts.dart';
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
import 'package:SEFER/views/home/my_wallet/payment_history_driver_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -14,8 +15,10 @@ import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:SEFER/views/widgets/mycircular.dart';
import 'package:path/path.dart';
import '../../../controller/payment/driver_payment_controller.dart';
import '../../widgets/my_scafold.dart';
import 'points_captain.dart';
import 'weekly_payment_page.dart';
class WalletCaptain extends StatelessWidget {
WalletCaptain({super.key});
@@ -23,7 +26,7 @@ class WalletCaptain extends StatelessWidget {
Get.put(CaptainWalletController());
@override
Widget build(BuildContext context) {
// Get.put(MapPassengerController());
Get.put(MapDriverController()).totalPassenger = '0';
return MyScafolld(
title: 'Driver Wallet'.tr,
body: [
@@ -38,20 +41,20 @@ class WalletCaptain extends StatelessWidget {
children: [
const SizedBox(),
Container(
decoration: AppStyle.boxDecoration.copyWith(
color: double.parse(captainWalletController
.totalPoints) <
0 &&
double.parse(captainWalletController
.totalPoints) >
-300
? AppColor.yellowColor
: double.parse(captainWalletController
.totalPoints) <
-300
? AppColor.redColor
: AppColor.greenColor,
),
// decoration: AppStyle.boxDecoration1.copyWith(
color: double.parse(
captainWalletController.totalPoints) <
0 &&
double.parse(
captainWalletController.totalPoints) >
-300
? AppColor.yellowColor
: double.parse(
captainWalletController.totalPoints) <
-300
? AppColor.redColor
: AppColor.greenColor,
// ),
child: InkWell(
onTap: () {
Get.snackbar(
@@ -69,6 +72,7 @@ class WalletCaptain extends StatelessWidget {
child: Text(
'${'Total Points is'.tr} ${captainWalletController.totalPoints.toString()} 💎',
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
),
),
@@ -111,8 +115,8 @@ class WalletCaptain extends StatelessWidget {
Get.snackbar(
icon: InkWell(
onTap: () async {
await Get.find<
TextToSpeechController>()
await Get.put(
TextToSpeechController())
.speakText(
'This amount for all trip I get from Passengers'
.tr);
@@ -255,86 +259,89 @@ class WalletCaptain extends StatelessWidget {
const SizedBox(
height: 10,
),
Container(
decoration: AppStyle.boxDecoration,
child: Column(
children: [
Text(
'You can buy Points to let you online\nby this list below'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
const Divider(
indent: 30,
endIndent: 30,
color: AppColor.accentColor,
thickness: 3,
),
const SizedBox(
height: 10,
),
Container(
decoration: AppStyle.boxDecoration,
height: Get.height * .1,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
PointsCaptain(
kolor: AppColor.blueColor,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 5
: 100,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '300'
: '100',
),
PointsCaptain(
kolor: Colors.green,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 10
: 200,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '1040'
: '210',
),
PointsCaptain(
kolor: Colors.amberAccent,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 22
: 400,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '2300'
: '450',
),
PointsCaptain(
kolor: AppColor.yellowColor,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 50
: 1000,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '55000'
: '1200',
),
],
)),
],
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
decoration: AppStyle.boxDecoration,
child: Column(
children: [
Text(
'You can buy Points to let you online\nby this list below'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
const Divider(
indent: 30,
endIndent: 30,
color: AppColor.accentColor,
thickness: 3,
),
const SizedBox(
height: 10,
),
Container(
decoration: AppStyle.boxDecoration,
height: Get.height * .19,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
PointsCaptain(
kolor: AppColor.blueColor,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 5
: 100,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '300'
: '100',
),
PointsCaptain(
kolor: Colors.green,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 10
: 200,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '1040'
: '210',
),
PointsCaptain(
kolor: Colors.amberAccent,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 22
: 400,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '2300'
: '450',
),
PointsCaptain(
kolor: AppColor.yellowColor,
pricePoint:
box.read(BoxName.countryCode) ==
'Jordan'
? 50
: 1000,
countPoint:
box.read(BoxName.countryCode) ==
'Jordan'
? '55000'
: '1200',
),
],
)),
],
),
),
),
const SizedBox(
@@ -362,17 +369,30 @@ class WalletCaptain extends StatelessWidget {
height: 30,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
MyElevatedButton(
kolor: AppColor.blueColor,
title: 'Payment History'.tr,
onPressed: () {
onPressed: () async {
await Get.put(DriverWalletHistoryController())
.getArchivePayment();
Get.to(() => const PaymentHistoryDriverPage(),
transition: Transition.size);
},
),
MyElevatedButton(
kolor: AppColor.blueColor,
title: 'Weekly Budget'.tr,
onPressed: () async {
await Get.put(DriverWalletHistoryController())
.getWeekllyArchivePayment();
Get.to(() => const WeeklyPaymentPage(),
transition: Transition.size);
},
),
],
),
),