mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-22 06:08:54 -04:00
ui cleanup
This commit is contained in:
parent
e4358586aa
commit
23867a1784
17 changed files with 135 additions and 90 deletions
Binary file not shown.
Before Width: | Height: | Size: 43 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
9
assets/images/toilet.svg
Normal file
9
assets/images/toilet.svg
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 683 591" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<g transform="matrix(1,0,0,1,-258.886,-304.79)">
|
||||||
|
<path d="M863.18,714.04C889.629,689.649 905.735,659.528 906.84,627.009L479.4,627.009C471.935,627.009 465.896,620.954 465.896,613.505L465.896,383.995L258.886,383.995L258.886,644.605C317.804,660.73 358.554,675.578 386.046,711.378C413.191,746.722 425.198,800.858 426.222,895.218L734.112,895.218L734.112,782.788L734.147,782.788C734.147,776.409 738.69,770.745 745.186,769.554C792.893,760.691 834.159,740.827 863.186,714.038L863.18,714.04Z" style="fill-rule:nonzero;"/>
|
||||||
|
<path d="M921.09,600.04L922.367,599.989C927.383,600.161 932.25,597.794 935.601,594.427C942.949,587.044 942.965,575.173 935.551,567.759C932.113,564.321 927.386,562.196 922.199,562.196L492.889,562.196L492.889,599.989L919.989,599.989C920.364,599.989 920.719,600.005 921.094,600.04L921.09,600.04Z" style="fill-rule:nonzero;"/>
|
||||||
|
<rect x="258.89" y="304.79" width="207.01" height="52.199" style="fill-rule:nonzero;"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
|
@ -43,7 +43,7 @@ class ProfileWidget extends StatelessWidget {
|
||||||
: scale.primaryScale.borderText,
|
: scale.primaryScale.borderText,
|
||||||
width: 2),
|
width: 2),
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(12 * scaleConfig.borderRadiusScale))),
|
Radius.circular(8 * scaleConfig.borderRadiusScale))),
|
||||||
),
|
),
|
||||||
child: Row(children: [
|
child: Row(children: [
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
@ -54,7 +54,7 @@ class ProfileWidget extends StatelessWidget {
|
||||||
? scale.primaryScale.border
|
? scale.primaryScale.border
|
||||||
: scale.primaryScale.borderText),
|
: scale.primaryScale.borderText),
|
||||||
textAlign: TextAlign.left,
|
textAlign: TextAlign.left,
|
||||||
).paddingAll(12),
|
).paddingAll(8),
|
||||||
if (_profile.pronouns.isNotEmpty && _showPronouns)
|
if (_profile.pronouns.isNotEmpty && _showPronouns)
|
||||||
Text('(${_profile.pronouns})',
|
Text('(${_profile.pronouns})',
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
|
@ -62,7 +62,7 @@ class ProfileWidget extends StatelessWidget {
|
||||||
color: scaleConfig.preferBorders
|
color: scaleConfig.preferBorders
|
||||||
? scale.primaryScale.border
|
? scale.primaryScale.border
|
||||||
: scale.primaryScale.primary))
|
: scale.primaryScale.primary))
|
||||||
.paddingAll(12),
|
.paddingAll(8),
|
||||||
const Spacer()
|
const Spacer()
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
|
|
|
@ -83,7 +83,8 @@ class ChatListWidget extends StatelessWidget {
|
||||||
},
|
},
|
||||||
filter: (value) =>
|
filter: (value) =>
|
||||||
_itemFilter(contactMap, chatList, value),
|
_itemFilter(contactMap, chatList, value),
|
||||||
spaceBetweenSearchAndList: 4,
|
searchFieldPadding:
|
||||||
|
const EdgeInsets.fromLTRB(0, 0, 0, 4),
|
||||||
inputDecoration: InputDecoration(
|
inputDecoration: InputDecoration(
|
||||||
labelText: translate('chat_list.search'),
|
labelText: translate('chat_list.search'),
|
||||||
),
|
),
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ChatSingleContactItemWidget extends StatelessWidget {
|
||||||
|
|
||||||
final avatar = AvatarWidget(
|
final avatar = AvatarWidget(
|
||||||
name: name,
|
name: name,
|
||||||
size: 34,
|
size: 32,
|
||||||
borderColor: scaleTheme.config.useVisualIndicators
|
borderColor: scaleTheme.config.useVisualIndicators
|
||||||
? scaleTheme.scheme.primaryScale.primaryText
|
? scaleTheme.scheme.primaryScale.primaryText
|
||||||
: scaleTheme.scheme.primaryScale.subtleBorder,
|
: scaleTheme.scheme.primaryScale.subtleBorder,
|
||||||
|
@ -75,7 +75,7 @@ class ChatSingleContactItemWidget extends StatelessWidget {
|
||||||
trailing: AvailabilityWidget(
|
trailing: AvailabilityWidget(
|
||||||
availability: availability,
|
availability: availability,
|
||||||
color: scaleTileTheme.textColor,
|
color: scaleTileTheme.textColor,
|
||||||
),
|
).fit(fit: BoxFit.scaleDown),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
singleFuture(activeChatCubit, () async {
|
singleFuture(activeChatCubit, () async {
|
||||||
activeChatCubit.setActiveChat(_localConversationRecordKey);
|
activeChatCubit.setActiveChat(_localConversationRecordKey);
|
||||||
|
|
|
@ -1,35 +1,39 @@
|
||||||
import 'package:awesome_extensions/awesome_extensions.dart';
|
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:flutter_translate/flutter_translate.dart';
|
import 'package:flutter_translate/flutter_translate.dart';
|
||||||
|
|
||||||
import '../../proto/proto.dart' as proto;
|
import '../../proto/proto.dart' as proto;
|
||||||
|
import '../../theme/theme.dart';
|
||||||
|
|
||||||
class AvailabilityWidget extends StatelessWidget {
|
class AvailabilityWidget extends StatelessWidget {
|
||||||
const AvailabilityWidget(
|
const AvailabilityWidget(
|
||||||
{required this.availability,
|
{required this.availability,
|
||||||
required this.color,
|
required this.color,
|
||||||
this.vertical = true,
|
this.vertical = true,
|
||||||
this.iconSize = 24,
|
this.size = 32,
|
||||||
super.key});
|
super.key});
|
||||||
|
|
||||||
static Widget availabilityIcon(proto.Availability availability, Color color,
|
static Widget availabilityIcon(proto.Availability availability, Color color,
|
||||||
{double size = 24}) {
|
{double size = 24}) {
|
||||||
late final Widget iconData;
|
late final Widget icon;
|
||||||
switch (availability) {
|
switch (availability) {
|
||||||
case proto.Availability.AVAILABILITY_AWAY:
|
case proto.Availability.AVAILABILITY_AWAY:
|
||||||
iconData = ImageIcon(const AssetImage('assets/images/toilet.png'),
|
icon = SvgPicture.asset('assets/images/toilet.svg',
|
||||||
size: size, color: color);
|
width: size,
|
||||||
|
height: size,
|
||||||
|
colorFilter: ColorFilter.mode(color, BlendMode.srcATop));
|
||||||
case proto.Availability.AVAILABILITY_BUSY:
|
case proto.Availability.AVAILABILITY_BUSY:
|
||||||
iconData = Icon(Icons.event_busy, size: size);
|
icon = Icon(Icons.event_busy, size: size);
|
||||||
case proto.Availability.AVAILABILITY_FREE:
|
case proto.Availability.AVAILABILITY_FREE:
|
||||||
iconData = Icon(Icons.event_available, size: size);
|
icon = Icon(Icons.event_available, size: size);
|
||||||
case proto.Availability.AVAILABILITY_OFFLINE:
|
case proto.Availability.AVAILABILITY_OFFLINE:
|
||||||
iconData = Icon(Icons.cloud_off, size: size);
|
icon = Icon(Icons.cloud_off, size: size);
|
||||||
case proto.Availability.AVAILABILITY_UNSPECIFIED:
|
case proto.Availability.AVAILABILITY_UNSPECIFIED:
|
||||||
iconData = Icon(Icons.question_mark, size: size);
|
icon = Icon(Icons.question_mark, size: size);
|
||||||
}
|
}
|
||||||
return iconData;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
static String availabilityName(proto.Availability availability) {
|
static String availabilityName(proto.Availability availability) {
|
||||||
|
@ -53,26 +57,25 @@ class AvailabilityWidget extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
final textTheme = theme.textTheme;
|
final textTheme = theme.textTheme;
|
||||||
// final scale = theme.extension<ScaleScheme>()!;
|
|
||||||
// final scaleConfig = theme.extension<ScaleConfig>()!;
|
|
||||||
|
|
||||||
final name = availabilityName(availability);
|
final name = availabilityName(availability);
|
||||||
final icon = availabilityIcon(availability, color, size: iconSize);
|
final icon = availabilityIcon(availability, color, size: size * 2 / 3);
|
||||||
|
|
||||||
return vertical
|
return vertical
|
||||||
? Column(
|
? ConstrainedBox(
|
||||||
mainAxisSize: MainAxisSize.min,
|
constraints: BoxConstraints.tightFor(width: size),
|
||||||
//mainAxisAlignment: MainAxisAlignment.center,
|
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||||
children: [
|
|
||||||
icon,
|
icon,
|
||||||
Text(name, style: textTheme.labelSmall!.copyWith(color: color))
|
Text(name, style: textTheme.labelSmall!.copyWith(color: color))
|
||||||
.paddingLTRB(0, 0, 0, 0)
|
.fit(fit: BoxFit.scaleDown)
|
||||||
])
|
]))
|
||||||
: Row(mainAxisSize: MainAxisSize.min, children: [
|
: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints.tightFor(height: size),
|
||||||
|
child: Row(mainAxisSize: MainAxisSize.min, children: [
|
||||||
icon,
|
icon,
|
||||||
Text(name, style: textTheme.labelLarge!.copyWith(color: color))
|
Text(name, style: textTheme.labelLarge!.copyWith(color: color))
|
||||||
.paddingLTRB(8, 0, 0, 0)
|
.paddingLTRB(size / 4, 0, 0, 0)
|
||||||
]);
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -80,7 +83,7 @@ class AvailabilityWidget extends StatelessWidget {
|
||||||
final proto.Availability availability;
|
final proto.Availability availability;
|
||||||
final Color color;
|
final Color color;
|
||||||
final bool vertical;
|
final bool vertical;
|
||||||
final double iconSize;
|
final double size;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||||
|
@ -89,7 +92,7 @@ class AvailabilityWidget extends StatelessWidget {
|
||||||
..add(
|
..add(
|
||||||
DiagnosticsProperty<proto.Availability>('availability', availability))
|
DiagnosticsProperty<proto.Availability>('availability', availability))
|
||||||
..add(DiagnosticsProperty<bool>('vertical', vertical))
|
..add(DiagnosticsProperty<bool>('vertical', vertical))
|
||||||
..add(DoubleProperty('iconSize', iconSize))
|
..add(DoubleProperty('size', size))
|
||||||
..add(ColorProperty('color', color));
|
..add(ColorProperty('color', color));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:async_tools/async_tools.dart';
|
import 'package:async_tools/async_tools.dart';
|
||||||
import 'package:awesome_extensions/awesome_extensions.dart';
|
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_translate/flutter_translate.dart';
|
import 'package:flutter_translate/flutter_translate.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -30,8 +29,10 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
final scale = theme.extension<ScaleScheme>()!;
|
final scaleTheme = theme.extension<ScaleTheme>()!;
|
||||||
final appBarIconColor = scale.primaryScale.borderText;
|
final appBarTheme = scaleTheme.appBarTheme();
|
||||||
|
final scaleScheme = theme.extension<ScaleScheme>()!;
|
||||||
|
final scale = scaleScheme.scale(ScaleKind.primary);
|
||||||
|
|
||||||
final enableSplit = !isMobileSize(context);
|
final enableSplit = !isMobileSize(context);
|
||||||
final enableLeft = enableSplit || _selectedContact == null;
|
final enableLeft = enableSplit || _selectedContact == null;
|
||||||
|
@ -39,9 +40,11 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||||
|
|
||||||
return StyledScaffold(
|
return StyledScaffold(
|
||||||
appBar: DefaultAppBar(
|
appBar: DefaultAppBar(
|
||||||
title: Text(!enableSplit && enableRight
|
title: Text(
|
||||||
|
!enableSplit && enableRight
|
||||||
? translate('contacts_dialog.edit_contact')
|
? translate('contacts_dialog.edit_contact')
|
||||||
: translate('contacts_dialog.contacts')),
|
: translate('contacts_dialog.contacts'),
|
||||||
|
),
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: const Icon(Icons.arrow_back),
|
icon: const Icon(Icons.arrow_back),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
@ -60,41 +63,29 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
if (_selectedContact != null)
|
if (_selectedContact != null)
|
||||||
FittedBox(
|
|
||||||
fit: BoxFit.scaleDown,
|
|
||||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.chat_bubble),
|
icon: const Icon(Icons.chat_bubble),
|
||||||
color: appBarIconColor,
|
iconSize: 24,
|
||||||
|
color: appBarTheme.iconColor,
|
||||||
tooltip: translate('contacts_dialog.new_chat'),
|
tooltip: translate('contacts_dialog.new_chat'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await _onChatStarted(_selectedContact!);
|
await _onChatStarted(_selectedContact!);
|
||||||
}),
|
}).paddingLTRB(8, 0, 8, 0),
|
||||||
Text(translate('contacts_dialog.new_chat'),
|
|
||||||
style: theme.textTheme.labelSmall!
|
|
||||||
.copyWith(color: appBarIconColor)),
|
|
||||||
])).paddingLTRB(8, 0, 8, 0),
|
|
||||||
if (enableSplit && _selectedContact != null)
|
if (enableSplit && _selectedContact != null)
|
||||||
FittedBox(
|
|
||||||
fit: BoxFit.scaleDown,
|
|
||||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.close),
|
icon: const Icon(Icons.close),
|
||||||
color: appBarIconColor,
|
iconSize: 24,
|
||||||
|
color: appBarTheme.iconColor,
|
||||||
tooltip: translate('contacts_dialog.close_contact'),
|
tooltip: translate('contacts_dialog.close_contact'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await _onContactSelected(null);
|
await _onContactSelected(null);
|
||||||
}),
|
}).paddingLTRB(8, 0, 8, 0),
|
||||||
Text(translate('contacts_dialog.close_contact'),
|
|
||||||
style: theme.textTheme.labelSmall!
|
|
||||||
.copyWith(color: appBarIconColor)),
|
|
||||||
])).paddingLTRB(8, 0, 8, 0),
|
|
||||||
]),
|
]),
|
||||||
body: LayoutBuilder(builder: (context, constraint) {
|
body: LayoutBuilder(builder: (context, constraint) {
|
||||||
final maxWidth = constraint.maxWidth;
|
final maxWidth = constraint.maxWidth;
|
||||||
|
|
||||||
return ColoredBox(
|
return ColoredBox(
|
||||||
color: scale.primaryScale.appBackground,
|
color: scale.appBackground,
|
||||||
child:
|
child:
|
||||||
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
Offstage(
|
Offstage(
|
||||||
|
@ -104,20 +95,20 @@ class _ContactsPageState extends State<ContactsPage> {
|
||||||
? maxWidth
|
? maxWidth
|
||||||
: (maxWidth / 3).clamp(200, 500),
|
: (maxWidth / 3).clamp(200, 500),
|
||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration:
|
||||||
color: scale.primaryScale.subtleBackground),
|
BoxDecoration(color: scale.subtleBackground),
|
||||||
child: ContactsBrowser(
|
child: ContactsBrowser(
|
||||||
selectedContactRecordKey: _selectedContact
|
selectedContactRecordKey: _selectedContact
|
||||||
?.localConversationRecordKey
|
?.localConversationRecordKey
|
||||||
.toVeilid(),
|
.toVeilid(),
|
||||||
onContactSelected: _onContactSelected,
|
onContactSelected: _onContactSelected,
|
||||||
onStartChat: _onChatStarted,
|
onStartChat: _onChatStarted,
|
||||||
).paddingLTRB(8, 0, 8, 8)))),
|
).paddingLTRB(4, 0, 4, 8)))),
|
||||||
if (enableRight && enableLeft)
|
if (enableRight && enableLeft)
|
||||||
Container(
|
Container(
|
||||||
constraints:
|
constraints:
|
||||||
const BoxConstraints(minWidth: 1, maxWidth: 1),
|
const BoxConstraints(minWidth: 1, maxWidth: 1),
|
||||||
color: scale.primaryScale.subtleBorder),
|
color: scale.subtleBorder),
|
||||||
if (enableRight)
|
if (enableRight)
|
||||||
if (_selectedContact == null)
|
if (_selectedContact == null)
|
||||||
const NoContactWidget().expanded()
|
const NoContactWidget().expanded()
|
||||||
|
|
|
@ -4,9 +4,12 @@ import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
|
||||||
class DefaultAppBar extends AppBar {
|
class DefaultAppBar extends AppBar {
|
||||||
DefaultAppBar(
|
DefaultAppBar(
|
||||||
{required super.title, super.key, Widget? leading, super.actions})
|
{super.title,
|
||||||
|
super.flexibleSpace,
|
||||||
|
super.key,
|
||||||
|
Widget? leading,
|
||||||
|
super.actions})
|
||||||
: super(
|
: super(
|
||||||
titleSpacing: 0,
|
|
||||||
leading: leading ??
|
leading: leading ??
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.all(4),
|
margin: const EdgeInsets.all(4),
|
||||||
|
@ -14,6 +17,6 @@ class DefaultAppBar extends AppBar {
|
||||||
color: Colors.black.withAlpha(32),
|
color: Colors.black.withAlpha(32),
|
||||||
shape: BoxShape.circle),
|
shape: BoxShape.circle),
|
||||||
child:
|
child:
|
||||||
SvgPicture.asset('assets/images/vlogo.svg', height: 32)
|
SvgPicture.asset('assets/images/vlogo.svg', height: 24)
|
||||||
.paddingAll(4)));
|
.paddingAll(4)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ class _HomeAccountReadyState extends State<HomeAccountReady> {
|
||||||
color: scaleConfig.preferBorders
|
color: scaleConfig.preferBorders
|
||||||
? scale.primaryScale.border
|
? scale.primaryScale.border
|
||||||
: scale.primaryScale.borderText,
|
: scale.primaryScale.borderText,
|
||||||
constraints: const BoxConstraints.expand(height: 48, width: 48),
|
constraints: const BoxConstraints.expand(height: 40, width: 40),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: WidgetStateProperty.all(
|
backgroundColor: WidgetStateProperty.all(
|
||||||
scaleConfig.preferBorders
|
scaleConfig.preferBorders
|
||||||
|
@ -50,7 +50,7 @@ class _HomeAccountReadyState extends State<HomeAccountReady> {
|
||||||
: scale.primaryScale.borderText,
|
: scale.primaryScale.borderText,
|
||||||
width: 2),
|
width: 2),
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(12 * scaleConfig.borderRadiusScale))),
|
Radius.circular(8 * scaleConfig.borderRadiusScale))),
|
||||||
)),
|
)),
|
||||||
tooltip: translate('menu.accounts_menu_tooltip'),
|
tooltip: translate('menu.accounts_menu_tooltip'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
@ -68,7 +68,7 @@ class _HomeAccountReadyState extends State<HomeAccountReady> {
|
||||||
color: scaleConfig.preferBorders
|
color: scaleConfig.preferBorders
|
||||||
? scale.primaryScale.border
|
? scale.primaryScale.border
|
||||||
: scale.primaryScale.borderText,
|
: scale.primaryScale.borderText,
|
||||||
constraints: const BoxConstraints.expand(height: 48, width: 48),
|
constraints: const BoxConstraints.expand(height: 40, width: 40),
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
backgroundColor: WidgetStateProperty.all(
|
backgroundColor: WidgetStateProperty.all(
|
||||||
scaleConfig.preferBorders
|
scaleConfig.preferBorders
|
||||||
|
@ -85,7 +85,7 @@ class _HomeAccountReadyState extends State<HomeAccountReady> {
|
||||||
: scale.primaryScale.borderText,
|
: scale.primaryScale.borderText,
|
||||||
width: 2),
|
width: 2),
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(12 * scaleConfig.borderRadiusScale))),
|
Radius.circular(8 * scaleConfig.borderRadiusScale))),
|
||||||
)),
|
)),
|
||||||
tooltip: translate('menu.contacts_tooltip'),
|
tooltip: translate('menu.contacts_tooltip'),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
|
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_input_decorator_theme.dart';
|
||||||
import 'scale_scheme.dart';
|
import 'scale_scheme.dart';
|
||||||
|
|
||||||
|
export 'scale_app_bar_theme.dart';
|
||||||
export 'scale_color.dart';
|
export 'scale_color.dart';
|
||||||
export 'scale_input_decorator_theme.dart';
|
export 'scale_input_decorator_theme.dart';
|
||||||
export 'scale_scheme.dart';
|
export 'scale_scheme.dart';
|
||||||
|
@ -138,7 +139,9 @@ class ScaleTheme extends ThemeExtension<ScaleTheme> {
|
||||||
})),
|
})),
|
||||||
appBarTheme: baseThemeData.appBarTheme.copyWith(
|
appBarTheme: baseThemeData.appBarTheme.copyWith(
|
||||||
backgroundColor: scheme.primaryScale.border,
|
backgroundColor: scheme.primaryScale.border,
|
||||||
foregroundColor: scheme.primaryScale.borderText),
|
foregroundColor: scheme.primaryScale.borderText,
|
||||||
|
toolbarHeight: 40,
|
||||||
|
),
|
||||||
bottomSheetTheme: baseThemeData.bottomSheetTheme.copyWith(
|
bottomSheetTheme: baseThemeData.bottomSheetTheme.copyWith(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
modalElevation: 0,
|
modalElevation: 0,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'scale_scheme.dart';
|
|
||||||
import 'scale_theme.dart';
|
import 'scale_theme.dart';
|
||||||
|
|
||||||
class ScaleTileTheme {
|
class ScaleTileTheme {
|
||||||
|
|
|
@ -125,15 +125,13 @@ class SliderTile extends StatelessWidget {
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
dense: true,
|
dense: true,
|
||||||
visualDensity:
|
|
||||||
const VisualDensity(horizontal: -4, vertical: -4),
|
|
||||||
title: Text(
|
title: Text(
|
||||||
title,
|
title,
|
||||||
overflow: TextOverflow.fade,
|
overflow: TextOverflow.fade,
|
||||||
softWrap: false,
|
softWrap: false,
|
||||||
),
|
),
|
||||||
subtitle: subtitle.isNotEmpty ? Text(subtitle) : null,
|
subtitle: subtitle.isNotEmpty ? Text(subtitle) : null,
|
||||||
minTileHeight: 48,
|
minTileHeight: 52,
|
||||||
iconColor: scaleTileTheme.textColor,
|
iconColor: scaleTileTheme.textColor,
|
||||||
textColor: scaleTileTheme.textColor,
|
textColor: scaleTileTheme.textColor,
|
||||||
leading:
|
leading:
|
||||||
|
|
|
@ -14,10 +14,18 @@ Widget buildSettingsPageWallpaperPreferences(
|
||||||
required ThemeSwitcherState switcher}) {
|
required ThemeSwitcherState switcher}) {
|
||||||
final preferencesRepository = PreferencesRepository.instance;
|
final preferencesRepository = PreferencesRepository.instance;
|
||||||
final themePreferences = preferencesRepository.value.themePreference;
|
final themePreferences = preferencesRepository.value.themePreference;
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final scale = theme.extension<ScaleScheme>()!;
|
||||||
|
final textTheme = theme.textTheme;
|
||||||
|
|
||||||
return FormBuilderCheckbox(
|
return FormBuilderCheckbox(
|
||||||
name: formFieldEnableWallpaper,
|
name: formFieldEnableWallpaper,
|
||||||
title: Text(translate('settings_page.enable_wallpaper')),
|
title: Text(translate('settings_page.enable_wallpaper'),
|
||||||
|
style: textTheme.labelMedium),
|
||||||
initialValue: themePreferences.enableWallpaper,
|
initialValue: themePreferences.enableWallpaper,
|
||||||
|
side: BorderSide(color: scale.primaryScale.border, width: 2),
|
||||||
|
checkColor: scale.primaryScale.borderText,
|
||||||
|
activeColor: scale.primaryScale.border,
|
||||||
onChanged: (value) async {
|
onChanged: (value) async {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
final newThemePrefs =
|
final newThemePrefs =
|
||||||
|
|
|
@ -442,7 +442,7 @@ Widget styledTitleContainer({
|
||||||
color: borderColor ?? scale.primaryScale.border,
|
color: borderColor ?? scale.primaryScale.border,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(12 * scaleConfig.borderRadiusScale),
|
BorderRadius.circular(8 * scaleConfig.borderRadiusScale),
|
||||||
)),
|
)),
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Text(
|
Text(
|
||||||
|
@ -456,7 +456,7 @@ Widget styledTitleContainer({
|
||||||
backgroundColor ?? scale.primaryScale.subtleBackground,
|
backgroundColor ?? scale.primaryScale.subtleBackground,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
12 * scaleConfig.borderRadiusScale),
|
8 * scaleConfig.borderRadiusScale),
|
||||||
)),
|
)),
|
||||||
child: child)
|
child: child)
|
||||||
.paddingAll(4)
|
.paddingAll(4)
|
||||||
|
|
|
@ -176,10 +176,9 @@ flutter:
|
||||||
- assets/images/splash.svg
|
- assets/images/splash.svg
|
||||||
- assets/images/title.svg
|
- assets/images/title.svg
|
||||||
- assets/images/vlogo.svg
|
- assets/images/vlogo.svg
|
||||||
|
- assets/images/toilet.svg
|
||||||
# Raster Images
|
# Raster Images
|
||||||
- assets/images/ellet.png
|
- assets/images/ellet.png
|
||||||
- assets/images/handshake.png
|
|
||||||
- assets/images/toilet.png
|
|
||||||
# Printing
|
# Printing
|
||||||
- assets/js/pdf/3.2.146/pdf.min.js
|
- assets/js/pdf/3.2.146/pdf.min.js
|
||||||
# Sounds
|
# Sounds
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue