first commit

This commit is contained in:
Hamza-Ayed
2024-06-22 16:34:02 +03:00
commit 0a71a194b9
205 changed files with 17401 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sefer_admin1/constant/style.dart';
import 'package:sefer_admin1/views/widgets/elevated_btn.dart';
import 'package:sefer_admin1/views/widgets/mycircular.dart';
import '../../../controller/admin/wallet_admin_controller.dart';
import '../../widgets/my_scafold.dart';
class Wallet extends StatelessWidget {
Wallet({super.key});
WalletAdminController walletAdminController =
Get.put(WalletAdminController());
@override
Widget build(BuildContext context) {
return MyScafolld(
title: 'Wallet'.tr,
body: [
GetBuilder<WalletAdminController>(builder: (walletAdminController) {
return Center(
child: walletAdminController.isLoading
? const MyCircularProgressIndicator()
: Column(
children: [
MyElevatedButton(
title: 'Pay to them to banks'.tr,
onPressed: () async {
await walletAdminController.payToBankDriverAll();
}),
SizedBox(
height: Get.height * .8,
child: ListView.builder(
itemCount:
walletAdminController.driversWalletPoints.length,
itemBuilder: (BuildContext context, int index) {
var res = walletAdminController
.driversWalletPoints[index];
if (res != null && res['name_arabic'] != null) {
return Padding(
padding: const EdgeInsets.all(4.0),
child: Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'driver name: ${res['name_arabic'].toString()}'),
Text(
'Amount: ${res['total_amount'].toString()}'),
],
),
),
),
);
} else {
return Container(); // Return an empty container if the data is null
}
},
),
)
],
),
);
})
],
isleading: true,
action: IconButton(
onPressed: () async {
walletAdminController.getWalletForEachDriverToPay();
},
icon: const Icon(
Icons.refresh,
color: Colors.black,
),
),
);
}
}