mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-02-18 22:04:22 -05:00
minor ui cleanups
This commit is contained in:
parent
e2f810f6e5
commit
079efb02b9
@ -15,13 +15,13 @@ import '../chat_list.dart';
|
|||||||
class ChatListWidget extends StatelessWidget {
|
class ChatListWidget extends StatelessWidget {
|
||||||
const ChatListWidget({super.key});
|
const ChatListWidget({super.key});
|
||||||
|
|
||||||
Widget _itemBuilderDirect(proto.DirectChat direct,
|
Widget _itemBuilderDirect(
|
||||||
IMap<proto.TypedKey, proto.Contact> contactMap, bool busy) {
|
proto.DirectChat direct, IMap<proto.TypedKey, proto.Contact> contactMap) {
|
||||||
final contact = contactMap[direct.localConversationRecordKey];
|
final contact = contactMap[direct.localConversationRecordKey];
|
||||||
if (contact == null) {
|
if (contact == null) {
|
||||||
return const Text('...');
|
return const Text('...');
|
||||||
}
|
}
|
||||||
return ChatSingleContactItemWidget(contact: contact, disabled: busy)
|
return ChatSingleContactItemWidget(contact: contact)
|
||||||
.paddingLTRB(0, 4, 0, 0);
|
.paddingLTRB(0, 4, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,8 +70,10 @@ class ChatListWidget extends StatelessWidget {
|
|||||||
itemBuilder: (c) {
|
itemBuilder: (c) {
|
||||||
switch (c.whichKind()) {
|
switch (c.whichKind()) {
|
||||||
case proto.Chat_Kind.direct:
|
case proto.Chat_Kind.direct:
|
||||||
return _itemBuilderDirect(c.direct, contactMap,
|
return _itemBuilderDirect(
|
||||||
contactListV.busy || chatListV.busy);
|
c.direct,
|
||||||
|
contactMap,
|
||||||
|
);
|
||||||
case proto.Chat_Kind.group:
|
case proto.Chat_Kind.group:
|
||||||
return const Text(
|
return const Text(
|
||||||
'group chats not yet supported!');
|
'group chats not yet supported!');
|
||||||
|
@ -11,7 +11,7 @@ import '../chat_list.dart';
|
|||||||
class ChatSingleContactItemWidget extends StatelessWidget {
|
class ChatSingleContactItemWidget extends StatelessWidget {
|
||||||
const ChatSingleContactItemWidget({
|
const ChatSingleContactItemWidget({
|
||||||
required proto.Contact contact,
|
required proto.Contact contact,
|
||||||
required bool disabled,
|
bool disabled = false,
|
||||||
super.key,
|
super.key,
|
||||||
}) : _contact = contact,
|
}) : _contact = contact,
|
||||||
_disabled = disabled;
|
_disabled = disabled;
|
||||||
|
@ -242,7 +242,7 @@ class _ContactsBrowserState extends State<ContactsBrowser>
|
|||||||
contact: contact,
|
contact: contact,
|
||||||
selected: widget.selectedContactRecordKey ==
|
selected: widget.selectedContactRecordKey ==
|
||||||
contact.localConversationRecordKey.toVeilid(),
|
contact.localConversationRecordKey.toVeilid(),
|
||||||
disabled: ciBusy,
|
disabled: false,
|
||||||
onTap: _onTapContact,
|
onTap: _onTapContact,
|
||||||
onDoubleTap: _onStartChat,
|
onDoubleTap: _onStartChat,
|
||||||
onDelete: _onDeleteContact)
|
onDelete: _onDeleteContact)
|
||||||
@ -250,7 +250,7 @@ class _ContactsBrowserState extends State<ContactsBrowser>
|
|||||||
case ContactsBrowserElementKind.invitation:
|
case ContactsBrowserElementKind.invitation:
|
||||||
final invitation = element.invitation!;
|
final invitation = element.invitation!;
|
||||||
return ContactInvitationItemWidget(
|
return ContactInvitationItemWidget(
|
||||||
contactInvitationRecord: invitation, disabled: cilBusy)
|
contactInvitationRecord: invitation, disabled: false)
|
||||||
.paddingLTRB(0, 4, 0, 0);
|
.paddingLTRB(0, 4, 0, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -55,8 +55,6 @@ class MenuItemWidget extends StatelessWidget {
|
|||||||
}),
|
}),
|
||||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(borderRadius ?? 0)))),
|
borderRadius: BorderRadius.circular(borderRadius ?? 0)))),
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@ -83,7 +81,7 @@ class MenuItemWidget extends StatelessWidget {
|
|||||||
onPressed: footerCallback),
|
onPressed: footerCallback),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||||
|
@ -230,7 +230,7 @@ class HomeScreenState extends State<HomeScreen>
|
|||||||
menuScreenTapClose: canClose,
|
menuScreenTapClose: canClose,
|
||||||
mainScreenTapClose: canClose,
|
mainScreenTapClose: canClose,
|
||||||
disableDragGesture: !canClose,
|
disableDragGesture: !canClose,
|
||||||
mainScreenScale: .15,
|
mainScreenScale: .25,
|
||||||
slideWidth: min(360, MediaQuery.of(context).size.width * 0.9),
|
slideWidth: min(360, MediaQuery.of(context).size.width * 0.9),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,10 @@ const kMobileWidthCutoff = 500.0;
|
|||||||
bool isMobileWidth(BuildContext context) =>
|
bool isMobileWidth(BuildContext context) =>
|
||||||
MediaQuery.of(context).size.width < kMobileWidthCutoff;
|
MediaQuery.of(context).size.width < kMobileWidthCutoff;
|
||||||
|
|
||||||
|
bool isMobileSize(BuildContext context) =>
|
||||||
|
MediaQuery.of(context).size.width < kMobileWidthCutoff ||
|
||||||
|
MediaQuery.of(context).size.height < kMobileWidthCutoff;
|
||||||
|
|
||||||
bool responsiveVisibility({
|
bool responsiveVisibility({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
bool phone = true,
|
bool phone = true,
|
||||||
|
@ -12,7 +12,7 @@ class StyledScaffold extends StatelessWidget {
|
|||||||
final scale = theme.extension<ScaleScheme>()!;
|
final scale = theme.extension<ScaleScheme>()!;
|
||||||
final scaleConfig = theme.extension<ScaleConfig>()!;
|
final scaleConfig = theme.extension<ScaleConfig>()!;
|
||||||
|
|
||||||
final enableBorder = !isMobileWidth(context);
|
final enableBorder = !isMobileSize(context);
|
||||||
|
|
||||||
final scaffold = clipBorder(
|
final scaffold = clipBorder(
|
||||||
clipEnabled: enableBorder,
|
clipEnabled: enableBorder,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user