import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/accurate_calibrating_dialog.dart';
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/accurate_dialog_widget.dart';
import 'package:syncrow_web/pages/device_managment/curtain_module/widgets/normal_text_body_for_dialog.dart';
import 'package:syncrow_web/utils/color_manager.dart';

class AccurateCalibrationDialog extends StatelessWidget {
  final String deviceId;
  final BuildContext parentContext;
  const AccurateCalibrationDialog({
    super.key,
    required this.deviceId,
    required this.parentContext,
  });

  @override
  Widget build(_) {
    return AlertDialog(
      backgroundColor: ColorsManager.whiteColors,
      contentPadding: EdgeInsets.zero,
      content: AccurateDialogWidget(
        title: 'Accurate Calibration',
        body: const NormalTextBodyForDialog(
          title: 'Prepare Calibration:',
          step1: 'Run The Curtain to the Fully Open Position,and pause.',
          step2: 'click Next to Start accurate calibration.',
        ),
        leftOnTap: () => Navigator.of(parentContext).pop(),
        rightOnTap: () {
          Navigator.of(parentContext).pop();
          showDialog(
            context: parentContext,
            builder: (_) => AccurteCalibratingDialog(
              deviceId: deviceId,
              parentContext: parentContext,
            ),
          );
        },
      ),
    );
  }
}
