import 'package:flutter/material.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; import 'package:myhomie_app/client.dart'; class HomieAppContext with ChangeNotifier{ Client clientAPI = Client("http://192.168.31.140"); // Replace by https://api.mymuseum.be //http://192.168.31.140:8089 MqttServerClient clientMQTT = MqttServerClient.withPort("192.168.31.140", "TODO", 1883); // Replace by https://api.mymuseum.be //http://192.168.31.140:8089 String? userId; String? homeId; String? token; String? host; String? language; HomieAppContext({this.userId, this.homeId, this.host, this.language, this.token}); Map toMap() { return { 'userId': userId, 'homeId': homeId, 'host': host, 'language': language, 'token': token }; } factory HomieAppContext.fromJson(Map json) { return new HomieAppContext( userId: json['userId'] as String, host: json['host'] as String, homeId: json['homeId'] as String, language: json['language'] as String, token: json['token'] as String, //roomsMainDetails: json['roomsMainDetails'] as List ); } // Implement toString to make it easier to see information about @override String toString() { return 'HomieAppContext{userId: $userId, homeId: $homeId, language: $language, host: $host}'; } }