import 'package:flutter/material.dart';
import 'package:draggable_float_widget/draggable_float_widget.dart';
import 'package:guru_utils/router/router.dart';
import 'package:get/get.dart';

import 'console_button_controller.dart';


class ConsoleButton extends GetWidget<ConsoleButtonController> {

  ConsoleButton({
    Key? key}) : super(key: key) {
      Get.create<ConsoleButtonController>(() => ConsoleButtonController());
  }

  @override
  Widget build(BuildContext context) {
    
    return DraggableFloatWidget(
      eventStreamController:  controller.eventStreamController,
      config: const DraggableFloatWidgetBaseConfig(
        isFullScreen: true,
        initPositionYInTop: false,
        initPositionYMarginBorder: 50,
        borderBottom: defaultBorderWidth,
      ),
      onTap: () {
        controller.showOverlayEntry();
      },
      child: Container(
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(15),
        ),
        alignment: Alignment.center,
        padding: const EdgeInsets.all(5),
        child: const Material(
          color: Colors.transparent,
          child: Text(
            "Console",
            style: TextStyle(
              fontSize: 15,
              color: Colors.black,
              fontWeight: FontWeight.bold,
            ),
            textAlign: TextAlign.center,
          ),
        ),
      ),
    );
  }
}