24-12/26/1
This commit is contained in:
@@ -21,35 +21,83 @@ class SearchingCaptainWindow extends StatelessWidget {
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
height: Get.height * .25,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
// Use Stack for overlapping widgets
|
||||
children: [
|
||||
// Text elements
|
||||
|
||||
SizedBox(
|
||||
width: Get.width * .7,
|
||||
child: const LinearProgressIndicator(
|
||||
minHeight: 6,
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.scaffoldBackgroundColor, // Use theme color
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, -5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min, // Fit content
|
||||
children: [
|
||||
Text(
|
||||
mapPassengerController.driversStatusForSearchWindow,
|
||||
style: AppStyle.title,
|
||||
style: AppStyle.title.copyWith(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// Text(
|
||||
// "We are searching for the nearest driver to you".tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
'please wait till driver accept your order'.tr,
|
||||
style: AppStyle.title,
|
||||
), // Timer logic
|
||||
_buildTimer(mapPassengerController),
|
||||
'${'We are searching for the nearest driver to you'.tr}...', // Add ellipsis
|
||||
style: AppStyle.subtitle.copyWith(
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
SizedBox(
|
||||
width: Get.width * 0.8,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: LinearProgressIndicator(
|
||||
minHeight: 8,
|
||||
backgroundColor:
|
||||
AppColor.accentColor.withOpacity(0.3),
|
||||
color: AppColor.primaryColor,
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(
|
||||
AppColor.primaryColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.timer_outlined,
|
||||
size: 16, color: Colors.grey),
|
||||
const SizedBox(width: 4),
|
||||
_buildTimer(mapPassengerController),
|
||||
],
|
||||
),
|
||||
// const SizedBox(height: 8),
|
||||
// ElevatedButton(
|
||||
// onPressed: () {
|
||||
// // Add logic to cancel the search if needed
|
||||
// // mapPassengerController.cancelSearch();
|
||||
// Get.back(); // Example: go back to the previous screen
|
||||
// },
|
||||
// style: ElevatedButton.styleFrom(
|
||||
// backgroundColor: Colors.grey.shade300,
|
||||
// foregroundColor: Colors.black87,
|
||||
// elevation: 0,
|
||||
// shape: RoundedRectangleBorder(
|
||||
// borderRadius: BorderRadius.circular(8),
|
||||
// ),
|
||||
// ),
|
||||
// child: Text('Cancel Search'.tr),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -60,6 +108,22 @@ class SearchingCaptainWindow extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
// Widget _buildTimer(MapPassengerController mapPassengerController) {
|
||||
// return Obx(() {
|
||||
// final remainingSeconds = mapPassengerController.searchingDuration.value;
|
||||
// final minutes = (remainingSeconds ~/ 60).toString().padLeft(2, '0');
|
||||
// final seconds = (remainingSeconds % 60).toString().padLeft(2, '0');
|
||||
// return Text(
|
||||
// '$minutes:$seconds',
|
||||
// style: const TextStyle(
|
||||
// fontSize: 16,
|
||||
// fontWeight: FontWeight.w500,
|
||||
// color: Colors.grey,
|
||||
// ),
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
|
||||
Widget _buildTimer(MapPassengerController mapPassengerController) {
|
||||
// Start timer at 0
|
||||
Timer? timer;
|
||||
|
||||
Reference in New Issue
Block a user