minor ui cleanups

This commit is contained in:
Christien Rioux 2024-08-01 16:03:50 -05:00
parent e2f810f6e5
commit 079efb02b9
7 changed files with 43 additions and 39 deletions

View File

@ -15,13 +15,13 @@ import '../chat_list.dart';
class ChatListWidget extends StatelessWidget {
const ChatListWidget({super.key});
Widget _itemBuilderDirect(proto.DirectChat direct,
IMap<proto.TypedKey, proto.Contact> contactMap, bool busy) {
Widget _itemBuilderDirect(
proto.DirectChat direct, IMap<proto.TypedKey, proto.Contact> contactMap) {
final contact = contactMap[direct.localConversationRecordKey];
if (contact == null) {
return const Text('...');
}
return ChatSingleContactItemWidget(contact: contact, disabled: busy)
return ChatSingleContactItemWidget(contact: contact)
.paddingLTRB(0, 4, 0, 0);
}
@ -70,8 +70,10 @@ class ChatListWidget extends StatelessWidget {
itemBuilder: (c) {
switch (c.whichKind()) {
case proto.Chat_Kind.direct:
return _itemBuilderDirect(c.direct, contactMap,
contactListV.busy || chatListV.busy);
return _itemBuilderDirect(
c.direct,
contactMap,
);
case proto.Chat_Kind.group:
return const Text(
'group chats not yet supported!');

View File

@ -11,7 +11,7 @@ import '../chat_list.dart';
class ChatSingleContactItemWidget extends StatelessWidget {
const ChatSingleContactItemWidget({
required proto.Contact contact,
required bool disabled,
bool disabled = false,
super.key,
}) : _contact = contact,
_disabled = disabled;

View File

@ -242,7 +242,7 @@ class _ContactsBrowserState extends State<ContactsBrowser>
contact: contact,
selected: widget.selectedContactRecordKey ==
contact.localConversationRecordKey.toVeilid(),
disabled: ciBusy,
disabled: false,
onTap: _onTapContact,
onDoubleTap: _onStartChat,
onDelete: _onDeleteContact)
@ -250,7 +250,7 @@ class _ContactsBrowserState extends State<ContactsBrowser>
case ContactsBrowserElementKind.invitation:
final invitation = element.invitation!;
return ContactInvitationItemWidget(
contactInvitationRecord: invitation, disabled: cilBusy)
contactInvitationRecord: invitation, disabled: false)
.paddingLTRB(0, 4, 0, 0);
}
},

View File

@ -55,8 +55,6 @@ class MenuItemWidget extends StatelessWidget {
}),
shape: WidgetStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius ?? 0)))),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
@ -83,7 +81,7 @@ class MenuItemWidget extends StatelessWidget {
onPressed: footerCallback),
],
),
));
);
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {

View File

@ -230,7 +230,7 @@ class HomeScreenState extends State<HomeScreen>
menuScreenTapClose: canClose,
mainScreenTapClose: canClose,
disableDragGesture: !canClose,
mainScreenScale: .15,
mainScreenScale: .25,
slideWidth: min(360, MediaQuery.of(context).size.width * 0.9),
)));
}

View File

@ -14,6 +14,10 @@ const kMobileWidthCutoff = 500.0;
bool isMobileWidth(BuildContext context) =>
MediaQuery.of(context).size.width < kMobileWidthCutoff;
bool isMobileSize(BuildContext context) =>
MediaQuery.of(context).size.width < kMobileWidthCutoff ||
MediaQuery.of(context).size.height < kMobileWidthCutoff;
bool responsiveVisibility({
required BuildContext context,
bool phone = true,

View File

@ -12,7 +12,7 @@ class StyledScaffold extends StatelessWidget {
final scale = theme.extension<ScaleScheme>()!;
final scaleConfig = theme.extension<ScaleConfig>()!;
final enableBorder = !isMobileWidth(context);
final enableBorder = !isMobileSize(context);
final scaffold = clipBorder(
clipEnabled: enableBorder,