11/1/1
This commit is contained in:
BIN
assets/images/on1.png
Normal file
BIN
assets/images/on1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
BIN
assets/images/on2.png
Normal file
BIN
assets/images/on2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
BIN
assets/images/on3.png
Normal file
BIN
assets/images/on3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
@@ -34,11 +34,11 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2</string>
|
<string>4</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.01</string>
|
<string>1.04</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
|
|||||||
@@ -29,4 +29,5 @@ class BoxName {
|
|||||||
static const String passengerWalletTotal = "passengerWalletTotal";
|
static const String passengerWalletTotal = "passengerWalletTotal";
|
||||||
static const String passengerWalletFound = "passengerWalletFound";
|
static const String passengerWalletFound = "passengerWalletFound";
|
||||||
static const String periods = 'periods';
|
static const String periods = 'periods';
|
||||||
|
static const String onBoarding = 'onBoarding';
|
||||||
}
|
}
|
||||||
|
|||||||
46
lib/controller/auth/onboarding_controller.dart
Normal file
46
lib/controller/auth/onboarding_controller.dart
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/constant/box_name.dart';
|
||||||
|
import 'package:ride/main.dart';
|
||||||
|
import 'package:ride/views/auth/login_page.dart';
|
||||||
|
import 'package:ride/views/home/home_page.dart';
|
||||||
|
|
||||||
|
import '../../models/model/onboarding_model.dart';
|
||||||
|
|
||||||
|
class OnboardingController extends GetxController {}
|
||||||
|
|
||||||
|
abstract class OnBoardingController extends GetxController {
|
||||||
|
next();
|
||||||
|
onPageChanged(int index);
|
||||||
|
}
|
||||||
|
|
||||||
|
class OnBoardingControllerImp extends OnBoardingController {
|
||||||
|
late PageController pageController;
|
||||||
|
|
||||||
|
int currentPage = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
next() {
|
||||||
|
currentPage++;
|
||||||
|
|
||||||
|
if (currentPage > onBoardingList.length - 1) {
|
||||||
|
box.write(BoxName.onBoarding, 'yes');
|
||||||
|
Get.offAll(LoginPage());
|
||||||
|
} else {
|
||||||
|
pageController.animateToPage(currentPage,
|
||||||
|
duration: const Duration(milliseconds: 900), curve: Curves.easeInOut);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
onPageChanged(int index) {
|
||||||
|
currentPage = index;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
pageController = PageController();
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,10 +6,12 @@ import 'package:flutter_tesseract_ocr/flutter_tesseract_ocr.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
|
import 'package:google_mlkit_text_recognition/google_mlkit_text_recognition.dart';
|
||||||
import 'package:ride/constant/box_name.dart';
|
import 'package:ride/constant/box_name.dart';
|
||||||
|
import 'package:ride/constant/credential.dart';
|
||||||
|
import 'package:ride/constant/links.dart';
|
||||||
import 'package:ride/views/widgets/elevated_btn.dart';
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
import 'package:path_provider/path_provider.dart' as path_provider;
|
import 'package:path_provider/path_provider.dart' as path_provider;
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
import '../../main.dart';
|
import '../../main.dart';
|
||||||
|
|
||||||
class CameraClassController extends GetxController {
|
class CameraClassController extends GetxController {
|
||||||
@@ -32,7 +34,7 @@ class CameraClassController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
cameraController = CameraController(
|
cameraController = CameraController(
|
||||||
cameras[0],
|
cameras[0],
|
||||||
ResolutionPreset.max,
|
ResolutionPreset.medium,
|
||||||
enableAudio: false,
|
enableAudio: false,
|
||||||
);
|
);
|
||||||
await cameraController.initialize();
|
await cameraController.initialize();
|
||||||
@@ -57,6 +59,76 @@ class CameraClassController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var imgUrl = '';
|
||||||
|
Future extractCardId() async {
|
||||||
|
// Construct the path for the image file
|
||||||
|
final directory = await path_provider.getTemporaryDirectory();
|
||||||
|
final imagePath =
|
||||||
|
path.join(directory.path, '${box.read(BoxName.driverID)}.png');
|
||||||
|
|
||||||
|
// Capture the image and save it to the specified path
|
||||||
|
final XFile capturedImage = await cameraController.takePicture();
|
||||||
|
|
||||||
|
// Move the captured image to the desired path
|
||||||
|
await capturedImage.saveTo(imagePath);
|
||||||
|
await uploadImage(File(capturedImage.path));
|
||||||
|
|
||||||
|
extractByAPI(AppLink.server + '/card_image/' + box.read(BoxName.driverID));
|
||||||
|
}
|
||||||
|
|
||||||
|
Future extractByAPI(String imgUrl) async {
|
||||||
|
var headers = {'apikey': 'K89368168788957'};
|
||||||
|
var request = http.MultipartRequest(
|
||||||
|
'POST', Uri.parse('https://api.ocr.space/parse/image'));
|
||||||
|
request.fields.addAll({
|
||||||
|
'language': 'ara',
|
||||||
|
'isOverlayRequired': 'false',
|
||||||
|
'url': imgUrl,
|
||||||
|
'iscreatesearchablepdf': 'false',
|
||||||
|
'issearchablepdfhidetextlayer': 'false'
|
||||||
|
});
|
||||||
|
|
||||||
|
request.headers.addAll(headers);
|
||||||
|
|
||||||
|
http.StreamedResponse response = await request.send();
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
print(await response.stream.bytesToString());
|
||||||
|
} else {
|
||||||
|
print(response.reasonPhrase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> uploadImage(File imageFile) async {
|
||||||
|
var request = http.MultipartRequest(
|
||||||
|
'POST',
|
||||||
|
Uri.parse(AppLink.uploadImage),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Attach the image file to the request
|
||||||
|
request.files.add(
|
||||||
|
await http.MultipartFile.fromPath('image', imageFile.path),
|
||||||
|
); // Add the headers to the request
|
||||||
|
request.headers.addAll({
|
||||||
|
// "Content-Type": "application/x-www-form-urlencoded",
|
||||||
|
'Authorization':
|
||||||
|
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add the driverID to the request
|
||||||
|
request.fields['driverID'] = box.read(BoxName.driverID);
|
||||||
|
// Send the request
|
||||||
|
var response = await request.send();
|
||||||
|
|
||||||
|
// Read the response
|
||||||
|
var responseData = await response.stream.toBytes();
|
||||||
|
var responseString = String.fromCharCodes(responseData);
|
||||||
|
scannedText = responseString;
|
||||||
|
update();
|
||||||
|
// Return the link received from the server
|
||||||
|
return responseString;
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> takePictureAndMLGoogleScan() async {
|
Future<void> takePictureAndMLGoogleScan() async {
|
||||||
try {
|
try {
|
||||||
// Construct the path for the image file
|
// Construct the path for the image file
|
||||||
|
|||||||
@@ -179,7 +179,15 @@ class MyTranslation extends Translations {
|
|||||||
"Type something...": "اكتب شيئا ما...",
|
"Type something...": "اكتب شيئا ما...",
|
||||||
"Submit rating": "إرسال التقييم",
|
"Submit rating": "إرسال التقييم",
|
||||||
"Rate Passenger": "تقييم الراكب",
|
"Rate Passenger": "تقييم الراكب",
|
||||||
"Ride Summary": "ملخص الرحلة"
|
"Ride Summary": "ملخص الرحلة",
|
||||||
|
"welcome_message": "مرحبا بك في سفر!",
|
||||||
|
"app_description":
|
||||||
|
"سفر هو تطبيق تطبيقات مشاركة الركوب الآمن والموثوق ويمكن الوصول إليه.",
|
||||||
|
"get_to_destination": "اذهب إلى وجهتك بسرعة وسهولة.",
|
||||||
|
"get_a_ride": "مع سفر، يمكنك الحصول على رحلة إلى وجهتك في دقائق.",
|
||||||
|
"safe_and_comfortable": "استمتع برحلة آمنة ومريحة.",
|
||||||
|
"committed_to_safety":
|
||||||
|
"تلتزم سفر بالسلامة، ويتم فحص جميع قباطننا بعناية وفحص خلفيتهم."
|
||||||
|
|
||||||
///
|
///
|
||||||
// 'Saved Sucssefully':
|
// 'Saved Sucssefully':
|
||||||
@@ -363,7 +371,18 @@ class MyTranslation extends Translations {
|
|||||||
"Type something...": "Bir şeyler yazın...",
|
"Type something...": "Bir şeyler yazın...",
|
||||||
"Submit rating": "Değerlendirmeyi gönder",
|
"Submit rating": "Değerlendirmeyi gönder",
|
||||||
"Rate Passenger": "Yolcularınızı değerlendirin",
|
"Rate Passenger": "Yolcularınızı değerlendirin",
|
||||||
"Ride Summary": "Seyahat özeti"
|
"Ride Summary": "Seyahat özeti",
|
||||||
|
"welcome_message": "Sefer'e hoş geldiniz!",
|
||||||
|
"app_description":
|
||||||
|
"Sefer, güvenli, güvenilir ve erişilebilir bir araç paylaşım uygulamasıdır.",
|
||||||
|
"get_to_destination":
|
||||||
|
"Hedef noktanıza hızlı ve kolay bir şekilde ulaşın.",
|
||||||
|
"get_a_ride":
|
||||||
|
"Sefer ile dakikalar içinde varış noktanıza bir yolculuk alabilirsiniz.",
|
||||||
|
"safe_and_comfortable":
|
||||||
|
"Güvenli ve konforlu bir yolculuğun tadını çıkarın.",
|
||||||
|
"committed_to_safety":
|
||||||
|
"Sefer, güvenliğe bağlıdır ve tüm kaptanlarımız dikkatle seçilir ve sicil sorgusu yapılır."
|
||||||
},
|
},
|
||||||
"en": {
|
"en": {
|
||||||
"Choose Language": "Choose Language",
|
"Choose Language": "Choose Language",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import 'controller/local/local_controller.dart';
|
|||||||
import 'controller/local/translations.dart';
|
import 'controller/local/translations.dart';
|
||||||
import 'firebase_options.dart';
|
import 'firebase_options.dart';
|
||||||
import 'models/db_sql.dart';
|
import 'models/db_sql.dart';
|
||||||
|
import 'onbording_page.dart';
|
||||||
import 'views/home/map_page.dart';
|
import 'views/home/map_page.dart';
|
||||||
|
|
||||||
final box = GetStorage();
|
final box = GetStorage();
|
||||||
@@ -42,7 +43,6 @@ void main() async {
|
|||||||
);
|
);
|
||||||
await FirebaseMessagesController().requestFirebaseMessagingPermission();
|
await FirebaseMessagesController().requestFirebaseMessagingPermission();
|
||||||
|
|
||||||
await FirebaseMessagesController().getToken();
|
|
||||||
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
|
||||||
|
|
||||||
List<Future> initializationTasks = [
|
List<Future> initializationTasks = [
|
||||||
@@ -69,19 +69,22 @@ class MyApp extends StatelessWidget {
|
|||||||
LocaleController controller = Get.put(LocaleController());
|
LocaleController controller = Get.put(LocaleController());
|
||||||
|
|
||||||
return GetMaterialApp(
|
return GetMaterialApp(
|
||||||
title: AppInformation.appName,
|
title: AppInformation.appName,
|
||||||
translations: MyTranslation(),
|
translations: MyTranslation(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
locale: controller.language,
|
locale: controller.language,
|
||||||
theme: controller.appTheme,
|
theme: controller.appTheme,
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
// routes: {'/':const HomePage()},
|
// routes: {'/':const HomePage()},
|
||||||
home: box.read(BoxName.email) != null
|
home: box.read(BoxName.onBoarding) == null
|
||||||
? const MapPage()
|
? OnBoardingPage()
|
||||||
: box.read(BoxName.emailDriver) == null
|
: box.read(BoxName.email) != null
|
||||||
? LoginPage()
|
? const MapPage()
|
||||||
: box.read(BoxName.emailDriver) != null
|
: box.read(BoxName.emailDriver) == null
|
||||||
? const HomeCaptain()
|
? LoginPage()
|
||||||
: LoginCaptin());
|
: box.read(BoxName.emailDriver) != null
|
||||||
|
? const HomeCaptain()
|
||||||
|
: LoginCaptin(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
lib/models/model/onboarding_model.dart
Normal file
30
lib/models/model/onboarding_model.dart
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
List<OnBoardingModel> onBoardingList = [
|
||||||
|
OnBoardingModel(
|
||||||
|
title: 'Welcome to Sefer!'.tr,
|
||||||
|
image: 'assets/images/on1.png',
|
||||||
|
body:
|
||||||
|
'Sefer is the ride-hailing app that is safe, reliable, and accessible.'
|
||||||
|
.tr,
|
||||||
|
),
|
||||||
|
OnBoardingModel(
|
||||||
|
title: 'Get to your destination quickly and easily.'.tr,
|
||||||
|
image: 'assets/images/on2.png',
|
||||||
|
body: 'With Sefer, you can get a ride to your destination in minutes.'.tr,
|
||||||
|
),
|
||||||
|
OnBoardingModel(
|
||||||
|
title: 'Enjoy a safe and comfortable ride.'.tr,
|
||||||
|
image: 'assets/images/on3.png',
|
||||||
|
body:
|
||||||
|
'Sefer is committed to safety, and all of our captains are carefully screened and background checked.'
|
||||||
|
.tr,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
class OnBoardingModel {
|
||||||
|
final String? title;
|
||||||
|
final String? image;
|
||||||
|
final String? body;
|
||||||
|
OnBoardingModel({this.body, this.title, this.image});
|
||||||
|
}
|
||||||
104
lib/onbording_page.dart
Normal file
104
lib/onbording_page.dart
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:ride/views/widgets/elevated_btn.dart';
|
||||||
|
|
||||||
|
import 'constant/colors.dart';
|
||||||
|
import 'controller/auth/onboarding_controller.dart';
|
||||||
|
import 'models/model/onboarding_model.dart';
|
||||||
|
|
||||||
|
class OnBoardingPage extends StatelessWidget {
|
||||||
|
OnBoardingControllerImp onBoardingControllerImp =
|
||||||
|
Get.put(OnBoardingControllerImp());
|
||||||
|
|
||||||
|
OnBoardingPage({super.key});
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColor.secondaryColor,
|
||||||
|
body: SafeArea(
|
||||||
|
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||||
|
SizedBox(
|
||||||
|
child: const CustomSliderOnBoarding(),
|
||||||
|
height: Get.height * .7,
|
||||||
|
),
|
||||||
|
const CustomDotControllerOnBoarding(),
|
||||||
|
// const Spacer(flex: 2),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
MyElevatedButton(
|
||||||
|
onPressed: () => onBoardingControllerImp.next(),
|
||||||
|
title: 'Next'.tr,
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CustomSliderOnBoarding extends GetView<OnBoardingControllerImp> {
|
||||||
|
const CustomSliderOnBoarding({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return PageView.builder(
|
||||||
|
controller: controller.pageController,
|
||||||
|
onPageChanged: (val) {
|
||||||
|
controller.onPageChanged(val);
|
||||||
|
},
|
||||||
|
itemCount: onBoardingList.length,
|
||||||
|
itemBuilder: (context, i) => Column(
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
onBoardingList[i].image!,
|
||||||
|
// width: ,
|
||||||
|
height: Get.width / 1.3,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 60),
|
||||||
|
Text(onBoardingList[i].title!,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 22,
|
||||||
|
color: AppColor.primaryColor)),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Container(
|
||||||
|
width: Get.width * .8,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
onBoardingList[i].body!,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
height: 2,
|
||||||
|
color: AppColor.accentColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14),
|
||||||
|
)),
|
||||||
|
// const SizedBox(height: 20),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CustomDotControllerOnBoarding extends StatelessWidget {
|
||||||
|
const CustomDotControllerOnBoarding({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<OnBoardingControllerImp>(
|
||||||
|
builder: (controller) => Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
...List.generate(
|
||||||
|
onBoardingList.length,
|
||||||
|
(index) => AnimatedContainer(
|
||||||
|
margin: const EdgeInsets.only(right: 5),
|
||||||
|
duration: const Duration(milliseconds: 900),
|
||||||
|
width: controller.currentPage == index ? 20 : 5,
|
||||||
|
height: 6,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
borderRadius: BorderRadius.circular(10)),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,146 +24,151 @@ class CameraWidgetCardId extends StatelessWidget {
|
|||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
|
||||||
child: GetBuilder<CameraClassController>(
|
child: GetBuilder<CameraClassController>(
|
||||||
builder: (cameraClassController) =>
|
builder: (cameraClassController) => cameraClassController
|
||||||
cameraClassController.isCameraInitialized
|
.isCameraInitialized
|
||||||
? Stack(
|
? Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: AppStyle.boxDecoration,
|
|
||||||
height: Get.height * .3,
|
|
||||||
width: Get.width,
|
|
||||||
child:
|
|
||||||
// Image.asset(
|
|
||||||
// 'assets/images/cardid.jpg',
|
|
||||||
// fit: BoxFit.cover,
|
|
||||||
// )
|
|
||||||
CameraPreview(
|
|
||||||
cameraClassController.cameraController,
|
|
||||||
// child: IconButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// cameraClassController.takePicture();
|
|
||||||
// },
|
|
||||||
// icon: const Icon(Icons.camera),
|
|
||||||
// ),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 50,
|
|
||||||
child: Container(
|
|
||||||
width: 230,
|
|
||||||
height: 25,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.yellowColor,
|
|
||||||
width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 38,
|
|
||||||
right: 5,
|
|
||||||
child: Container(
|
|
||||||
width: 230,
|
|
||||||
height: 25,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.blueColor, width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 130,
|
|
||||||
right: 5,
|
|
||||||
child: Container(
|
|
||||||
width: 140,
|
|
||||||
height: 20,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.blueColor, width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 148,
|
|
||||||
right: 5,
|
|
||||||
child: Container(
|
|
||||||
width: 140,
|
|
||||||
height: 15,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.blueColor, width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 165,
|
|
||||||
right: 5,
|
|
||||||
child: Container(
|
|
||||||
width: 140,
|
|
||||||
height: 15,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.blueColor, width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 182,
|
|
||||||
right: 5,
|
|
||||||
child: Container(
|
|
||||||
width: 140,
|
|
||||||
height: 15,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.blueColor, width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 198,
|
|
||||||
right: 5,
|
|
||||||
child: Container(
|
|
||||||
width: 140,
|
|
||||||
height: 15,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.blueColor, width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
top: 80,
|
|
||||||
left: 35,
|
|
||||||
child: Container(
|
|
||||||
width: 120,
|
|
||||||
height: 110,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
// color: AppColor.blueColor,
|
|
||||||
border: Border.all(
|
|
||||||
color: AppColor.blueColor, width: 2),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Container(
|
|
||||||
decoration: AppStyle.boxDecoration,
|
decoration: AppStyle.boxDecoration,
|
||||||
height: Get.height * .3,
|
height: Get.width * 3 / 4,
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
child: Center(
|
child: OverflowBox(
|
||||||
child: Text(
|
alignment: Alignment.center,
|
||||||
'Camera not initilaized yet',
|
child: FittedBox(
|
||||||
style: AppStyle.title,
|
fit: BoxFit.fitWidth,
|
||||||
|
child: SizedBox(
|
||||||
|
width: Get.width,
|
||||||
|
height: Get.width *
|
||||||
|
3 /
|
||||||
|
4, // Set the desired aspect ratio here
|
||||||
|
child:
|
||||||
|
// Image.asset(
|
||||||
|
// 'assets/images/cardid.jpg',
|
||||||
|
// fit: BoxFit.fill,
|
||||||
|
// )
|
||||||
|
CameraPreview(
|
||||||
|
cameraClassController.cameraController,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 72,
|
||||||
|
child: Container(
|
||||||
|
width: 230,
|
||||||
|
height: 25,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.yellowColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 60,
|
||||||
|
right: 5,
|
||||||
|
child: Container(
|
||||||
|
width: 230,
|
||||||
|
height: 25,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.blueColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 156,
|
||||||
|
right: 5,
|
||||||
|
child: Container(
|
||||||
|
width: 140,
|
||||||
|
height: 20,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.blueColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 175,
|
||||||
|
right: 5,
|
||||||
|
child: Container(
|
||||||
|
width: 140,
|
||||||
|
height: 15,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.blueColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 191,
|
||||||
|
right: 5,
|
||||||
|
child: Container(
|
||||||
|
width: 140,
|
||||||
|
height: 15,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.blueColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 207,
|
||||||
|
right: 5,
|
||||||
|
child: Container(
|
||||||
|
width: 140,
|
||||||
|
height: 15,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.blueColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 225,
|
||||||
|
right: 5,
|
||||||
|
child: Container(
|
||||||
|
width: 140,
|
||||||
|
height: 15,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.blueColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 115,
|
||||||
|
left: 25,
|
||||||
|
child: Container(
|
||||||
|
width: 120,
|
||||||
|
height: 110,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: AppColor.blueColor,
|
||||||
|
border: Border.all(
|
||||||
|
color: AppColor.blueColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
decoration: AppStyle.boxDecoration,
|
||||||
|
height: Get.width * 3 / 4,
|
||||||
|
width: Get.width,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'Camera not initilaized yet',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@@ -179,6 +184,9 @@ class CameraWidgetCardId extends StatelessWidget {
|
|||||||
cameraClassController.takePictureAndTesseractScan()),
|
cameraClassController.takePictureAndTesseractScan()),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Scan ID Api'.tr,
|
||||||
|
onPressed: () => cameraClassController.extractCardId()),
|
||||||
GetBuilder<CameraClassController>(
|
GetBuilder<CameraClassController>(
|
||||||
builder: (cameraClassController) => Expanded(
|
builder: (cameraClassController) => Expanded(
|
||||||
child:
|
child:
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:ride/constant/colors.dart';
|
import 'package:ride/constant/colors.dart';
|
||||||
import 'package:ride/constant/style.dart';
|
import 'package:ride/constant/style.dart';
|
||||||
import 'package:ride/constant/table_names.dart';
|
import 'package:ride/constant/table_names.dart';
|
||||||
|
import 'package:ride/controller/functions/camer_controller.dart';
|
||||||
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
import 'package:ride/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:ride/controller/home/captin/order_request_controller.dart';
|
import 'package:ride/controller/home/captin/order_request_controller.dart';
|
||||||
import 'package:ride/controller/payment/payment_controller.dart';
|
import 'package:ride/controller/payment/payment_controller.dart';
|
||||||
@@ -205,6 +206,15 @@ class HomeCaptain extends StatelessWidget {
|
|||||||
"Text IdCamera",
|
"Text IdCamera",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
CameraClassController().extractByAPI(
|
||||||
|
'https://img.alwakeelnews.com/Content/Upload/large/b8109dd0d33af5195938104af6835fef.jpg');
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
"Text By API",
|
||||||
|
),
|
||||||
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
PaymentController().makePayment(
|
PaymentController().makePayment(
|
||||||
|
|||||||
Reference in New Issue
Block a user