💄 Optimized publisher profile & personal profile

This commit is contained in:
2025-06-14 02:16:52 +08:00
parent 6e74cf3a93
commit 30416f7ca0
11 changed files with 252 additions and 119 deletions

View File

@ -6,6 +6,7 @@ import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/pods/event_calendar.dart';
import 'package:island/screens/account/profile.dart';
import 'package:island/widgets/account/account_nameplate.dart';
import 'package:island/widgets/app_scaffold.dart';
import 'package:island/widgets/content/cloud_files.dart';
import 'package:island/widgets/account/event_calendar.dart';
@ -86,29 +87,7 @@ class EventCalanderScreen extends HookConsumerWidget {
// Show user profile if viewing someone else's calendar
if (name != 'me' && user.hasValue)
Container(
decoration: BoxDecoration(
border: Border.all(
width:
1 / MediaQuery.of(context).devicePixelRatio,
color: Theme.of(context).dividerColor,
),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
margin: EdgeInsets.all(16),
child: Card(
margin: EdgeInsets.zero,
elevation: 0,
color: Colors.transparent,
child: ListTile(
leading: ProfilePictureWidget(
fileId: user.value!.profile.picture?.id,
),
title: Text(user.value!.nick).bold(),
subtitle: Text('@${user.value!.name}'),
),
),
),
AccountNameplate(name: name),
],
),
).center()
@ -132,28 +111,8 @@ class EventCalanderScreen extends HookConsumerWidget {
// Show user profile if viewing someone else's calendar
if (name != 'me' && user.hasValue)
Container(
decoration: BoxDecoration(
border: Border.all(
width: 1 / MediaQuery.of(context).devicePixelRatio,
color: Theme.of(context).dividerColor,
),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
margin: EdgeInsets.all(16),
child: Card(
margin: EdgeInsets.zero,
elevation: 0,
color: Colors.transparent,
child: ListTile(
leading: ProfilePictureWidget(
fileId: user.value!.profile.picture?.id,
),
title: Text(user.value!.nick).bold(),
subtitle: Text('@${user.value!.name}'),
),
),
),
AccountNameplate(name: name),
Gap(MediaQuery.of(context).padding.bottom + 16),
],
),
),

View File

@ -5,11 +5,13 @@ import 'package:gap/gap.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:island/models/user.dart';
import 'package:island/pods/config.dart';
import 'package:island/pods/event_calendar.dart';
import 'package:island/pods/network.dart';
import 'package:island/pods/userinfo.dart';
import 'package:island/services/color.dart';
import 'package:island/widgets/account/account_name.dart';
import 'package:island/widgets/account/badge.dart';
import 'package:island/widgets/account/fortune_graph.dart';
import 'package:island/widgets/account/leveling_progress.dart';
import 'package:island/widgets/account/status.dart';
import 'package:island/widgets/app_scaffold.dart';
@ -67,7 +69,14 @@ class AccountProfileScreen extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final now = DateTime.now();
final account = ref.watch(accountProvider(name));
final accountEvents = ref.watch(
eventCalendarProvider(
EventCalendarQuery(uname: name, year: now.year, month: now.month),
),
);
final appbarColor = ref.watch(accountAppbarForcegroundColorProvider(name));
final appbarShadow = Shadow(
@ -173,22 +182,39 @@ class AccountProfileScreen extends HookConsumerWidget {
mark: data.profile.verification!,
),
],
).padding(horizontal: 20, bottom: 24),
).padding(horizontal: 20),
),
SliverToBoxAdapter(
child: const Divider(height: 1).padding(bottom: 24),
child: const Divider(height: 1).padding(vertical: 24),
),
SliverToBoxAdapter(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('bio').tr().bold(),
Text(
data.profile.bio.isEmpty
? 'descriptionNone'.tr()
: data.profile.bio,
),
],
).padding(horizontal: 24),
),
SliverToBoxAdapter(
child: const Divider(height: 1).padding(top: 24),
),
SliverToBoxAdapter(
child: Column(
children: [
FortuneGraphWidget(
events: accountEvents,
eventCalanderUser: data.name,
),
],
).padding(all: 8),
),
if (data.profile.bio.isNotEmpty)
SliverToBoxAdapter(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text('bio').tr().bold(),
Text(data.profile.bio),
],
).padding(horizontal: 24),
),
],
),
),