This commit is contained in:
Hamza-Ayed
2024-09-21 01:37:03 +03:00
parent 9022941e18
commit 7fbfefdcb2
14 changed files with 1920 additions and 247 deletions

View File

@@ -8,12 +8,15 @@ import 'package:sefer_admin1/controller/admin/static_controller.dart';
import 'package:sefer_admin1/controller/notification_controller.dart';
import 'package:sefer_admin1/views/admin/captain/drivers_cant_registe.dart';
import 'package:sefer_admin1/views/admin/captain/register_captain.dart';
import 'package:sefer_admin1/views/widgets/elevated_btn.dart';
import 'package:sefer_admin1/views/widgets/my_textField.dart';
import 'package:sefer_admin1/views/widgets/mycircular.dart';
import '../../constant/links.dart';
import '../../constant/style.dart';
import '../../controller/functions/crud.dart';
import '../../controller/functions/gemeni.dart';
import '../../print.dart';
import '../widgets/my_scafold.dart';
import 'captain/captain.dart';
import 'passenger/passenger.dart';
@@ -339,12 +342,63 @@ class AdminHomePage extends StatelessWidget {
Get.to(() => const StaticDash());
},
),
AdminWidgetsDashBoard(
title: 'send Whatsapp to Drivers',
onPressed: () async {
Get.defaultDialog(
title: 'Are you sure to send by WhatsApp ?',
middleText: '',
confirm: MyElevatedButton(
title: 'Ok',
kolor: AppColor.greenColor,
onPressed: () async {
Log.print(
'CRUD().phoneDriversTest.: ${CRUD().phoneDriversTest}');
for (var phoneNumber
in CRUD().phoneDrivers) {
await CRUD().sendWhatsAppAuth(
phoneNumber.toString());
}
}),
cancel: MyElevatedButton(
title: 'cancel',
kolor: AppColor.redColor,
onPressed: () => Get.back()));
}),
AdminWidgetsDashBoard(
title: 'send notification Drivers',
onPressed: () async {
await Get.put(NotificationController())
.getTokensDrivers();
}),
AdminWidgetsDashBoard(
title: 'send SMS Drivers',
onPressed: () async {
Get.defaultDialog(
title: 'Are you sure to send SMS ?',
middleText: '',
content: Padding(
padding: const EdgeInsets.all(8.0),
child: Form(
key: dashboardController.formKey,
child: MyTextForm(
controller:
dashboardController.smsText,
label: 'label',
hint: 'hint',
type: TextInputType.name)),
),
confirm: MyElevatedButton(
title: 'Ok',
kolor: AppColor.greenColor,
onPressed: () async {
dashboardController.sendSMSMethod();
}),
cancel: MyElevatedButton(
title: 'cancel',
kolor: AppColor.redColor,
onPressed: () => Get.back()));
}),
AdminWidgetsDashBoard(
title: 'send notification Passengers',
onPressed: () async {