11/1/9
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:ride/constant/colors.dart';
|
||||
import 'package:ride/constant/info.dart';
|
||||
import 'package:ride/constant/style.dart';
|
||||
import 'package:ride/constant/table_names.dart';
|
||||
import 'package:ride/controller/functions/camer_controller.dart';
|
||||
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
||||
import 'package:ride/controller/home/captin/order_request_controller.dart';
|
||||
import 'package:ride/controller/home/captin/widget/left_menu_map_captain.dart';
|
||||
import 'package:ride/controller/payment/payment_controller.dart';
|
||||
import 'package:ride/main.dart';
|
||||
import 'package:ride/views/Rate/ride_calculate_driver.dart';
|
||||
@@ -19,21 +19,24 @@ import 'package:ride/views/widgets/elevated_btn.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
|
||||
import '../../../controller/functions/location_controller.dart';
|
||||
import '../../../controller/functions/ocr_controller.dart';
|
||||
import '../../../controller/home/captin/widget/connect.dart';
|
||||
import '../../widgets/mycircular.dart';
|
||||
import 'passportimage.dart';
|
||||
|
||||
class HomeCaptain extends StatelessWidget {
|
||||
const HomeCaptain({super.key});
|
||||
|
||||
HomeCaptain({super.key});
|
||||
final LocationController locationController = LocationController();
|
||||
// final HomeCaptainController homeCaptainController = HomeCaptainController();
|
||||
// final LocationController locationController=LocationController();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(LocationController());
|
||||
Get.put(OrderRequestController());
|
||||
Get.put(HomeCaptainController());
|
||||
// Get.put(HomeCaptainController());
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColor.blueColor,
|
||||
backgroundColor: AppColor.greenColor,
|
||||
elevation: 0,
|
||||
title: Text('Captain Home'.tr),
|
||||
actions: [
|
||||
GetBuilder<LocationController>(
|
||||
@@ -71,212 +74,208 @@ class HomeCaptain extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
body: Stack(
|
||||
children: [
|
||||
GetBuilder<LocationController>(
|
||||
builder: (locationController) => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${locationController.myLocation}',
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
Text(
|
||||
'${DateTime.now()}',
|
||||
style: AppStyle.subtitle,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// MyClass().exampleUsage();
|
||||
// },
|
||||
// child: Text(
|
||||
// "Text Button",
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)),
|
||||
const ConnectWidget(),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 80,
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController.totalMoneyToday,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.loop,
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
Text(
|
||||
' You Have in ${AppInformation.appName} '.tr +
|
||||
homeCaptainController.totalMoneyInSEFER,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Column(
|
||||
children: [
|
||||
Text(
|
||||
'Active Duration:'.tr +
|
||||
' ${homeCaptainController.activeDuration.inSeconds} seconds',
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
Text(
|
||||
'Total Duration:'.tr +
|
||||
' ${homeCaptainController.totalDurationToday} ',
|
||||
style: const TextStyle(fontSize: 20),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const RideCalculateDriver());
|
||||
},
|
||||
child: const Text('Chart')),
|
||||
const Wrap(
|
||||
children: <Widget>[
|
||||
Icon(AntDesign.facebook_square),
|
||||
Icon(AntDesign.wallet),
|
||||
Icon(Entypo.wallet),
|
||||
Icon(
|
||||
Entypo.google__with_circle,
|
||||
color: AppColor.redColor,
|
||||
),
|
||||
Icon(EvilIcons.camera),
|
||||
Icon(Feather.activity),
|
||||
Icon(
|
||||
FontAwesome.whatsapp,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Icon(FontAwesome5.square),
|
||||
Icon(FontAwesome5Solid.address_book),
|
||||
Icon(FontAwesome5Brands.$500px),
|
||||
Icon(Fontisto.google_play),
|
||||
Icon(Foundation.hearing_aid),
|
||||
Icon(Ionicons.logo_whatsapp),
|
||||
Icon(MaterialCommunityIcons.home_city),
|
||||
Icon(MaterialIcons.ac_unit),
|
||||
Icon(Octicons.watch),
|
||||
Icon(SimpleLineIcons.wrench),
|
||||
Icon(WeatherIcons.wi_day_sleet),
|
||||
Icon(Zocial.github),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
// TwilioSMS().sendSMS(
|
||||
// recipientPhoneNumber: '+962 7 9858 3052',
|
||||
// message: 'Hello, this is a test message.',
|
||||
// );
|
||||
},
|
||||
child: const Icon(MaterialIcons.message)),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(() => TextExtractionView());
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Text FlutterTesseractsOcr",
|
||||
// ),
|
||||
// ),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => PassportPage());
|
||||
},
|
||||
child: Text(
|
||||
'Passport '.tr,
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => PassportDataExtractorWidget());
|
||||
},
|
||||
child: Text(
|
||||
'Passport new'.tr,
|
||||
),
|
||||
),
|
||||
builder: (controller) => GoogleMap(
|
||||
onMapCreated: controller.onMapCreated,
|
||||
// cameraTargetBounds: CameraTargetBounds(controller.boundsdata),
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const TextRecognizerWidget());
|
||||
},
|
||||
child: const Text(
|
||||
"Driver License ML",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(
|
||||
() => CameraWidgetCardId(),
|
||||
);
|
||||
},
|
||||
child: const Text(
|
||||
"Text IdCamera",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(
|
||||
() => CameraWidgetPassPort(),
|
||||
);
|
||||
},
|
||||
child: const Text(
|
||||
" CameraWidgetPassPort",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => HomeScreen());
|
||||
},
|
||||
child: const Text(
|
||||
"Home Screen",
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
PaymentController().makePayment(
|
||||
14,
|
||||
'USD',
|
||||
() => Get.snackbar('Yes you pay success', '',
|
||||
backgroundColor: Colors.greenAccent));
|
||||
},
|
||||
child: const Text(
|
||||
"Pay 18 dollar",
|
||||
),
|
||||
),
|
||||
],
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: locationController.myLocation,
|
||||
zoom: 15,
|
||||
),
|
||||
|
||||
mapType: controller.mapType ? MapType.satellite : MapType.normal,
|
||||
myLocationButtonEnabled: true,
|
||||
// liteModeEnabled: true, tiltGesturesEnabled: false,
|
||||
|
||||
// indoorViewEnabled: true,
|
||||
trafficEnabled: controller.mapTrafficON,
|
||||
buildingsEnabled: true,
|
||||
mapToolbarEnabled: true,
|
||||
|
||||
myLocationEnabled: true,
|
||||
// liteModeEnabled: true,
|
||||
),
|
||||
),
|
||||
|
||||
// GetBuilder<LocationController>(
|
||||
// builder: (locationController) => Column(
|
||||
// children: [
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// '${locationController.myLocation}',
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
// Text(
|
||||
// '${DateTime.now()}',
|
||||
// style: AppStyle.subtitle,
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// // TextButton(
|
||||
// // onPressed: () {
|
||||
// // MyClass().exampleUsage();
|
||||
// // },
|
||||
// // child: Text(
|
||||
// // "Text Button",
|
||||
// // ),
|
||||
// // ),
|
||||
// ],
|
||||
// )),
|
||||
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: Get.width * .1,
|
||||
left: Get.width * .1,
|
||||
child: const ConnectWidget()),
|
||||
|
||||
Positioned(
|
||||
top: 5,
|
||||
right: Get.width * .17,
|
||||
left: Get.width * .17,
|
||||
child: GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
width: Get.width * .8,
|
||||
height: 80,
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.wallet,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
' You Earn today is '.tr +
|
||||
homeCaptainController.totalMoneyToday,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Entypo.loop,
|
||||
color: AppColor.yellowColor,
|
||||
),
|
||||
Text(
|
||||
' You Have in ${AppInformation.appName} '.tr +
|
||||
homeCaptainController.totalMoneyInSEFER,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 65,
|
||||
right: Get.width * .1,
|
||||
left: Get.width * .1,
|
||||
child: GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
'Active Duration:'.tr +
|
||||
' ${homeCaptainController.stringActiveDuration} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'Total Connection Duration:'.tr +
|
||||
' ${homeCaptainController.totalDurationToday} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: Get.height * .17,
|
||||
right: Get.width * .01,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(microseconds: 200),
|
||||
width: Get.width * .12,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(),
|
||||
borderRadius: BorderRadius.circular(15)),
|
||||
child: IconButton(
|
||||
onPressed: () {
|
||||
// Get.to(
|
||||
// () => CameraWidgetCardId(),
|
||||
// );
|
||||
},
|
||||
icon: const Icon(Fontisto.history),
|
||||
),
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(
|
||||
// () => CameraWidgetCardId(),
|
||||
// );
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Text IdCamera",
|
||||
// ),
|
||||
// ),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(
|
||||
// () => CameraWidgetPassPort(),
|
||||
// );
|
||||
// },
|
||||
// child: const Text(
|
||||
// " CameraWidgetPassPort",
|
||||
// ),
|
||||
// ),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// Get.to(() => HomeScreen());
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Home Screen",
|
||||
// ),
|
||||
// ),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.to(() => const TextRecognizerAPI());
|
||||
},
|
||||
child: const Text(
|
||||
"scan licnse",
|
||||
),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// PaymentController().makePayment(
|
||||
// 14,
|
||||
// 'USD',
|
||||
// () => Get.snackbar('Yes you pay success', '',
|
||||
// backgroundColor: Colors.greenAccent));
|
||||
// },
|
||||
// child: const Text(
|
||||
// "Pay 18 dollar",
|
||||
// ),
|
||||
// ),
|
||||
|
||||
leftMainMenuCaptainIcons(),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user