feat: refactor financial wallet UI components and add offline map service support
This commit is contained in:
@@ -1,83 +1,83 @@
|
||||
import 'package:camera/camera.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
|
||||
// import 'package:camera/camera.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:sefer_driver/views/widgets/elevated_btn.dart';
|
||||
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/functions/camer_controller.dart';
|
||||
import '../../../../controller/functions/ocr_controller.dart';
|
||||
import '../../../widgets/my_scafold.dart';
|
||||
// import '../../../../constant/colors.dart';
|
||||
// import '../../../../constant/style.dart';
|
||||
// import '../../../../controller/functions/camer_controller.dart';
|
||||
// import '../../../../controller/functions/ocr_controller.dart';
|
||||
// import '../../../widgets/my_scafold.dart';
|
||||
|
||||
class CameraLisencePage extends StatelessWidget {
|
||||
CameraLisencePage.CameraLicensePage({super.key});
|
||||
final CameraClassController cameraClassController =
|
||||
Get.put(CameraClassController());
|
||||
// class CameraLisencePage extends StatelessWidget {
|
||||
// CameraLisencePage.CameraLicensePage({super.key});
|
||||
// final CameraClassController cameraClassController =
|
||||
// Get.put(CameraClassController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MyScafolld(
|
||||
title: 'Scan Driver License'.tr,
|
||||
body: [
|
||||
Column(children: [
|
||||
Text(
|
||||
'Please put your licence in these border'.tr,
|
||||
style: AppStyle.title.copyWith(color: AppColor.greenColor),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
child: GetBuilder<CameraClassController>(
|
||||
builder: (cameraClassController) =>
|
||||
cameraClassController.isCameraInitialized
|
||||
? Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
child: CameraPreview(
|
||||
cameraClassController.cameraController,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: Get.height * .1,
|
||||
right: 5,
|
||||
left: 5,
|
||||
child: Container(
|
||||
height: Get.width * 3 / 4,
|
||||
width: Get.width * .9,
|
||||
decoration: BoxDecoration(
|
||||
// color: AppColor.blueColor,
|
||||
border: Border.all(
|
||||
color: AppColor.yellowColor, width: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container(
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: Get.width * 3 / 4,
|
||||
width: Get.width,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Camera not initialized yet',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
MyElevatedButton(
|
||||
title: 'Take Image'.tr,
|
||||
onPressed: () {
|
||||
ScanDocumentsByApi().scanDocumentsByApi();
|
||||
},
|
||||
)
|
||||
]),
|
||||
],
|
||||
isleading: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return MyScafolld(
|
||||
// title: 'Scan Driver License'.tr,
|
||||
// body: [
|
||||
// Column(children: [
|
||||
// Text(
|
||||
// 'Please put your licence in these border'.tr,
|
||||
// style: AppStyle.title.copyWith(color: AppColor.greenColor),
|
||||
// ),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||
// child: GetBuilder<CameraClassController>(
|
||||
// builder: (cameraClassController) =>
|
||||
// cameraClassController.isCameraInitialized
|
||||
// ? Stack(
|
||||
// children: [
|
||||
// Container(
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// child: CameraPreview(
|
||||
// cameraClassController.cameraController,
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// top: Get.height * .1,
|
||||
// right: 5,
|
||||
// left: 5,
|
||||
// child: Container(
|
||||
// height: Get.width * 3 / 4,
|
||||
// width: Get.width * .9,
|
||||
// decoration: BoxDecoration(
|
||||
// // color: AppColor.blueColor,
|
||||
// border: Border.all(
|
||||
// color: AppColor.yellowColor, width: 2),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// )
|
||||
// : Container(
|
||||
// decoration: AppStyle.boxDecoration,
|
||||
// height: Get.width * 3 / 4,
|
||||
// width: Get.width,
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// 'Camera not initialized yet',
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 20,
|
||||
// ),
|
||||
// MyElevatedButton(
|
||||
// title: 'Take Image'.tr,
|
||||
// onPressed: () {
|
||||
// ScanDocumentsByApi().scanDocumentsByApi();
|
||||
// },
|
||||
// )
|
||||
// ]),
|
||||
// ],
|
||||
// isleading: true,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -61,7 +61,7 @@ class _LoginCaptinState extends State<LoginCaptin> with WidgetsBindingObserver {
|
||||
return GetBuilder<LoginDriverController>(
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.secondaryColor,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: _buildBodyContent(context, controller),
|
||||
@@ -72,6 +72,7 @@ class _LoginCaptinState extends State<LoginCaptin> with WidgetsBindingObserver {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget _buildBodyContent(
|
||||
BuildContext context, LoginDriverController controller) {
|
||||
// 1. صفحة الموافقة على الشروط
|
||||
@@ -130,17 +131,22 @@ class _LoginCaptinState extends State<LoginCaptin> with WidgetsBindingObserver {
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
border: Border.all(color: Theme.of(context).dividerColor),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
color: Theme.of(context).cardColor.withOpacity(0.5),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: HtmlWidget(box.read(BoxName.lang).toString() == 'ar'
|
||||
? AppInformation.privacyPolicyArabic
|
||||
: AppInformation.privacyPolicy),
|
||||
child: HtmlWidget(
|
||||
box.read(BoxName.lang).toString() == 'ar'
|
||||
? AppInformation.privacyPolicyArabic
|
||||
: AppInformation.privacyPolicy,
|
||||
textStyle: TextStyle(color: Theme.of(context).textTheme.bodyLarge?.color),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
CheckboxListTile(
|
||||
title: Text('I Agree'.tr, style: AppStyle.title),
|
||||
value: controller.isAgreeTerms,
|
||||
@@ -324,14 +330,15 @@ class _LoginCaptinState extends State<LoginCaptin> with WidgetsBindingObserver {
|
||||
const SizedBox(height: 24),
|
||||
Row(
|
||||
children: [
|
||||
const Expanded(child: Divider()),
|
||||
Expanded(child: Divider(color: Theme.of(context).dividerColor)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Text('Or'.tr, style: AppStyle.subtitle),
|
||||
),
|
||||
const Expanded(child: Divider()),
|
||||
Expanded(child: Divider(color: Theme.of(context).dividerColor)),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
MyElevatedButton(
|
||||
title: 'Create Account with Email'.tr,
|
||||
@@ -457,19 +464,29 @@ class _LoginCaptinState extends State<LoginCaptin> with WidgetsBindingObserver {
|
||||
validator: validator,
|
||||
obscureText: obscureText,
|
||||
keyboardType: keyboardType,
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
decoration: InputDecoration(
|
||||
labelText: labelText,
|
||||
labelStyle: TextStyle(color: Theme.of(context).hintColor),
|
||||
hintText: hintText,
|
||||
hintStyle: TextStyle(color: Theme.of(context).hintColor.withOpacity(0.5)),
|
||||
prefixIcon: Icon(prefixIcon, color: AppColor.primaryColor),
|
||||
suffixIcon: suffixIcon,
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12.0)),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide: BorderSide(color: Theme.of(context).dividerColor),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide: BorderSide(color: Theme.of(context).dividerColor),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide:
|
||||
const BorderSide(color: AppColor.primaryColor, width: 2.0),
|
||||
borderSide: const BorderSide(color: AppColor.primaryColor, width: 2.0),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
Widget _buildSocialButton({
|
||||
|
||||
@@ -23,10 +23,10 @@ class RegisterPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
decoration: BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
offset: Offset(3, 3),
|
||||
offset: const Offset(3, 3),
|
||||
color: AppColor.accentColor,
|
||||
blurRadius: 3)
|
||||
],
|
||||
@@ -45,7 +45,7 @@ class RegisterPage extends StatelessWidget {
|
||||
controller: controller.firstNameController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
@@ -54,7 +54,7 @@ class RegisterPage extends StatelessWidget {
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'First name'.tr,
|
||||
@@ -75,7 +75,7 @@ class RegisterPage extends StatelessWidget {
|
||||
controller: controller.lastNameController,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: const BorderSide(
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.primaryColor,
|
||||
width: 2.0,
|
||||
),
|
||||
@@ -83,7 +83,7 @@ class RegisterPage extends StatelessWidget {
|
||||
),
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Last name'.tr,
|
||||
@@ -116,7 +116,7 @@ class RegisterPage extends StatelessWidget {
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Email'.tr,
|
||||
@@ -149,7 +149,7 @@ class RegisterPage extends StatelessWidget {
|
||||
fillColor: AppColor.accentColor,
|
||||
hoverColor: AppColor.accentColor,
|
||||
focusColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius:
|
||||
BorderRadius.all(Radius.circular(12))),
|
||||
labelText: 'Password'.tr,
|
||||
@@ -188,7 +188,7 @@ class RegisterPage extends StatelessWidget {
|
||||
),
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'Phone'.tr,
|
||||
@@ -217,7 +217,7 @@ class RegisterPage extends StatelessWidget {
|
||||
),
|
||||
focusColor: AppColor.accentColor,
|
||||
fillColor: AppColor.accentColor,
|
||||
border: const OutlineInputBorder(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(12))),
|
||||
labelText: 'City'.tr,
|
||||
|
||||
Reference in New Issue
Block a user