This commit is contained in:
Hamza-Ayed
2024-06-28 19:10:34 +03:00
parent 929ecf39f9
commit 08d31bc4d1
67 changed files with 159 additions and 58 deletions

View File

@@ -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,
)