6/30/1
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
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';
|
||||
@@ -88,15 +86,17 @@ class LoginPage extends StatelessWidget {
|
||||
if (user != null) {
|
||||
box.write(BoxName.passengerID, user.uid);
|
||||
box.write(BoxName.email, user.email);
|
||||
await Get.put(LoginController())
|
||||
.loginUsingCredentials(
|
||||
await controller.loginUsingCredentials(
|
||||
box
|
||||
.read(BoxName.passengerID)
|
||||
.toString(),
|
||||
box.read(BoxName.email).toString(),
|
||||
);
|
||||
// Navigate to another screen or perform other actions
|
||||
} else {}
|
||||
} else {
|
||||
Get.snackbar('user not found'.tr, '',
|
||||
backgroundColor: AppColor.redColor);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
||||
@@ -74,51 +74,18 @@ class SmsSignupEgypt extends StatelessWidget {
|
||||
height: 10,
|
||||
),
|
||||
if (registerController.isSent)
|
||||
Obx(() => Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: registerController.remainingTime > 0
|
||||
? Column(
|
||||
children: [
|
||||
Text(
|
||||
'${(registerController.remainingTime / 60).floor()}:${(registerController.remainingTime % 60).toString().padLeft(2, '0')} remaining',
|
||||
style: AppStyle.subtitle,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
LinearProgressIndicator(
|
||||
value: registerController.remainingTime /
|
||||
300, // Assuming 300 seconds (5 minutes) total
|
||||
backgroundColor: Colors.grey[300],
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
Theme.of(context).primaryColor),
|
||||
),
|
||||
],
|
||||
)
|
||||
: TextButton(
|
||||
onPressed: () =>
|
||||
registerController.sendOtpMessage(),
|
||||
child: Text('Resend code'.tr),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height:
|
||||
16), // Add some space after the timer or button
|
||||
],
|
||||
)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: registerController.isSent
|
||||
? Form(
|
||||
key: registerController.formKey3,
|
||||
child: MyTextForm(
|
||||
controller: registerController.verifyCode,
|
||||
label: '5 digit'.tr,
|
||||
hint: '5 digit'.tr,
|
||||
type: TextInputType.number),
|
||||
)
|
||||
: const SizedBox()),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: registerController.isSent
|
||||
? Form(
|
||||
key: registerController.formKey3,
|
||||
child: MyTextForm(
|
||||
controller: registerController.verifyCode,
|
||||
label: '5 digit'.tr,
|
||||
hint: '5 digit'.tr,
|
||||
type: TextInputType.number),
|
||||
)
|
||||
: const SizedBox()),
|
||||
// Submit button
|
||||
MyElevatedButton(
|
||||
onPressed: () async {
|
||||
@@ -132,7 +99,7 @@ class SmsSignupEgypt extends StatelessWidget {
|
||||
);
|
||||
}),
|
||||
],
|
||||
isleading: true,
|
||||
isleading: false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user