🐛 Fix some styling issues

This commit is contained in:
2025-11-30 15:42:51 +08:00
parent 4a7ff96a8b
commit 7bc44e8f06
4 changed files with 135 additions and 107 deletions

View File

@@ -654,70 +654,88 @@ class ChatRoomScreen extends HookConsumerWidget {
}
}
Widget chatMessageListWidget(
List<LocalChatMessage> messageList,
) => AnimatedPadding(
duration: const Duration(milliseconds: 200),
curve: Curves.easeOut,
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom + 8 + inputHeight.value,
),
child: SuperListView.builder(
listController: listController,
controller: scrollController,
reverse: true, // Show newest messages at the bottom
itemCount: messageList.length,
findChildIndexCallback: (key) {
if (key is! ValueKey<String>) return null;
final messageId = key.value.substring(messageKeyPrefix.length);
final index = messageList.indexWhere(
(m) => (m.nonce ?? m.id) == messageId,
);
return index >= 0 ? index : null;
},
extentEstimation: (_, _) => 40,
itemBuilder: (context, index) {
final message = messageList[index];
final nextMessage =
index < messageList.length - 1 ? messageList[index + 1] : null;
final isLastInGroup =
nextMessage == null ||
nextMessage.senderId != message.senderId ||
nextMessage.createdAt
.difference(message.createdAt)
.inMinutes
.abs() >
3;
final key = Key('$messageKeyPrefix${message.nonce ?? message.id}');
return MessageItemWrapper(
key: key,
message: message,
index: index,
isLastInGroup: isLastInGroup,
isSelectionMode: isSelectionMode.value,
selectedMessages: selectedMessages.value,
chatIdentity: chatIdentity,
toggleSelectionMode: toggleSelectionMode,
toggleMessageSelection: toggleMessageSelection,
onMessageAction: onMessageAction,
onJump:
(messageId) => scrollToMessage(
messageId: messageId,
messageList: messageList,
messagesNotifier: messagesNotifier,
listController: listController,
scrollController: scrollController,
ref: ref,
Widget chatMessageListWidget(List<LocalChatMessage> messageList) =>
ValueListenableBuilder<double>(
valueListenable: inputHeight,
builder: (context, height, child) {
return TweenAnimationBuilder<EdgeInsets>(
duration: const Duration(milliseconds: 200),
curve: Curves.easeOut,
tween: EdgeInsetsTween(
begin: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom + 8 + height,
),
attachmentProgress: attachmentProgress.value,
disableAnimation: settings.disableAnimation,
roomOpenTime: roomOpenTime,
);
},
),
);
end: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom + 8 + height,
),
),
builder: (context, padding, child) {
return SuperListView.builder(
listController: listController,
controller: scrollController,
reverse: true, // Show newest messages at the bottom
padding: padding,
itemCount: messageList.length,
findChildIndexCallback: (key) {
if (key is! ValueKey<String>) return null;
final messageId = key.value.substring(
messageKeyPrefix.length,
);
final index = messageList.indexWhere(
(m) => (m.nonce ?? m.id) == messageId,
);
return index >= 0 ? index : null;
},
extentEstimation: (_, _) => 40,
itemBuilder: (context, index) {
final message = messageList[index];
final nextMessage =
index < messageList.length - 1
? messageList[index + 1]
: null;
final isLastInGroup =
nextMessage == null ||
nextMessage.senderId != message.senderId ||
nextMessage.createdAt
.difference(message.createdAt)
.inMinutes
.abs() >
3;
final key = Key(
'$messageKeyPrefix${message.nonce ?? message.id}',
);
return MessageItemWrapper(
key: key,
message: message,
index: index,
isLastInGroup: isLastInGroup,
isSelectionMode: isSelectionMode.value,
selectedMessages: selectedMessages.value,
chatIdentity: chatIdentity,
toggleSelectionMode: toggleSelectionMode,
toggleMessageSelection: toggleMessageSelection,
onMessageAction: onMessageAction,
onJump:
(messageId) => scrollToMessage(
messageId: messageId,
messageList: messageList,
messagesNotifier: messagesNotifier,
listController: listController,
scrollController: scrollController,
ref: ref,
),
attachmentProgress: attachmentProgress.value,
disableAnimation: settings.disableAnimation,
roomOpenTime: roomOpenTime,
);
},
);
},
);
},
);
return AppScaffold(
appBar: AppBar(

View File

@@ -109,40 +109,44 @@ class DeveloperHubScreen extends HookConsumerWidget {
),
)
else
_MainContentSection(
currentDeveloper: currentDeveloper.value,
projects: projects,
developerStats: developerStats,
onProjectSelected: (project) {
currentProject.value = project;
},
onDeveloperSelected: (developer) {
currentDeveloper.value = developer;
},
onCreateProject: () {
if (currentDeveloper.value != null) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder:
(context) => SheetScaffold(
titleText: 'createProject'.tr(),
child: ProjectForm(
publisherName:
currentDeveloper.value!.publisher!.name,
),
),
).then((value) {
if (value != null) {
ref.invalidate(
devProjectsProvider(
currentDeveloper.value!.publisher!.name,
),
);
Expanded(
child: Center(
child: _MainContentSection(
currentDeveloper: currentDeveloper.value,
projects: projects,
developerStats: developerStats,
onProjectSelected: (project) {
currentProject.value = project;
},
onDeveloperSelected: (developer) {
currentDeveloper.value = developer;
},
onCreateProject: () {
if (currentDeveloper.value != null) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder:
(context) => SheetScaffold(
titleText: 'createProject'.tr(),
child: ProjectForm(
publisherName:
currentDeveloper.value!.publisher!.name,
),
),
).then((value) {
if (value != null) {
ref.invalidate(
devProjectsProvider(
currentDeveloper.value!.publisher!.name,
),
);
}
});
}
});
}
},
},
),
),
),
],
),
@@ -210,9 +214,12 @@ class _MainContentSection extends HookConsumerWidget {
data:
(stats) =>
currentDeveloper == null
? _DeveloperUnselectedWidget(
onDeveloperSelected: onDeveloperSelected,
)
? ConstrainedBox(
constraints: BoxConstraints(maxWidth: 640),
child: _DeveloperUnselectedWidget(
onDeveloperSelected: onDeveloperSelected,
),
).center()
: Padding(
padding: const EdgeInsets.all(16),
child: Column(
@@ -725,6 +732,7 @@ class _DeveloperUnselectedWidget extends HookConsumerWidget {
return Card(
margin: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (!hasDevelopers) ...[
const Icon(

View File

@@ -182,6 +182,7 @@ class _FriendTile extends ConsumerWidget {
Symbols.play_arrow,
size: 10,
color: Colors.white,
fill: 1,
)
: null,
),