5/11/1
This commit is contained in:
@@ -18,14 +18,13 @@ import '../../widgets/mycircular.dart';
|
||||
import 'register_captin.dart';
|
||||
|
||||
class LoginCaptin extends StatelessWidget {
|
||||
// final controller = Get.put(LoginController());
|
||||
final controller = Get.put(LoginCaptinController());
|
||||
|
||||
LoginCaptin({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(LoginCaptinController());
|
||||
final controller = Get.put(LoginController());
|
||||
// Get.put(LoginCaptinController());
|
||||
return GetBuilder<LoginCaptinController>(
|
||||
builder: (controller) => MyScafolld(
|
||||
title: 'Login Driver'.tr,
|
||||
@@ -35,6 +34,8 @@ class LoginCaptin extends StatelessWidget {
|
||||
agreedPage()
|
||||
else if (box.read(BoxName.countryCode) == null)
|
||||
CountryPicker()
|
||||
else if (box.read(BoxName.locationPermission) != 'true')
|
||||
locationPermissionDialog()
|
||||
else
|
||||
SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -155,21 +156,17 @@ class LoginCaptin extends StatelessWidget {
|
||||
return null;
|
||||
},
|
||||
),
|
||||
GetBuilder<LoginCaptinController>(
|
||||
builder: (controller) => controller
|
||||
.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (controller
|
||||
.formKey.currentState!
|
||||
.validate()) {
|
||||
controller.login();
|
||||
}
|
||||
},
|
||||
title: 'Submit'.tr,
|
||||
),
|
||||
)
|
||||
controller.isloading
|
||||
? const MyCircularProgressIndicator()
|
||||
: MyElevatedButton(
|
||||
onPressed: () {
|
||||
if (controller.formKey.currentState!
|
||||
.validate()) {
|
||||
controller.login();
|
||||
}
|
||||
},
|
||||
title: 'Submit'.tr,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -314,4 +311,38 @@ class LoginCaptin extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
locationPermissionDialog() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Container(
|
||||
height: Get.height * .4,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'We use location to get accurate and nearest passengers for you'
|
||||
.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Grant Location'.tr,
|
||||
onPressed: () async {
|
||||
await controller.getLocationPermission();
|
||||
},
|
||||
kolor: AppColor.greenColor,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user