more cleanup

This commit is contained in:
Christien Rioux 2023-09-24 15:30:54 -04:00
parent 03c6560e60
commit 7831deabd3
18 changed files with 157 additions and 130 deletions

View File

@ -106,7 +106,7 @@
"chat_list": { "chat_list": {
"search": "Search", "search": "Search",
"start_a_conversation": "Start a conversation", "start_a_conversation": "Start a conversation",
"conversations": "Conversations", "chats": "Chats",
"groups": "Groups" "groups": "Groups"
}, },
"themes": { "themes": {

View File

@ -47,6 +47,8 @@ class BottomSheetActionButtonState
// //
return _showFab return _showFab
? FloatingActionButton( ? FloatingActionButton(
elevation: 0,
hoverElevation: 0,
shape: widget.shape, shape: widget.shape,
foregroundColor: widget.foregroundColor, foregroundColor: widget.foregroundColor,
backgroundColor: widget.backgroundColor, backgroundColor: widget.backgroundColor,

View File

@ -12,8 +12,7 @@ import '../entities/identity.dart';
import '../providers/account.dart'; import '../providers/account.dart';
import '../providers/chat.dart'; import '../providers/chat.dart';
import '../providers/conversation.dart'; import '../providers/conversation.dart';
import '../tools/theme_service.dart'; import '../tools/tools.dart';
import '../tools/widget_helpers.dart';
import '../veilid_support/veilid_support.dart'; import '../veilid_support/veilid_support.dart';
class ChatComponent extends ConsumerStatefulWidget { class ChatComponent extends ConsumerStatefulWidget {
@ -121,8 +120,8 @@ class ChatComponentState extends ConsumerState<ChatComponent> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final theme = Theme.of(context); final theme = Theme.of(context);
final scale = theme.extension<ScaleScheme>()!; final scale = theme.extension<ScaleScheme>()!;
final chatTheme = scale.toChatTheme();
final textTheme = Theme.of(context).textTheme; final textTheme = Theme.of(context).textTheme;
final chatTheme = makeChatTheme(scale, textTheme);
final contactName = widget.activeChatContact.editedProfile.name; final contactName = widget.activeChatContact.editedProfile.name;
final protoMessages = final protoMessages =
@ -147,7 +146,7 @@ class ChatComponentState extends ConsumerState<ChatComponent> {
Container( Container(
height: 48, height: 48,
decoration: BoxDecoration( decoration: BoxDecoration(
color: scale.primaryScale.subtleBackground, color: scale.primaryScale.subtleBorder,
), ),
child: Row(children: [ child: Row(children: [
Align( Align(
@ -159,7 +158,7 @@ class ChatComponentState extends ConsumerState<ChatComponent> {
textAlign: TextAlign.start, textAlign: TextAlign.start,
style: textTheme.titleMedium), style: textTheme.titleMedium),
)), )),
Spacer(), const Spacer(),
IconButton( IconButton(
icon: const Icon(Icons.close), icon: const Icon(Icons.close),
onPressed: () async { onPressed: () async {
@ -168,7 +167,7 @@ class ChatComponentState extends ConsumerState<ChatComponent> {
]), ]),
), ),
Expanded( Expanded(
child: Container( child: DecoratedBox(
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
child: Chat( child: Chat(
theme: chatTheme, theme: chatTheme,
@ -180,8 +179,8 @@ class ChatComponentState extends ConsumerState<ChatComponent> {
onSendPressed: (message) { onSendPressed: (message) {
unawaited(_handleSendPressed(message)); unawaited(_handleSendPressed(message));
}, },
showUserAvatars: true, //showUserAvatars: false,
showUserNames: true, //showUserNames: true,
user: _localUser, user: _localUser,
), ),
), ),

View File

@ -28,12 +28,12 @@ class ChatSingleContactItemWidget extends ConsumerWidget {
final selected = activeChat == remoteConversationRecordKey; final selected = activeChat == remoteConversationRecordKey;
return Container( return Container(
margin: const EdgeInsets.fromLTRB(4, 4, 4, 0), margin: const EdgeInsets.fromLTRB(0, 4, 0, 0),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.tertiaryScale.subtleBackground, color: scale.tertiaryScale.subtleBorder,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(8),
)), )),
child: Slidable( child: Slidable(
key: ObjectKey(contact), key: ObjectKey(contact),

View File

@ -29,54 +29,57 @@ class ChatSingleContactListWidget extends ConsumerWidget {
// ignore: prefer_expression_function_bodies // ignore: prefer_expression_function_bodies
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context); final theme = Theme.of(context);
final textTheme = theme.textTheme; //final textTheme = theme.textTheme;
final scale = theme.extension<ScaleScheme>()!; final scale = theme.extension<ScaleScheme>()!;
return Container( return SizedBox.expand(
width: double.infinity, child: styledTitleContainer(
decoration: ShapeDecoration( context: context,
color: scale.grayScale.appBackground, title: translate('chat_list.chats'),
shape: RoundedRectangleBorder( child: SizedBox.expand(
borderRadius: BorderRadius.circular(16), child: (chatList.isEmpty)
)), ? const EmptyChatListWidget()
child: (chatList.isEmpty) : SearchableList<proto.Chat>(
? const EmptyChatListWidget() autoFocusOnSearch: false,
: SearchableList<proto.Chat>( initialList: chatList.toList(),
autoFocusOnSearch: false, builder: (l, i, c) {
initialList: chatList.toList(), final contact =
builder: (l, i, c) { contactMap[c.remoteConversationKey];
final contact = contactMap[c.remoteConversationKey]; if (contact == null) {
if (contact == null) { return const Text('...');
return const Text('...'); }
} return ChatSingleContactItemWidget(
return ChatSingleContactItemWidget(contact: contact); contact: contact);
}, },
filter: (value) { filter: (value) {
final lowerValue = value.toLowerCase(); final lowerValue = value.toLowerCase();
return chatList.where((c) { return chatList.where((c) {
final contact = contactMap[c.remoteConversationKey]; final contact =
if (contact == null) { contactMap[c.remoteConversationKey];
return false; if (contact == null) {
} return false;
return contact.editedProfile.name }
.toLowerCase() return contact.editedProfile.name
.contains(lowerValue) || .toLowerCase()
contact.editedProfile.title .contains(lowerValue) ||
.toLowerCase() contact.editedProfile.title
.contains(lowerValue); .toLowerCase()
}).toList(); .contains(lowerValue);
}, }).toList();
inputDecoration: InputDecoration( },
labelText: translate('chat_list.search'), spaceBetweenSearchAndList: 4,
fillColor: Colors.white, inputDecoration: InputDecoration(
focusedBorder: OutlineInputBorder( labelText: translate('chat_list.search'),
borderSide: const BorderSide( contentPadding: const EdgeInsets.all(2),
color: Colors.blue, fillColor: scale.primaryScale.text,
), focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10), borderSide: BorderSide(
), color: scale.primaryScale.hoverBorder,
), ),
), borderRadius: BorderRadius.circular(8),
).paddingLTRB(8, 8, 8, 65); ),
),
).paddingAll(8))))
.paddingLTRB(8, 8, 8, 65);
} }
} }

View File

@ -33,9 +33,9 @@ class ContactInvitationItemWidget extends ConsumerWidget {
margin: const EdgeInsets.fromLTRB(4, 4, 4, 0), margin: const EdgeInsets.fromLTRB(4, 4, 4, 0),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.tertiaryScale.subtleBackground, color: scale.tertiaryScale.subtleBorder,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(8),
)), )),
child: Slidable( child: Slidable(
// Specify a key if the Slidable is dismissible. // Specify a key if the Slidable is dismissible.

View File

@ -33,11 +33,11 @@ class ContactInvitationListWidgetState
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: const EdgeInsets.fromLTRB(4, 0, 4, 4),
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.primaryScale.subtleBorder,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
)), )),
constraints: const BoxConstraints(maxHeight: 200), constraints: const BoxConstraints(maxHeight: 200),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -47,9 +47,8 @@ class ContactInvitationListWidgetState
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.primaryScale.subtleBackground, color: scale.primaryScale.subtleBackground,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
side: BorderSide( )),
color: scale.primaryScale.subtleBorder, width: 4))),
child: ListView.builder( child: ListView.builder(
controller: _scrollController, controller: _scrollController,
itemCount: widget.contactInvitationRecordList.length, itemCount: widget.contactInvitationRecordList.length,
@ -75,7 +74,7 @@ class ContactInvitationListWidgetState
return index; return index;
}, },
shrinkWrap: true, shrinkWrap: true,
)) ).paddingLTRB(0, 0, 0, 4))
], ],
), ),
); );

