♻️ Refactored markdown content

This commit is contained in:
2025-05-18 19:46:57 +08:00
parent 1d54f947f6
commit 9c0221ab20
16 changed files with 484 additions and 517 deletions

View File

@ -1,13 +0,0 @@
import 'package:auto_route/annotations.dart';
import 'package:flutter/material.dart';
import 'package:island/widgets/app_scaffold.dart';
@RoutePage()
class MyselfProfileScreen extends StatelessWidget {
const MyselfProfileScreen({super.key});
@override
Widget build(BuildContext context) {
return AppScaffold(appBar: AppBar(leading: const PageBackButton()));
}
}

View File

@ -46,7 +46,7 @@ class AccountProfileScreen extends HookConsumerWidget {
final iconShadow = Shadow(
color: Colors.black54,
blurRadius: 5.0,
offset: Offset(1.0, 1.0),
offset: const Offset(1.0, 1.0),
);
return account.when(
@ -78,36 +78,39 @@ class AccountProfileScreen extends HookConsumerWidget {
),
),
SliverToBoxAdapter(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 20,
children: [
ProfilePictureWidget(
fileId: data.profile.pictureId!,
radius: 32,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
spacing: 6,
children: [
Text(data.nick).fontSize(20),
Text(
'@${data.name}',
).fontSize(14).opacity(0.85),
],
),
AccountStatusWidget(
uname: name,
padding: EdgeInsets.zero,
),
],
child: Padding(
padding: const EdgeInsets.fromLTRB(24, 24, 24, 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ProfilePictureWidget(
fileId: data.profile.pictureId,
radius: 32,
),
),
],
).padding(horizontal: 24, top: 24, bottom: 8),
const Gap(20),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
children: [
Text(data.nick).fontSize(20),
const Gap(6),
Text(
'@${data.name}',
).fontSize(14).opacity(0.85),
],
),
AccountStatusWidget(
uname: name,
padding: EdgeInsets.zero,
),
],
),
),
],
),
),
),
if (data.badges.isNotEmpty)
SliverToBoxAdapter(
@ -127,7 +130,7 @@ class AccountProfileScreen extends HookConsumerWidget {
SliverToBoxAdapter(
child: const Divider(height: 1).padding(bottom: 24),
),
if (data.profile.bio != null && data.profile.bio!.isNotEmpty)
if (data.profile.bio?.isNotEmpty ?? false)
SliverToBoxAdapter(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,

View File

@ -18,7 +18,7 @@ import 'package:island/pods/websocket.dart';
import 'package:island/route.gr.dart';
import 'package:island/screens/posts/compose.dart';
import 'package:island/widgets/alert.dart';
import 'package:island/widgets/chat/message_bubble.dart';
import 'package:island/widgets/chat/message_item.dart';
import 'package:island/widgets/content/cloud_files.dart';
import 'package:island/widgets/response.dart';
import 'package:material_symbols_icons/material_symbols_icons.dart';
@ -506,17 +506,17 @@ class ChatRoomScreen extends HookConsumerWidget {
return chatIdentity.when(
skipError: true,
data:
(identity) => MessageBubble(
(identity) => MessageItem(
message: message,
isCurrentUser:
identity?.id == message.senderId,
onAction: (action) {
switch (action) {
case MessageBubbleAction.delete:
case MessageItemAction.delete:
messagesNotifier.deleteMessage(
message.id,
);
case MessageBubbleAction.edit:
case MessageItemAction.edit:
messageEditingTo.value =
message.toRemoteMessage();
messageController.text =
@ -535,10 +535,10 @@ class ChatRoomScreen extends HookConsumerWidget {
),
)
.toList();
case MessageBubbleAction.forward:
case MessageItemAction.forward:
messageForwardingTo.value =
message.toRemoteMessage();
case MessageBubbleAction.reply:
case MessageItemAction.reply:
messageReplyingTo.value =
message.toRemoteMessage();
}
@ -548,7 +548,7 @@ class ChatRoomScreen extends HookConsumerWidget {
showAvatar: isLastInGroup,
),
loading:
() => MessageBubble(
() => MessageItem(
message: message,
isCurrentUser: false,
onAction: null,