6/28/1
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/views/widgets/my_dialog.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -86,8 +88,13 @@ class LoginPage extends StatelessWidget {
|
||||
if (user != null) {
|
||||
box.write(BoxName.passengerID, user.uid);
|
||||
box.write(BoxName.email, user.email);
|
||||
await GoogleSignInHelper
|
||||
.signInFromLogin();
|
||||
await Get.put(LoginController())
|
||||
.loginUsingCredentials(
|
||||
box
|
||||
.read(BoxName.passengerID)
|
||||
.toString(),
|
||||
box.read(BoxName.email).toString(),
|
||||
);
|
||||
// Navigate to another screen or perform other actions
|
||||
} else {}
|
||||
},
|
||||
@@ -265,7 +272,7 @@ class LoginPage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'We use location to get accurate and nearest driver for you'
|
||||
'We use your precise location to find the nearest available driver and provide accurate pickup and dropoff information. You can manage this in Settings.'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
@@ -273,7 +280,19 @@ class LoginPage extends StatelessWidget {
|
||||
MyElevatedButton(
|
||||
title: 'Next'.tr,
|
||||
onPressed: () async {
|
||||
// if (box.read(BoxName.locationPermission) != 'true') {
|
||||
// Get.put(MyDialog()).getDialog(
|
||||
// 'Location Permission is requiered for find drivers'
|
||||
// .tr,
|
||||
// 'You can just manage your account!'.tr, () {
|
||||
// Get.back();
|
||||
// Get.to(() {
|
||||
// PassengerProfilePage();
|
||||
// });
|
||||
// });
|
||||
// } else {
|
||||
await controller.getLocationPermission();
|
||||
// }
|
||||
},
|
||||
kolor: AppColor.greenColor,
|
||||
)
|
||||
|
||||
@@ -37,7 +37,7 @@ class SearchingCaptainWindow extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
"We are searching for the nearest driver to you".tr,
|
||||
style: AppStyle.headTitle2,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
Text(
|
||||
'please wait till driver accept your order'.tr,
|
||||
@@ -192,18 +192,26 @@ Widget _buildTimer(MapPassengerController mapPassengerController) {
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: progress, // Use calculated progress
|
||||
color: AppColor.blueColor,
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
SizedBox(
|
||||
height: 35,
|
||||
width: 35,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
value: progress, // Use calculated progress
|
||||
color: AppColor.blueColor,
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Text(
|
||||
'${snapshot.data} ', // Display elapsed time
|
||||
style: AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor), // Adjust color for timer
|
||||
SizedBox(
|
||||
height: 35,
|
||||
width: 35,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${snapshot.data} ', // Display elapsed time
|
||||
style: AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor), // Adjust color for timer
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
||||
@@ -23,7 +23,7 @@ class MyElevatedButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool vibrate = box.read(BoxName.isvibrate) ?? true;
|
||||
bool vibrate = box.read(BoxName.isvibrate) ?? true;
|
||||
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
@@ -33,7 +33,7 @@ class MyElevatedButton extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
if (vibrate) {
|
||||
if (vibrate == true) {
|
||||
if (Platform.isIOS) {
|
||||
HapticFeedback.selectionClick();
|
||||
} else {
|
||||
|
||||
43
lib/views/widgets/my_dialog.dart
Normal file
43
lib/views/widgets/my_dialog.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/style.dart';
|
||||
import '../../controller/functions/tts.dart';
|
||||
import 'elevated_btn.dart';
|
||||
|
||||
class MyDialog extends GetxController {
|
||||
void getDialog(String title, String? midTitle, VoidCallback onPressed) {
|
||||
final textToSpeechController = Get.put(TextToSpeechController());
|
||||
Get.defaultDialog(
|
||||
title: title,
|
||||
titleStyle: AppStyle.title,
|
||||
middleTextStyle: AppStyle.title,
|
||||
content: Column(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
await textToSpeechController.speakText(title ?? midTitle!);
|
||||
},
|
||||
icon: const Icon(Icons.headphones)),
|
||||
Text(
|
||||
midTitle!,
|
||||
style: AppStyle.title,
|
||||
)
|
||||
],
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'Ok'.tr,
|
||||
onPressed: onPressed,
|
||||
kolor: AppColor.greenColor,
|
||||
),
|
||||
cancel: MyElevatedButton(
|
||||
title: 'Cancel',
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user