mirror of
https://github.com/StarCitizenToolBox/app.git
synced 2026-02-12 02:00:22 +00:00
feat: UI update
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:starcitizen_doctor/app.dart';
|
||||
import 'package:starcitizen_doctor/common/conf/url_conf.dart';
|
||||
import 'package:starcitizen_doctor/provider/party_room.dart';
|
||||
import 'package:starcitizen_doctor/ui/party_room/party_room_ui_model.dart';
|
||||
import 'package:starcitizen_doctor/ui/party_room/utils/party_room_utils.dart';
|
||||
import 'package:starcitizen_doctor/widgets/widgets.dart';
|
||||
|
||||
class UserAvatarWidget extends HookConsumerWidget {
|
||||
@@ -18,12 +19,12 @@ class UserAvatarWidget extends HookConsumerWidget {
|
||||
final isLoggedIn = partyRoomState.auth.isLoggedIn;
|
||||
final userName = partyRoomState.auth.userInfo?.gameUserId ?? S.current.user_not_logged_in;
|
||||
final avatarUrl = partyRoomState.auth.userInfo?.avatarUrl;
|
||||
final enlistedDate = partyRoomState.auth.userInfo?.enlistedDate;
|
||||
final fullAvatarUrl = (avatarUrl != null && avatarUrl.isNotEmpty) ? '${URLConf.rsiAvatarBaseUrl}$avatarUrl' : null;
|
||||
final uuid = ref.read(appGlobalModelProvider).deviceUUID;
|
||||
return HoverButton(
|
||||
onPressed: () {
|
||||
if (isLoggedIn) {
|
||||
_showAccountCard(context, ref, userName, fullAvatarUrl, uuid);
|
||||
_showAccountCard(context, ref, userName, fullAvatarUrl, enlistedDate);
|
||||
} else {
|
||||
onTapNavigateToPartyRoom();
|
||||
}
|
||||
@@ -75,7 +76,7 @@ class UserAvatarWidget extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
void _showAccountCard(BuildContext context, WidgetRef ref, String userName, String? avatarUrl, String? uuid) {
|
||||
void _showAccountCard(BuildContext context, WidgetRef ref, String userName, String? avatarUrl, Int64? enlistedDate) {
|
||||
final targetContext = context;
|
||||
final box = targetContext.findRenderObject() as RenderBox?;
|
||||
final offset = box?.localToGlobal(Offset.zero) ?? Offset.zero;
|
||||
@@ -139,7 +140,7 @@ class UserAvatarWidget extends HookConsumerWidget {
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'$uuid',
|
||||
'注册时间:${PartyRoomUtils.formatDateTime(enlistedDate)}',
|
||||
style: TextStyle(fontSize: 12, color: Colors.white.withValues(alpha: .6)),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user