mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-23 14:40:58 -04:00
chat and theme work
This commit is contained in:
parent
ca6b00e021
commit
96e3251b3b
29 changed files with 729 additions and 389 deletions
|
@ -1,11 +1,112 @@
|
|||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
import '../entities/preferences.dart';
|
||||
import 'radix_generator.dart';
|
||||
|
||||
@immutable
|
||||
class ExtendedColorScheme extends ColorScheme {
|
||||
const ExtendedColorScheme({
|
||||
required this.scaleScheme,
|
||||
required super.brightness,
|
||||
required super.primary,
|
||||
required super.onPrimary,
|
||||
super.primaryContainer,
|
||||
super.onPrimaryContainer,
|
||||
required super.secondary,
|
||||
required super.onSecondary,
|
||||
super.secondaryContainer,
|
||||
super.onSecondaryContainer,
|
||||
super.tertiary,
|
||||
super.onTertiary,
|
||||
super.tertiaryContainer,
|
||||
super.onTertiaryContainer,
|
||||
required super.error,
|
||||
required super.onError,
|
||||
super.errorContainer,
|
||||
super.onErrorContainer,
|
||||
required super.background,
|
||||
required super.onBackground,
|
||||
required super.surface,
|
||||
required super.onSurface,
|
||||
super.surfaceVariant,
|
||||
super.onSurfaceVariant,
|
||||
super.outline,
|
||||
super.outlineVariant,
|
||||
super.shadow,
|
||||
super.scrim,
|
||||
super.inverseSurface,
|
||||
super.onInverseSurface,
|
||||
super.inversePrimary,
|
||||
super.surfaceTint,
|
||||
});
|
||||
|
||||
final ScaleScheme scaleScheme;
|
||||
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties.add(DiagnosticsProperty<ScaleScheme>('scales', scaleScheme));
|
||||
}
|
||||
}
|
||||
|
||||
class ScaleColor {
|
||||
ScaleColor({
|
||||
required this.appBackground,
|
||||
required this.subtleBackground,
|
||||
required this.elementBackground,
|
||||
required this.hoverElementBackground,
|
||||
required this.activedElementBackground,
|
||||
required this.subtleBorder,
|
||||
required this.border,
|
||||
required this.hoverBorder,
|
||||
required this.background,
|
||||
required this.hoverBackground,
|
||||
required this.subtleText,
|
||||
required this.text,
|
||||
});
|
||||
|
||||
Color appBackground;
|
||||
Color subtleBackground;
|
||||
Color elementBackground;
|
||||
Color hoverElementBackground;
|
||||
Color activedElementBackground;
|
||||
Color subtleBorder;
|
||||
Color border;
|
||||
Color hoverBorder;
|
||||
Color background;
|
||||
Color hoverBackground;
|
||||
Color subtleText;
|
||||
Color text;
|
||||
}
|
||||
|
||||
class ScaleScheme {
|
||||
ScaleScheme(
|
||||
{required this.primaryScale,
|
||||
required this.primaryAlphaScale,
|
||||
required this.secondaryScale,
|
||||
required this.tertiaryScale,
|
||||
required this.grayScale,
|
||||
required this.errorScale});
|
||||
|
||||
ScaleColor primaryScale;
|
||||
ScaleColor primaryAlphaScale;
|
||||
ScaleColor secondaryScale;
|
||||
ScaleColor tertiaryScale;
|
||||
ScaleColor grayScale;
|
||||
ScaleColor errorScale;
|
||||
|
||||
static ScaleScheme of(BuildContext context) =>
|
||||
(Theme.of(context).colorScheme as ExtendedColorScheme).scaleScheme;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class ThemeService {
|
||||
ThemeService._();
|
||||
static late SharedPreferences prefs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue