import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
// import 'package:intl/intl.dart';

import '../../../constant/style.dart';
import '../../../controller/home/map_passenger_controller.dart';

class DriverTimeArrivePassengerPage extends StatelessWidget {
  const DriverTimeArrivePassengerPage({super.key});

  @override
  Widget build(BuildContext context) {
    return GetBuilder<MapPassengerController>(
      builder: (controller) {
        return controller.remainingTime == 0
            ? Positioned(
                bottom: Get.height * .35,
                right: Get.width * .05,
                child: Stack(
                  alignment: Alignment.center,
                  children: [
                    Container(
                        decoration: AppStyle.boxDecoration,
                        // width: 50,
                        // height: 50,
                        child: Padding(
                          padding: const EdgeInsetsDirectional.only(
                              start: 5, end: 5),
                          child: Column(
                            children: [
                              Text(
                                controller.durationByPassenger.toString() +
                                    ' to arrive you.'.tr,
                                style: AppStyle.title,
                              ),
                              Text(
                                " ${DateFormat('h:mm a').format(controller.newTime)}",
                                style: AppStyle.title,
                              ),
                            ],
                          ),
                        ))
                  ],
                ),
              )
            : const SizedBox();
      },
    );
  }
}
