
import 'package:flutter/cupertino.dart';

class ServerModel extends ChangeNotifier {
  String type;
  String host;

  String get httpServer => type + host + "/";
  String get wsServer => (type == "http://" ? "ws://" : "wss://") + host + "/chat_server";

  void update(String type, String host){
    type = type;
    host = host;
    notifyListeners();
  }

  void updateType(String type){
    type = type;
    notifyListeners();
  }

  void updateHost(String host){
    host = host;
    notifyListeners();
  }
}