mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-03 11:49:04 -04:00
ui cleanup
This commit is contained in:
parent
e4358586aa
commit
23867a1784
17 changed files with 135 additions and 90 deletions
31
lib/theme/models/scale_theme/scale_app_bar_theme.dart
Normal file
31
lib/theme/models/scale_theme/scale_app_bar_theme.dart
Normal file
|
@ -0,0 +1,31 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'scale_theme.dart';
|
||||
|
||||
class ScaleAppBarTheme {
|
||||
ScaleAppBarTheme({
|
||||
required this.textStyle,
|
||||
required this.iconColor,
|
||||
required this.backgroundColor,
|
||||
});
|
||||
|
||||
final TextStyle textStyle;
|
||||
final Color iconColor;
|
||||
final Color backgroundColor;
|
||||
}
|
||||
|
||||
extension ScaleAppBarThemeExt on ScaleTheme {
|
||||
ScaleAppBarTheme appBarTheme({ScaleKind scaleKind = ScaleKind.primary}) {
|
||||
final scale = scheme.scale(scaleKind);
|
||||
|
||||
final textStyle = textTheme.titleLarge!.copyWith(color: scale.borderText);
|
||||
final iconColor = scale.borderText;
|
||||
final backgroundColor = scale.border;
|
||||
|
||||
return ScaleAppBarTheme(
|
||||
textStyle: textStyle,
|
||||
iconColor: iconColor,
|
||||
backgroundColor: backgroundColor,
|
||||
);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'scale_input_decorator_theme.dart';
|
||||
import 'scale_scheme.dart';
|
||||
|
||||
export 'scale_app_bar_theme.dart';
|
||||
export 'scale_color.dart';
|
||||
export 'scale_input_decorator_theme.dart';
|
||||
export 'scale_scheme.dart';
|
||||
|
@ -137,8 +138,10 @@ class ScaleTheme extends ThemeExtension<ScaleTheme> {
|
|||
return scheme.primaryScale.subtleBorder;
|
||||
})),
|
||||
appBarTheme: baseThemeData.appBarTheme.copyWith(
|
||||
backgroundColor: scheme.primaryScale.border,
|
||||
foregroundColor: scheme.primaryScale.borderText),
|
||||
backgroundColor: scheme.primaryScale.border,
|
||||
foregroundColor: scheme.primaryScale.borderText,
|
||||
toolbarHeight: 40,
|
||||
),
|
||||
bottomSheetTheme: baseThemeData.bottomSheetTheme.copyWith(
|
||||
elevation: 0,
|
||||
modalElevation: 0,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'scale_scheme.dart';
|
||||
import 'scale_theme.dart';
|
||||
|
||||
class ScaleTileTheme {
|
||||
|
|
|
@ -125,15 +125,13 @@ class SliderTile extends StatelessWidget {
|
|||
child: ListTile(
|
||||
onTap: onTap,
|
||||
dense: true,
|
||||
visualDensity:
|
||||
const VisualDensity(horizontal: -4, vertical: -4),
|
||||
title: Text(
|
||||
title,
|
||||
overflow: TextOverflow.fade,
|
||||
softWrap: false,
|
||||
),
|
||||
subtitle: subtitle.isNotEmpty ? Text(subtitle) : null,
|
||||
minTileHeight: 48,
|
||||
minTileHeight: 52,
|
||||
iconColor: scaleTileTheme.textColor,
|
||||
textColor: scaleTileTheme.textColor,
|
||||
leading:
|
||||
|
|
|
@ -14,10 +14,18 @@ Widget buildSettingsPageWallpaperPreferences(
|
|||
required ThemeSwitcherState switcher}) {
|
||||
final preferencesRepository = PreferencesRepository.instance;
|
||||
final themePreferences = preferencesRepository.value.themePreference;
|
||||
final theme = Theme.of(context);
|
||||
final scale = theme.extension<ScaleScheme>()!;
|
||||
final textTheme = theme.textTheme;
|
||||
|
||||
return FormBuilderCheckbox(
|
||||
name: formFieldEnableWallpaper,
|
||||
title: Text(translate('settings_page.enable_wallpaper')),
|
||||
title: Text(translate('settings_page.enable_wallpaper'),
|
||||
style: textTheme.labelMedium),
|
||||
initialValue: themePreferences.enableWallpaper,
|
||||
side: BorderSide(color: scale.primaryScale.border, width: 2),
|
||||
checkColor: scale.primaryScale.borderText,
|
||||
activeColor: scale.primaryScale.border,
|
||||
onChanged: (value) async {
|
||||
if (value != null) {
|
||||
final newThemePrefs =
|
||||
|
|
|
@ -442,7 +442,7 @@ Widget styledTitleContainer({
|
|||
color: borderColor ?? scale.primaryScale.border,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(12 * scaleConfig.borderRadiusScale),
|
||||
BorderRadius.circular(8 * scaleConfig.borderRadiusScale),
|
||||
)),
|
||||
child: Column(children: [
|
||||
Text(
|
||||
|
@ -456,7 +456,7 @@ Widget styledTitleContainer({
|
|||
backgroundColor ?? scale.primaryScale.subtleBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
12 * scaleConfig.borderRadiusScale),
|
||||
8 * scaleConfig.borderRadiusScale),
|
||||
)),
|
||||
child: child)
|
||||
.paddingAll(4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue