added theme sharing to providers and api

This commit is contained in:
Kima
2023-09-08 20:57:02 +02:00
parent db7b126bda
commit 991097fa34
5 changed files with 117 additions and 7 deletions

View File

@@ -0,0 +1,33 @@
import 'dart:ui';
class SharedTheme {
Map json;
String id;
bool isPublic;
String nickname;
Color backgroundColor;
Color panelsColor;
Color accentColor;
SharedTheme({
required this.json,
required this.id,
this.isPublic = false,
this.nickname = 'Anonymous',
required this.backgroundColor,
required this.panelsColor,
required this.accentColor,
});
factory SharedTheme.fromJson(Map json) {
return SharedTheme(
json: json,
id: json['public_id'],
isPublic: json['is_public'] ?? false,
nickname: json['nickname'] ?? 'Anonymous',
backgroundColor: json['background_color'],
panelsColor: json['panels_color'],
accentColor: json['accent_color'],
);
}
}