chore: add integration tests
Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
parent
803205b7b7
commit
1992d18a64
18 changed files with 491 additions and 103 deletions
|
|
@ -6,6 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||
import 'package:system_theme/system_theme.dart';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
|
||||
class ThemeBuilder extends StatefulWidget {
|
||||
final Widget Function(
|
||||
|
|
@ -34,6 +35,7 @@ class ThemeController extends State<ThemeBuilder> {
|
|||
Color? _primaryColor;
|
||||
|
||||
ThemeMode get themeMode => _themeMode ?? ThemeMode.system;
|
||||
|
||||
Color? get primaryColor => _primaryColor;
|
||||
|
||||
static ThemeController of(BuildContext context) =>
|
||||
|
|
@ -87,10 +89,18 @@ class ThemeController extends State<ThemeBuilder> {
|
|||
super.initState();
|
||||
}
|
||||
|
||||
Color? get systemAccentColor {
|
||||
final color = SystemTheme.accentColor.accent;
|
||||
if (color == kDefaultSystemAccentColor) return AppConfig.chatColor;
|
||||
return color;
|
||||
Color get systemAccentColor {
|
||||
if (PlatformInfos.isLinux) return AppConfig.chatColor;
|
||||
try {
|
||||
// a bad plugin implementation
|
||||
// https://github.com/bdlukaa/system_theme/issues/10
|
||||
final accentColor = SystemTheme.accentColor;
|
||||
final color = accentColor.accent;
|
||||
if (color == kDefaultSystemAccentColor) return AppConfig.chatColor;
|
||||
return color;
|
||||
} catch (_) {
|
||||
return AppConfig.chatColor;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue