import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:get_it/get_it.dart';
import 'package:logging/logging.dart';
import 'package:uuid/uuid.dart';

import '../enum/commands.dart';
import '../services/connection.dart';

final getIt = GetIt.instance;

///
class Pad {
  Socket socket;
  late ReadBuffer input;
  late Stream output;
  String uuid;
  late Color hitColor;
  bool alive = true;
  // final ConnectionService connectionService;
  Commands currentStatus = Commands.off;
  final ConnectionService connectionService;
  Logger log = Logger('Pad');

  Pad(this.socket)
      : connectionService = getIt<ConnectionService>(),
        currentStatus = Commands.connect,
        uuid = const Uuid().v5(Uuid.NAMESPACE_URL, 'agineek.com');

  void connect() {
    log.info('$hashCode Pad Calling connect...');
    log.info('$hashCode Pad getting buffer reader ${socket.toString()}');
  }
}