View File

@ -27,12 +27,12 @@ class ContactItemWidget extends ConsumerWidget {
proto.TypedKeyProto.fromProto(contact.remoteConversationRecordKey); proto.TypedKeyProto.fromProto(contact.remoteConversationRecordKey);
return Container( return Container(
margin: const EdgeInsets.fromLTRB(4, 4, 4, 0), margin: const EdgeInsets.fromLTRB(0, 4, 0, 0),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.tertiaryScale.subtleBackground, color: scale.tertiaryScale.subtleBorder,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(8),
)), )),
child: Slidable( child: Slidable(
key: ObjectKey(contact), key: ObjectKey(contact),

View File

@ -22,8 +22,11 @@ class ContactListWidget extends ConsumerWidget {
} }
@override @override
// ignore: prefer_expression_function_bodies
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final theme = Theme.of(context);
//final textTheme = theme.textTheme;
final scale = theme.extension<ScaleScheme>()!;
return SizedBox.expand( return SizedBox.expand(
child: styledTitleContainer( child: styledTitleContainer(
context: context, context: context,
@ -33,7 +36,6 @@ class ContactListWidget extends ConsumerWidget {
? const EmptyContactListWidget() ? const EmptyContactListWidget()
: SearchableList<proto.Contact>( : SearchableList<proto.Contact>(
autoFocusOnSearch: false, autoFocusOnSearch: false,
shrinkWrap: true,
initialList: contactList.toList(), initialList: contactList.toList(),
builder: (l, i, c) => ContactItemWidget(contact: c), builder: (l, i, c) => ContactItemWidget(contact: c),
filter: (value) { filter: (value) {
@ -48,17 +50,19 @@ class ContactListWidget extends ConsumerWidget {
.contains(lowerValue)) .contains(lowerValue))
.toList(); .toList();
}, },
spaceBetweenSearchAndList: 4,
inputDecoration: InputDecoration( inputDecoration: InputDecoration(
labelText: translate('contact_list.search'), labelText: translate('contact_list.search'),
fillColor: Colors.white, contentPadding: const EdgeInsets.all(2),
fillColor: scale.primaryScale.text,
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: const BorderSide( borderSide: BorderSide(
color: Colors.blue, color: scale.primaryScale.hoverBorder,
), ),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(8),
), ),
), ),
), ).paddingAll(8),
))).paddingLTRB(8, 0, 8, 8); ))).paddingLTRB(8, 0, 8, 8);
} }
} }

View File

@ -26,11 +26,9 @@ class ProfileWidget extends ConsumerWidget {
return DecoratedBox( return DecoratedBox(
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.primaryScale.subtleBorder, color: scale.primaryScale.border,
shape: RoundedRectangleBorder( shape:
borderRadius: BorderRadius.circular(16), RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
side: BorderSide(
width: 0, color: scale.primaryScale.subtleBorder))),
child: Column(children: [ child: Column(children: [
Text( Text(
name, name,

View File

@ -114,8 +114,8 @@ class HomePageState extends ConsumerState<HomePage>
color: scale.secondaryScale.text, color: scale.secondaryScale.text,
constraints: const BoxConstraints.expand(height: 64, width: 64), constraints: const BoxConstraints.expand(height: 64, width: 64),
style: ButtonStyle( style: ButtonStyle(
backgroundColor: MaterialStateProperty.all( backgroundColor:
scale.secondaryScale.subtleBorder), MaterialStateProperty.all(scale.secondaryScale.border),
shape: MaterialStateProperty.all(const RoundedRectangleBorder( shape: MaterialStateProperty.all(const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16))))), borderRadius: BorderRadius.all(Radius.circular(16))))),
tooltip: translate('app_bar.settings_tooltip'), tooltip: translate('app_bar.settings_tooltip'),
@ -212,12 +212,19 @@ class HomePageState extends ConsumerState<HomePage>
// ignore: prefer_expression_function_bodies // ignore: prefer_expression_function_bodies
Widget buildTablet(BuildContext context) { Widget buildTablet(BuildContext context) {
final w = MediaQuery.of(context).size.width; final w = MediaQuery.of(context).size.width;
final theme = Theme.of(context);
final scale = theme.extension<ScaleScheme>()!;
final children = [ final children = [
ConstrainedBox( ConstrainedBox(
constraints: const BoxConstraints(minWidth: 300, maxWidth: 300), constraints: const BoxConstraints(minWidth: 300, maxWidth: 300),
child: ConstrainedBox( child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: w / 2), constraints: BoxConstraints(maxWidth: w / 2),
child: buildTabletLeftPane(context))), child: buildTabletLeftPane(context))),
SizedBox(
width: 2,
height: double.infinity,
child: ColoredBox(color: scale.primaryScale.hoverBorder)),
Expanded(child: buildTabletRightPane(context)), Expanded(child: buildTabletRightPane(context)),
]; ];
@ -247,8 +254,8 @@ class HomePageState extends ConsumerState<HomePage>
child: GestureDetector( child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(_unfocusNode), onTap: () => FocusScope.of(context).requestFocus(_unfocusNode),
child: DecoratedBox( child: DecoratedBox(
decoration: decoration: BoxDecoration(
BoxDecoration(color: scale.primaryScale.elementBackground), color: scale.primaryScale.activeElementBackground),
child: responsiveVisibility( child: responsiveVisibility(
context: context, context: context,
phone: false, phone: false,

View File

@ -62,8 +62,8 @@ class AccountPageState extends ConsumerState<AccountPage> {
if (contactInvitationRecordList.isNotEmpty) if (contactInvitationRecordList.isNotEmpty)
ExpansionTile( ExpansionTile(
tilePadding: EdgeInsets.fromLTRB(8, 0, 8, 0), tilePadding: EdgeInsets.fromLTRB(8, 0, 8, 0),
backgroundColor: scale.primaryScale.subtleBorder, backgroundColor: scale.primaryScale.border,
collapsedBackgroundColor: scale.primaryScale.subtleBorder, collapsedBackgroundColor: scale.primaryScale.border,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
), ),

View File

@ -8,6 +8,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_animate/flutter_animate.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_translate/flutter_translate.dart'; import 'package:flutter_translate/flutter_translate.dart';
import 'package:preload_page_view/preload_page_view.dart';
import 'package:stylish_bottom_bar/model/bar_items.dart'; import 'package:stylish_bottom_bar/model/bar_items.dart';
import 'package:stylish_bottom_bar/stylish_bottom_bar.dart'; import 'package:stylish_bottom_bar/stylish_bottom_bar.dart';
@ -47,7 +48,7 @@ class MainPagerState extends ConsumerState<MainPager>
final _unfocusNode = FocusNode(); final _unfocusNode = FocusNode();
var _currentPage = 0; var _currentPage = 0;
final pageController = PageController(); final pageController = PreloadPageController();
final _selectedIconList = <IconData>[Icons.person, Icons.chat]; final _selectedIconList = <IconData>[Icons.person, Icons.chat];
// final _unselectedIconList = <IconData>[ // final _unselectedIconList = <IconData>[
@ -221,14 +222,14 @@ class MainPagerState extends ConsumerState<MainPager>
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
body: NotificationListener<ScrollNotification>( body: NotificationListener<ScrollNotification>(
onNotification: onScrollNotification, onNotification: onScrollNotification,
child: PageView( child: PreloadPageView(
controller: pageController, controller: pageController,
preloadPagesCount: 2,
onPageChanged: (index) { onPageChanged: (index) {
setState(() { setState(() {
_currentPage = index; _currentPage = index;
}); });
}, },
//physics: const NeverScrollableScrollPhysics(),
children: [ children: [
AccountPage( AccountPage(
localAccounts: widget.localAccounts, localAccounts: widget.localAccounts,
@ -244,7 +245,7 @@ class MainPagerState extends ConsumerState<MainPager>
// ), // ),
// ), // ),
bottomNavigationBar: StylishBottomBar( bottomNavigationBar: StylishBottomBar(
backgroundColor: scale.primaryScale.background, backgroundColor: scale.primaryScale.hoverBorder,
// gradient: LinearGradient( // gradient: LinearGradient(
// begin: Alignment.topCenter, // begin: Alignment.topCenter,
// end: Alignment.bottomCenter, // end: Alignment.bottomCenter,
@ -275,7 +276,7 @@ class MainPagerState extends ConsumerState<MainPager>
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(14))), borderRadius: BorderRadius.all(Radius.circular(14))),
//foregroundColor: scale.secondaryScale.text, //foregroundColor: scale.secondaryScale.text,
backgroundColor: scale.secondaryScale.background, backgroundColor: scale.secondaryScale.hoverBorder,
builder: (context) => Icon( builder: (context) => Icon(
_fabIconList[_currentPage], _fabIconList[_currentPage],
color: scale.secondaryScale.text, color: scale.secondaryScale.text,

View File

@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_chat_ui/flutter_chat_ui.dart';
import 'package:radix_colors/radix_colors.dart'; import 'package:radix_colors/radix_colors.dart';
import 'theme_service.dart'; import 'theme_service.dart';
@ -274,7 +275,7 @@ extension ToScaleColor on RadixColor {
subtleBackground: step2, subtleBackground: step2,
elementBackground: step3, elementBackground: step3,
hoverElementBackground: step4, hoverElementBackground: step4,
activedElementBackground: step5, activeElementBackground: step5,
subtleBorder: step6, subtleBorder: step6,
border: step7, border: step7,
hoverBorder: step8, hoverBorder: step8,
@ -507,13 +508,39 @@ ColorScheme _radixColorScheme(Brightness brightness, RadixScheme radix) =>
surfaceTint: radix.primaryAlphaScale.step4, surfaceTint: radix.primaryAlphaScale.step4,
); );
ChatTheme makeChatTheme(ScaleScheme scale, TextTheme textTheme) =>
DefaultChatTheme(
primaryColor: scale.primaryScale.background,
secondaryColor: scale.secondaryScale.background,
backgroundColor: scale.grayScale.subtleBackground,
inputBackgroundColor: Colors.blue,
inputBorderRadius: BorderRadius.zero,
inputTextDecoration: InputDecoration(
filled: true,
fillColor: scale.primaryScale.elementBackground,
isDense: true,
contentPadding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
border: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(16))),
),
inputContainerDecoration: BoxDecoration(color: scale.primaryScale.border),
inputPadding: const EdgeInsets.all(9),
inputTextColor: scale.primaryScale.text,
attachmentButtonIcon: Icon(Icons.attach_file),
);
ThemeData radixGenerator(Brightness brightness, RadixThemeColor themeColor) { ThemeData radixGenerator(Brightness brightness, RadixThemeColor themeColor) {
TextTheme? textTheme; final textTheme = (brightness == Brightness.light)
? Typography.blackCupertino
: Typography.whiteCupertino;
final radix = _radixScheme(brightness, themeColor); final radix = _radixScheme(brightness, themeColor);
final colorScheme = _radixColorScheme(brightness, radix); final colorScheme = _radixColorScheme(brightness, radix);
final scaleScheme = radix.toScale();
return ThemeData.from( return ThemeData.from(
colorScheme: colorScheme, textTheme: textTheme, useMaterial3: true) colorScheme: colorScheme, textTheme: textTheme, useMaterial3: true)
.copyWith(extensions: <ThemeExtension<dynamic>>[ .copyWith(extensions: <ThemeExtension<dynamic>>[
radix.toScale(), scaleScheme,
]); ]);
} }

View File

@ -18,7 +18,7 @@ class ScaleColor {
required this.subtleBackground, required this.subtleBackground,
required this.elementBackground, required this.elementBackground,
required this.hoverElementBackground, required this.hoverElementBackground,
required this.activedElementBackground, required this.activeElementBackground,
required this.subtleBorder, required this.subtleBorder,
required this.border, required this.border,
required this.hoverBorder, required this.hoverBorder,
@ -32,7 +32,7 @@ class ScaleColor {
Color subtleBackground; Color subtleBackground;
Color elementBackground; Color elementBackground;
Color hoverElementBackground; Color hoverElementBackground;
Color activedElementBackground; Color activeElementBackground;
Color subtleBorder; Color subtleBorder;
Color border; Color border;
Color hoverBorder; Color hoverBorder;
@ -46,7 +46,7 @@ class ScaleColor {
Color? subtleBackground, Color? subtleBackground,
Color? elementBackground, Color? elementBackground,
Color? hoverElementBackground, Color? hoverElementBackground,
Color? activedElementBackground, Color? activeElementBackground,
Color? subtleBorder, Color? subtleBorder,
Color? border, Color? border,
Color? hoverBorder, Color? hoverBorder,
@ -60,8 +60,8 @@ class ScaleColor {
elementBackground: elementBackground ?? this.elementBackground, elementBackground: elementBackground ?? this.elementBackground,
hoverElementBackground: hoverElementBackground:
hoverElementBackground ?? this.hoverElementBackground, hoverElementBackground ?? this.hoverElementBackground,
activedElementBackground: activeElementBackground:
activedElementBackground ?? this.activedElementBackground, activeElementBackground ?? this.activeElementBackground,
subtleBorder: subtleBorder ?? this.subtleBorder, subtleBorder: subtleBorder ?? this.subtleBorder,
border: border ?? this.border, border: border ?? this.border,
hoverBorder: hoverBorder ?? this.hoverBorder, hoverBorder: hoverBorder ?? this.hoverBorder,
@ -84,8 +84,8 @@ class ScaleColor {
hoverElementBackground: hoverElementBackground:
Color.lerp(a.hoverElementBackground, b.hoverElementBackground, t) ?? Color.lerp(a.hoverElementBackground, b.hoverElementBackground, t) ??
const Color(0x00000000), const Color(0x00000000),
activedElementBackground: Color.lerp( activeElementBackground: Color.lerp(
a.activedElementBackground, b.activedElementBackground, t) ?? a.activeElementBackground, b.activeElementBackground, t) ??
const Color(0x00000000), const Color(0x00000000),
subtleBorder: Color.lerp(a.subtleBorder, b.subtleBorder, t) ?? subtleBorder: Color.lerp(a.subtleBorder, b.subtleBorder, t) ??
const Color(0x00000000), const Color(0x00000000),
@ -150,28 +150,6 @@ class ScaleScheme extends ThemeExtension<ScaleScheme> {
errorScale: ScaleColor.lerp(errorScale, other.errorScale, t), errorScale: ScaleColor.lerp(errorScale, other.errorScale, t),
); );
} }
ChatTheme toChatTheme() => DefaultChatTheme(
primaryColor: primaryScale.background,
secondaryColor: secondaryScale.background,
backgroundColor: grayScale.appBackground,
inputBackgroundColor: grayScale.subtleBackground,
inputBorderRadius: BorderRadius.zero,
inputTextDecoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryScale.subtleBorder),
borderRadius: const BorderRadius.all(Radius.circular(16))),
),
inputContainerDecoration:
BoxDecoration(color: primaryScale.appBackground),
inputPadding: EdgeInsets.all(5),
inputTextStyle: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
height: 1,
),
attachmentButtonIcon: Icon(Icons.attach_file),
);
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

View File

@ -76,9 +76,9 @@ Widget styledTitleContainer(
final scale = theme.extension<ScaleScheme>()!; final scale = theme.extension<ScaleScheme>()!;
final textTheme = theme.textTheme; final textTheme = theme.textTheme;
return Container( return DecoratedBox(
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.primaryScale.subtleBorder, color: scale.primaryScale.border,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
)), )),
@ -87,7 +87,7 @@ Widget styledTitleContainer(
title, title,
style: textTheme.titleMedium! style: textTheme.titleMedium!
.copyWith(color: scale.primaryScale.subtleText), .copyWith(color: scale.primaryScale.subtleText),
).paddingLTRB(4, 4, 4, 0), ).paddingLTRB(8, 8, 8, 8),
DecoratedBox( DecoratedBox(
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.primaryScale.subtleBackground, color: scale.primaryScale.subtleBackground,
@ -130,7 +130,7 @@ Future<T?> showStyledDialog<T>(
borderRadius: BorderRadius.circular(16))), borderRadius: BorderRadius.circular(16))),
child: DecoratedBox( child: DecoratedBox(
decoration: ShapeDecoration( decoration: ShapeDecoration(
color: scale.primaryScale.subtleBackground, color: scale.primaryScale.appBackground,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12))), borderRadius: BorderRadius.circular(12))),
child: child.paddingAll(0))))); child: child.paddingAll(0)))));

View File

@ -925,6 +925,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.5.1" version: "1.5.1"
preload_page_view:
dependency: "direct main"
description:
name: preload_page_view
sha256: "488a10c158c5c2e9ba9d77e5dbc09b1e49e37a20df2301e5ba02992eac802b7a"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
protobuf: protobuf:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -48,6 +48,7 @@ dependencies:
path: ^1.8.2 path: ^1.8.2
path_provider: ^2.0.11 path_provider: ^2.0.11
pinput: ^3.0.1 pinput: ^3.0.1
preload_page_view: ^0.2.0
protobuf: ^3.0.0 protobuf: ^3.0.0
qr_flutter: ^4.1.0 qr_flutter: ^4.1.0
quickalert: ^1.0.1 quickalert: ^1.0.1