Skip to content

Commit

Permalink
## 0.5.1
Browse files Browse the repository at this point in the history
### Fixed

- Fixed Style
  • Loading branch information
ChenDoxiu committed Sep 10, 2024
1 parent 828380c commit d07f162
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 35 deletions.
7 changes: 4 additions & 3 deletions lib/pages/search/user_search.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_tabler_icons/flutter_tabler_icons.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:moekey/apis/models/user_full.dart';
Expand All @@ -23,8 +22,9 @@ class UserSearchPage extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
var status = ref.watch(userSearchStatusProvider);
return LayoutBuilder(builder: (context, constraints) {
var padding =
EdgeInsets.symmetric(horizontal: getPaddingForNote(constraints));
var padding = EdgeInsets.symmetric(
horizontal: getPaddingForNote(constraints).clamp(8, double.infinity));

double maxCrossAxisExtent = constraints.maxWidth < 580 ? 600 : 350;
return MkRefreshLoadList(
onLoad: () => ref.read(userSearchStatusProvider.notifier).load(),
Expand All @@ -33,6 +33,7 @@ class UserSearchPage extends HookConsumerWidget {
const SliverToBoxAdapter(
child: UserSearchPanel(),
),
const SliverToBoxAdapter(child: SizedBox(height: 16)),
// 用户卡片Grid
SliverGrid.builder(
itemBuilder: (context, index) {
Expand Down
5 changes: 3 additions & 2 deletions lib/status/themes.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:io';

import 'package:chinese_font_library/chinese_font_library.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -150,8 +151,8 @@ class Themes extends _$Themes {
canvasColor: colors.bgColor,
cardColor: colors.panelColor,
useMaterial3: true,
// fontFamily: Platform.isWindows ? "微软雅黑" : null,
fontFamilyFallback: [...SystemChineseFont.fontFamilyFallback],
fontFamily: Platform.isWindows ? "微软雅黑" : null,
// fontFamilyFallback: [...SystemChineseFont.fontFamilyFallback],
textTheme: TextTheme(
bodyMedium: TextStyle(
color: colors.fgColor,
Expand Down
60 changes: 31 additions & 29 deletions lib/widgets/mk_user_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,27 +120,27 @@ class MkUserCard extends HookConsumerWidget {
textStyle.copyWith(fontWeight: FontWeight.bold),
child: MFMText(
text: user.name ?? user.username,
after: [
const TextSpan(text: "\n"),
TextSpan(
text: "@${user.username ?? ""}",
style: textStyle.copyWith(
fontSize: 11,
)),
TextSpan(
text: user.host != null ? "@${user.host}" : "",
style: textStyle.copyWith(
color: themes.fgColor.withAlpha(128),
fontSize: 11),
),
],
maxLines: 2,
maxLines: 1,
overflow: TextOverflow.ellipsis,
emojis: user.emojis,
bigEmojiCode: false,
feature: const [MFMFeature.emojiCode],
),
)
),
RichText(
text: TextSpan(children: [
TextSpan(
text: "@${user.username ?? ""}",
style: textStyle.copyWith(
fontSize: 11,
)),
TextSpan(
text: user.host != null ? "@${user.host}" : "",
style: textStyle.copyWith(
color: themes.fgColor.withAlpha(128),
fontSize: 11),
),
]))
],
),
),
Expand All @@ -152,19 +152,21 @@ class MkUserCard extends HookConsumerWidget {
Expanded(
child: Padding(
padding: const EdgeInsets.all(16),
child: Center(
child: DefaultTextStyle(
style: textStyle.copyWith(fontSize: 11),
child: SizedBox(
width: double.infinity,
child: MFMText(
text: user.description ?? "此用户尚无自我介绍",
maxLines: 3,
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
emojis: user.emojis,
bigEmojiCode: false,
feature: const [MFMFeature.emojiCode],
child: ClipRect(
child: Center(
child: DefaultTextStyle(
style: textStyle.copyWith(fontSize: 11),
child: SizedBox(
width: double.infinity,
child: MFMText(
text: user.description ?? "此用户尚无自我介绍",
maxLines: 3,
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
emojis: user.emojis,
bigEmojiCode: false,
feature: const [MFMFeature.emojiCode],
),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.5.0+37
version: 0.5.1+38

environment:
sdk: '>=3.5.0 <4.0.0'
Expand Down

0 comments on commit d07f162

Please sign in to comment.