mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-23 22:51:00 -04:00
debugging and cleanup
This commit is contained in:
parent
604ec9cfdd
commit
d460a0388c
69 changed files with 2306 additions and 790 deletions
56
lib/theme/models/scale_theme/scale_tile_theme.dart
Normal file
56
lib/theme/models/scale_theme/scale_tile_theme.dart
Normal file
|
@ -0,0 +1,56 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'scale_scheme.dart';
|
||||
import 'scale_theme.dart';
|
||||
|
||||
class ScaleTileTheme {
|
||||
ScaleTileTheme(
|
||||
{required this.textColor,
|
||||
required this.backgroundColor,
|
||||
required this.borderColor,
|
||||
required this.shapeBorder,
|
||||
required this.largeTextStyle,
|
||||
required this.smallTextStyle});
|
||||
|
||||
final Color textColor;
|
||||
final Color backgroundColor;
|
||||
final Color borderColor;
|
||||
final ShapeBorder shapeBorder;
|
||||
final TextStyle largeTextStyle;
|
||||
final TextStyle smallTextStyle;
|
||||
}
|
||||
|
||||
extension ScaleTileThemeExt on ScaleTheme {
|
||||
ScaleTileTheme tileTheme(
|
||||
{bool disabled = false,
|
||||
bool selected = false,
|
||||
ScaleKind scaleKind = ScaleKind.primary}) {
|
||||
final tileColor = scheme.scale(!disabled ? scaleKind : ScaleKind.gray);
|
||||
|
||||
final borderColor = selected ? tileColor.hoverBorder : tileColor.border;
|
||||
final backgroundColor = config.useVisualIndicators && !selected
|
||||
? tileColor.borderText
|
||||
: borderColor;
|
||||
final textColor = config.useVisualIndicators && !selected
|
||||
? borderColor
|
||||
: tileColor.borderText;
|
||||
|
||||
final largeTextStyle = textTheme.labelMedium!.copyWith(color: textColor);
|
||||
final smallTextStyle = textTheme.labelSmall!.copyWith(color: textColor);
|
||||
|
||||
final shapeBorder = RoundedRectangleBorder(
|
||||
side: config.useVisualIndicators
|
||||
? BorderSide(width: 2, color: borderColor, strokeAlign: 0)
|
||||
: BorderSide.none,
|
||||
borderRadius: BorderRadius.circular(8 * config.borderRadiusScale));
|
||||
|
||||
return ScaleTileTheme(
|
||||
textColor: textColor,
|
||||
backgroundColor: backgroundColor,
|
||||
borderColor: borderColor,
|
||||
shapeBorder: shapeBorder,
|
||||
largeTextStyle: largeTextStyle,
|
||||
smallTextStyle: smallTextStyle,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue