Skip to content

Commit d07f162

Browse files
author
ChenDoxiu
committed
## 0.5.1
### Fixed - Fixed Style
1 parent 828380c commit d07f162

File tree

4 files changed

+39
-35
lines changed

4 files changed

+39
-35
lines changed

lib/pages/search/user_search.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter/widgets.dart';
32
import 'package:flutter_tabler_icons/flutter_tabler_icons.dart';
43
import 'package:hooks_riverpod/hooks_riverpod.dart';
54
import 'package:moekey/apis/models/user_full.dart';
@@ -23,8 +22,9 @@ class UserSearchPage extends HookConsumerWidget {
2322
Widget build(BuildContext context, WidgetRef ref) {
2423
var status = ref.watch(userSearchStatusProvider);
2524
return LayoutBuilder(builder: (context, constraints) {
26-
var padding =
27-
EdgeInsets.symmetric(horizontal: getPaddingForNote(constraints));
25+
var padding = EdgeInsets.symmetric(
26+
horizontal: getPaddingForNote(constraints).clamp(8, double.infinity));
27+
2828
double maxCrossAxisExtent = constraints.maxWidth < 580 ? 600 : 350;
2929
return MkRefreshLoadList(
3030
onLoad: () => ref.read(userSearchStatusProvider.notifier).load(),
@@ -33,6 +33,7 @@ class UserSearchPage extends HookConsumerWidget {
3333
const SliverToBoxAdapter(
3434
child: UserSearchPanel(),
3535
),
36+
const SliverToBoxAdapter(child: SizedBox(height: 16)),
3637
// 用户卡片Grid
3738
SliverGrid.builder(
3839
itemBuilder: (context, index) {

lib/status/themes.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:convert';
2+
import 'dart:io';
23

34
import 'package:chinese_font_library/chinese_font_library.dart';
45
import 'package:flutter/material.dart';
@@ -150,8 +151,8 @@ class Themes extends _$Themes {
150151
canvasColor: colors.bgColor,
151152
cardColor: colors.panelColor,
152153
useMaterial3: true,
153-
// fontFamily: Platform.isWindows ? "微软雅黑" : null,
154-
fontFamilyFallback: [...SystemChineseFont.fontFamilyFallback],
154+
fontFamily: Platform.isWindows ? "微软雅黑" : null,
155+
// fontFamilyFallback: [...SystemChineseFont.fontFamilyFallback],
155156
textTheme: TextTheme(
156157
bodyMedium: TextStyle(
157158
color: colors.fgColor,

lib/widgets/mk_user_card.dart

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -120,27 +120,27 @@ class MkUserCard extends HookConsumerWidget {
120120
textStyle.copyWith(fontWeight: FontWeight.bold),
121121
child: MFMText(
122122
text: user.name ?? user.username,
123-
after: [
124-
const TextSpan(text: "\n"),
125-
TextSpan(
126-
text: "@${user.username ?? ""}",
127-
style: textStyle.copyWith(
128-
fontSize: 11,
129-
)),
130-
TextSpan(
131-
text: user.host != null ? "@${user.host}" : "",
132-
style: textStyle.copyWith(
133-
color: themes.fgColor.withAlpha(128),
134-
fontSize: 11),
135-
),
136-
],
137-
maxLines: 2,
123+
maxLines: 1,
138124
overflow: TextOverflow.ellipsis,
139125
emojis: user.emojis,
140126
bigEmojiCode: false,
141127
feature: const [MFMFeature.emojiCode],
142128
),
143-
)
129+
),
130+
RichText(
131+
text: TextSpan(children: [
132+
TextSpan(
133+
text: "@${user.username ?? ""}",
134+
style: textStyle.copyWith(
135+
fontSize: 11,
136+
)),
137+
TextSpan(
138+
text: user.host != null ? "@${user.host}" : "",
139+
style: textStyle.copyWith(
140+
color: themes.fgColor.withAlpha(128),
141+
fontSize: 11),
142+
),
143+
]))
144144
],
145145
),
146146
),
@@ -152,19 +152,21 @@ class MkUserCard extends HookConsumerWidget {
152152
Expanded(
153153
child: Padding(
154154
padding: const EdgeInsets.all(16),
155-
child: Center(
156-
child: DefaultTextStyle(
157-
style: textStyle.copyWith(fontSize: 11),
158-
child: SizedBox(
159-
width: double.infinity,
160-
child: MFMText(
161-
text: user.description ?? "此用户尚无自我介绍",
162-
maxLines: 3,
163-
textAlign: TextAlign.start,
164-
overflow: TextOverflow.ellipsis,
165-
emojis: user.emojis,
166-
bigEmojiCode: false,
167-
feature: const [MFMFeature.emojiCode],
155+
child: ClipRect(
156+
child: Center(
157+
child: DefaultTextStyle(
158+
style: textStyle.copyWith(fontSize: 11),
159+
child: SizedBox(
160+
width: double.infinity,
161+
child: MFMText(
162+
text: user.description ?? "此用户尚无自我介绍",
163+
maxLines: 3,
164+
textAlign: TextAlign.start,
165+
overflow: TextOverflow.ellipsis,
166+
emojis: user.emojis,
167+
bigEmojiCode: false,
168+
feature: const [MFMFeature.emojiCode],
169+
),
168170
),
169171
),
170172
),

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1616
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717
# In Windows, build-name is used as the major, minor, and patch parts
1818
# of the product and file versions while build-number is used as the build suffix.
19-
version: 0.5.0+37
19+
version: 0.5.1+38
2020

2121
environment:
2222
sdk: '>=3.5.0 <4.0.0'

0 commit comments

Comments
 (0)