4/2/4
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:vibration/vibration.dart';
|
||||
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
@@ -18,7 +22,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? mapDriverController.driverEndPage = 160
|
||||
: 120,
|
||||
: 130,
|
||||
width: 240,
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -57,12 +61,14 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(
|
||||
'Timer is ${mapDriverController.rideTimerFromBegin.toStringAsFixed(0)}'),
|
||||
Text(
|
||||
'Distance is ${mapDriverController.recentDistanceToDash.toStringAsFixed(0)}'),
|
||||
Text(
|
||||
'Price is ${mapDriverController.price.toStringAsFixed(0)}')
|
||||
const Icon(Icons.timer),
|
||||
Text(mapDriverController.rideTimerFromBegin
|
||||
.toStringAsFixed(0)),
|
||||
const Icon(Icons.location_on),
|
||||
Text(mapDriverController.recentDistanceToDash
|
||||
.toStringAsFixed(0)),
|
||||
const Icon(Icons.attach_money),
|
||||
Text(mapDriverController.price.toStringAsFixed(0)),
|
||||
],
|
||||
),
|
||||
mapDriverController.carType == 'Free Ride'
|
||||
@@ -103,7 +109,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
60
|
||||
? AppColor.redColor
|
||||
: AppColor.greenColor,
|
||||
minHeight: 40,
|
||||
minHeight: 25,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
value: mapDriverController.progressTimerRideBegin
|
||||
.toDouble(),
|
||||
@@ -124,16 +130,37 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
|
||||
GetBuilder<MapDriverController> speedCircle() {
|
||||
return GetBuilder<MapDriverController>(
|
||||
builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||
builder: (mapDriverController) {
|
||||
if (mapDriverController.speed > 100) {
|
||||
if (Platform.isIOS) {
|
||||
HapticFeedback.selectionClick();
|
||||
} else {
|
||||
Vibration.vibrate(duration: 1000);
|
||||
}
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
titleStyle: AppStyle.title,
|
||||
title: 'Speed Over'.tr,
|
||||
middleText: 'Please slow down'.tr,
|
||||
middleTextStyle: AppStyle.title,
|
||||
confirm: MyElevatedButton(
|
||||
title: 'I will slow down'.tr,
|
||||
onPressed: () => Get.back(),
|
||||
),
|
||||
);
|
||||
}
|
||||
return mapDriverController.isRideStarted
|
||||
? Positioned(
|
||||
// left: 5,
|
||||
bottom: 25,
|
||||
right: 100,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppColor.secondaryColor,
|
||||
border: Border.all(width: 3, color: AppColor.redColor)),
|
||||
shape: BoxShape.circle,
|
||||
color: mapDriverController.speed > 100
|
||||
? Colors.red
|
||||
: AppColor.secondaryColor,
|
||||
border: Border.all(width: 3, color: AppColor.redColor),
|
||||
),
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: Center(
|
||||
@@ -142,6 +169,9 @@ GetBuilder<MapDriverController> speedCircle() {
|
||||
style: AppStyle.number,
|
||||
),
|
||||
),
|
||||
))
|
||||
: const SizedBox());
|
||||
),
|
||||
)
|
||||
: const SizedBox();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user