130 lines
6.2 KiB
Dart
130 lines
6.2 KiB
Dart
import 'package:SEFER/constant/links.dart';
|
|
import 'package:SEFER/constant/style.dart';
|
|
import 'package:SEFER/controller/functions/crud.dart';
|
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
|
import 'package:SEFER/views/widgets/mycircular.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../controller/home/payment/captain_wallet_controller.dart';
|
|
|
|
class TransferBudgetPage extends StatelessWidget {
|
|
const TransferBudgetPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Get.put(CaptainWalletController());
|
|
return MyScafolld(
|
|
title: "Transfer budget".tr,
|
|
body: [
|
|
GetBuilder<CaptainWalletController>(
|
|
builder: (captainWalletController) {
|
|
return Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Container(
|
|
decoration: AppStyle.boxDecoration1,
|
|
height: Get.height * .7,
|
|
width: double.infinity,
|
|
child: Form(
|
|
key: captainWalletController.formKeyTransfer,
|
|
child: Column(
|
|
children: [
|
|
const SizedBox(
|
|
height: 20,
|
|
),
|
|
MyTextForm(
|
|
controller: captainWalletController
|
|
.newDriverPhoneController,
|
|
label: 'phone number of driver'.tr,
|
|
hint: 'phone number of driver',
|
|
type: TextInputType.phone),
|
|
MyTextForm(
|
|
controller: captainWalletController
|
|
.amountFromBudgetController,
|
|
label: 'insert amount'.tr,
|
|
hint:
|
|
'${'You have in account'.tr} ${captainWalletController.totalAmountVisa}',
|
|
type: TextInputType.number),
|
|
captainWalletController.isNewTransfer
|
|
? const MyCircularProgressIndicator()
|
|
: captainWalletController
|
|
.amountToNewDriverMap.isEmpty
|
|
? MyElevatedButton(
|
|
title: 'Next'.tr,
|
|
onPressed: () async {
|
|
await captainWalletController
|
|
.detectNewDriverFromMyBudget();
|
|
})
|
|
: const SizedBox(),
|
|
captainWalletController.amountToNewDriverMap.isNotEmpty
|
|
? Padding(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
width: double.maxFinite,
|
|
decoration: AppStyle.boxDecoration1,
|
|
child: Text(
|
|
'Name :'.tr +
|
|
captainWalletController
|
|
.amountToNewDriverMap[0]['name']
|
|
.toString(),
|
|
textAlign: TextAlign.center,
|
|
style: AppStyle.title,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
height: 5,
|
|
),
|
|
Container(
|
|
width: double.maxFinite,
|
|
decoration: AppStyle.boxDecoration1,
|
|
child: Text(
|
|
"${"NationalID".tr} ${captainWalletController.amountToNewDriverMap[0]['national_number']}",
|
|
style: AppStyle.title,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
height: 5,
|
|
),
|
|
Container(
|
|
width: double.maxFinite,
|
|
decoration: AppStyle.boxDecoration1,
|
|
child: Text(
|
|
"${"amount".tr} ${captainWalletController.amountFromBudgetController.text} ${'LE'.tr}",
|
|
style: AppStyle.title,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
height: 15,
|
|
),
|
|
captainWalletController
|
|
.amountToNewDriverMap.isNotEmpty
|
|
? MyElevatedButton(
|
|
title: 'Transfer'.tr,
|
|
onPressed: () async {
|
|
await captainWalletController
|
|
.addTransferDriversWallet(
|
|
'TransferFrom',
|
|
'TransferTo',
|
|
);
|
|
})
|
|
: const SizedBox()
|
|
],
|
|
),
|
|
)
|
|
: const SizedBox()
|
|
],
|
|
)),
|
|
),
|
|
);
|
|
}),
|
|
],
|
|
isleading: true);
|
|
}
|
|
}
|