mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-22 22:20:43 -04:00
ui cleanup
This commit is contained in:
parent
d460a0388c
commit
77c68aa45f
57 changed files with 1158 additions and 914 deletions
|
@ -114,14 +114,13 @@ extension LabelExt on Widget {
|
|||
{ScaleColor? scale}) {
|
||||
final theme = Theme.of(context);
|
||||
final scaleScheme = theme.extension<ScaleScheme>()!;
|
||||
// final scaleConfig = theme.extension<ScaleConfig>()!;
|
||||
scale = scale ?? scaleScheme.primaryScale;
|
||||
|
||||
return Wrap(crossAxisAlignment: WrapCrossAlignment.center, children: [
|
||||
return Wrap(crossAxisAlignment: WrapCrossAlignment.end, children: [
|
||||
Text(
|
||||
'$label:',
|
||||
style: theme.textTheme.titleLarge!.copyWith(color: scale.border),
|
||||
).paddingLTRB(0, 0, 8, 8),
|
||||
style: theme.textTheme.bodyLarge!.copyWith(color: scale.hoverBorder),
|
||||
).paddingLTRB(0, 0, 8, 0),
|
||||
this
|
||||
]);
|
||||
}
|
||||
|
@ -431,6 +430,31 @@ Widget styledTitleContainer({
|
|||
]));
|
||||
}
|
||||
|
||||
Widget styledCard({
|
||||
required BuildContext context,
|
||||
required Widget child,
|
||||
Color? borderColor,
|
||||
Color? backgroundColor,
|
||||
Color? titleColor,
|
||||
}) {
|
||||
final theme = Theme.of(context);
|
||||
final scale = theme.extension<ScaleScheme>()!;
|
||||
final scaleConfig = theme.extension<ScaleConfig>()!;
|
||||
|
||||
return DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
color: backgroundColor ?? scale.primaryScale.elementBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: (scaleConfig.useVisualIndicators || scaleConfig.preferBorders)
|
||||
? BorderSide(
|
||||
color: borderColor ?? scale.primaryScale.border, width: 2)
|
||||
: BorderSide.none,
|
||||
borderRadius:
|
||||
BorderRadius.circular(12 * scaleConfig.borderRadiusScale),
|
||||
)),
|
||||
child: child.paddingAll(4));
|
||||
}
|
||||
|
||||
Widget styledBottomSheet({
|
||||
required BuildContext context,
|
||||
required String title,
|
||||
|
@ -500,6 +524,12 @@ const grayColorFilter = ColorFilter.matrix(<double>[
|
|||
0,
|
||||
]);
|
||||
|
||||
const dodgeFilter =
|
||||
ColorFilter.mode(Color.fromARGB(96, 255, 255, 255), BlendMode.srcIn);
|
||||
|
||||
const overlayFilter =
|
||||
ColorFilter.mode(Color.fromARGB(127, 255, 255, 255), BlendMode.dstIn);
|
||||
|
||||
Container clipBorder({
|
||||
required bool clipEnabled,
|
||||
required bool borderEnabled,
|
||||
|
@ -510,16 +540,17 @@ Container clipBorder({
|
|||
// ignore: avoid_unnecessary_containers, use_decorated_box
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: borderColor,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: clipEnabled
|
||||
? BorderRadius.circular(borderRadius)
|
||||
: BorderRadius.zero,
|
||||
)),
|
||||
side: borderEnabled && clipEnabled
|
||||
? BorderSide(color: borderColor, width: 2)
|
||||
: BorderSide.none,
|
||||
borderRadius: clipEnabled
|
||||
? BorderRadius.circular(borderRadius)
|
||||
: BorderRadius.zero,
|
||||
)),
|
||||
child: ClipRRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
borderRadius: clipEnabled
|
||||
? BorderRadius.circular(borderRadius)
|
||||
: BorderRadius.zero,
|
||||
child: child)
|
||||
.paddingAll(clipEnabled && borderEnabled ? 2 : 0));
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
borderRadius: clipEnabled
|
||||
? BorderRadius.circular(borderRadius - 2)
|
||||
: BorderRadius.zero,
|
||||
child: child));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue