🐛 Fixes of the stellar program

This commit is contained in:
2025-07-23 20:25:14 +08:00
parent 170ea4f2c0
commit e48410a528
10 changed files with 101 additions and 90 deletions

View File

@@ -22,9 +22,9 @@ class AccountName extends StatelessWidget {
@override
Widget build(BuildContext context) {
var nameStyle = (style ?? TextStyle());
if (account.profile.stellarMembership != null) {
if (account.perkSubscription != null) {
nameStyle = nameStyle.copyWith(
color: (switch (account.profile.stellarMembership!.identifier) {
color: (switch (account.perkSubscription!.identifier) {
'solian.stellar.primary' => Colors.blueAccent,
'solian.stellar.nova' => Colors.indigoAccent,
'solian.stellar.supernova' => Colors.amberAccent,
@@ -38,8 +38,8 @@ class AccountName extends StatelessWidget {
spacing: 4,
children: [
Flexible(child: Text(account.nick, style: nameStyle)),
if (account.profile.stellarMembership != null)
StellarMembershipMark(membership: account.profile.stellarMembership!),
if (account.perkSubscription != null)
StellarMembershipMark(membership: account.perkSubscription!),
if (account.profile.verification != null)
VerificationMark(mark: account.profile.verification!),
],

View File

@@ -26,6 +26,7 @@ class CloudFileList extends HookConsumerWidget {
final double maxWidth;
final double? minWidth;
final bool disableZoomIn;
final bool disableConstraint;
const CloudFileList({
super.key,
required this.files,
@@ -33,6 +34,7 @@ class CloudFileList extends HookConsumerWidget {
this.maxWidth = double.infinity,
this.minWidth,
this.disableZoomIn = false,
this.disableConstraint = false,
});
double calculateAspectRatio() {
@@ -60,8 +62,15 @@ class CloudFileList extends HookConsumerWidget {
final isImage = files.first.mimeType?.startsWith('image') ?? false;
return ConstrainedBox(
constraints: BoxConstraints(
maxHeight: maxHeight,
maxHeight: disableConstraint ? double.infinity : maxHeight,
minWidth: minWidth ?? 0,
maxWidth:
files.length == 1
? math.max(
math.min(520, MediaQuery.of(context).size.width * 0.85),
minWidth ?? 0,
)
: double.infinity,
),
child: AspectRatio(
aspectRatio: calculateAspectRatio(),

View File

@@ -168,6 +168,7 @@ class PostItem extends HookConsumerWidget {
_buildReferencePost(context, item),
if (item.attachments.isNotEmpty && item.type != 1)
CloudFileList(
disableConstraint: isFullPost,
files: item.attachments,
maxWidth: math.min(
MediaQuery.of(context).size.width,
@@ -404,6 +405,7 @@ class PostItem extends HookConsumerWidget {
if (item.attachments.isNotEmpty && item.type != 1)
CloudFileList(
files: item.attachments,
disableConstraint: isFullPost,
maxWidth: math.min(
MediaQuery.of(context).size.width * 0.85,
kWideScreenWidth - 160,