added themeMode to shareable paints
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SharedTheme {
|
||||
Map json;
|
||||
@@ -12,6 +12,7 @@ class SharedTheme {
|
||||
bool shadowEffect;
|
||||
SharedGradeColors gradeColors;
|
||||
String displayName;
|
||||
ThemeMode? themeMode;
|
||||
|
||||
SharedTheme({
|
||||
required this.json,
|
||||
@@ -25,6 +26,7 @@ class SharedTheme {
|
||||
required this.shadowEffect,
|
||||
required this.gradeColors,
|
||||
this.displayName = 'displayName',
|
||||
this.themeMode,
|
||||
});
|
||||
|
||||
factory SharedTheme.fromJson(Map json, SharedGradeColors gradeColors) {
|
||||
@@ -39,6 +41,10 @@ class SharedTheme {
|
||||
iconColor: Color(json['icon_color']),
|
||||
shadowEffect: json['shadow_effect'] ?? true,
|
||||
gradeColors: gradeColors,
|
||||
displayName: json['display_name'] ?? 'no_name',
|
||||
themeMode: json['theme_mode'] == 'dark'
|
||||
? ThemeMode.dark
|
||||
: (json['theme_mode'] == 'light' ? ThemeMode.light : null),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user