34 lines
857 B
Dart
34 lines
857 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class VisitAppContext with ChangeNotifier{
|
|
String? userId = "";
|
|
String? token = "";
|
|
String? host = "";
|
|
String? language = "";
|
|
|
|
VisitAppContext({this.userId, this.token, this.host, this.language});
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'userId': userId,
|
|
'host': host,
|
|
'language': language,
|
|
'token': token
|
|
};
|
|
}
|
|
|
|
factory VisitAppContext.fromJson(Map<String, dynamic> json) {
|
|
return VisitAppContext(
|
|
userId: json['userId'] as String,
|
|
host: json['host'] 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 'VisitAppContext{userId: $userId, language: $language, host: $host}';
|
|
}
|
|
} |