import 'package:flutter/material.dart'; import 'package:mqtt_client/mqtt_server_client.dart'; import 'dart:convert'; import 'package:myhomie_app/client.dart'; class HomieAppContext with ChangeNotifier{ Client clientAPI; MqttServerClient clientMQTT; String id; String host; String language; String userId; String homeId; String token; HomieAppContext({this.id, this.userId, this.homeId, this.host, this.language, this.token}); Map toMap() { return { 'id': id, 'userId': userId, 'homeId': homeId, 'host': host, 'language': language, 'token': token, }; } factory HomieAppContext.fromJson(Map json) { return new HomieAppContext( id: json['id'] as String, 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 ); } // Implement toString to make it easier to see information about @override String toString() { return 'TabletAppContext{id: $id, userId: $userId, homeId: $homeId, language: $language, host: $host}'; } }