Skip to content

Commit 1508b53

Browse files
Fix ui bugs
1 parent a6d54c4 commit 1508b53

File tree

9 files changed

+115
-89
lines changed

9 files changed

+115
-89
lines changed

lib/Api/post_api.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class PostApi {
101101
"/v2.0/commentHot.api",
102102
data: {
103103
"postId": postId,
104-
"blogId": blogId,
104+
"blogId": "$blogId",
105105
"likeType": isLike ? 1 : 0,
106106
"commentId": commentId,
107107
},

lib/Screens/Info/system_notice_screen.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:loftify/Resources/theme.dart';
88
import 'package:loftify/Screens/Info/user_detail_screen.dart';
99
import 'package:loftify/Screens/Post/post_detail_screen.dart';
1010
import 'package:loftify/Utils/hive_util.dart';
11+
import 'package:loftify/Utils/responsive_util.dart';
1112
import 'package:loftify/Utils/route_util.dart';
1213

1314
import '../../Utils/ilogger.dart';
@@ -648,6 +649,7 @@ class _SystemNoticeScreenState extends State<SystemNoticeScreen>
648649
},
649650
width: MediaQuery.sizeOf(context).width,
650651
background: MyTheme.getBackground(context),
652+
showBorder: ResponsiveUtil.isLandscape(),
651653
),
652654
);
653655
}

lib/Screens/Post/post_detail_screen.dart

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,61 +1329,63 @@ class _PostDetailScreenState extends State<PostDetailScreen>
13291329
}
13301330

13311331
_buildGrainItem() {
1332-
return GestureDetector(
1333-
onTap: () {
1334-
RouteUtil.pushPanelCupertinoRoute(
1335-
context,
1336-
GrainDetailScreen(
1337-
grainId: _postDetailData!.grainInfo!.id,
1338-
blogId: _postDetailData!.grainInfo!.userId,
1339-
),
1340-
);
1341-
},
1342-
child: Container(
1343-
margin: const EdgeInsets.only(left: 16, right: 16, top: 8),
1344-
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
1345-
decoration: BoxDecoration(
1346-
borderRadius: BorderRadius.circular(10),
1347-
border: Border.all(
1348-
color: Theme.of(context).cardColor,
1349-
width: 1,
1332+
return ItemBuilder.buildClickItem(
1333+
GestureDetector(
1334+
onTap: () {
1335+
RouteUtil.pushPanelCupertinoRoute(
1336+
context,
1337+
GrainDetailScreen(
1338+
grainId: _postDetailData!.grainInfo!.id,
1339+
blogId: _postDetailData!.grainInfo!.userId,
1340+
),
1341+
);
1342+
},
1343+
child: Container(
1344+
margin: const EdgeInsets.only(left: 16, right: 16, top: 8),
1345+
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
1346+
decoration: BoxDecoration(
1347+
borderRadius: BorderRadius.circular(10),
1348+
border: Border.all(
1349+
color: Theme.of(context).cardColor,
1350+
width: 1,
1351+
),
13501352
),
1351-
),
1352-
child: Column(
1353-
children: [
1354-
Row(
1355-
children: [
1356-
Icon(
1357-
Icons.grain_rounded,
1358-
size: 16,
1359-
color: MyColors.getHotTagTextColor(context),
1360-
),
1361-
const SizedBox(width: 3),
1362-
Text(
1363-
"收录至",
1364-
style: Theme.of(context).textTheme.titleSmall?.apply(
1365-
fontSizeDelta: -1,
1366-
fontWeightDelta: 2,
1367-
color: MyColors.getHotTagTextColor(context)),
1368-
),
1369-
const SizedBox(width: 3),
1370-
Expanded(
1371-
child: Text(
1372-
_postDetailData!.grainInfo!.name,
1373-
style: Theme.of(context)
1374-
.textTheme
1375-
.titleSmall
1376-
?.apply(fontSizeDelta: -1),
1353+
child: Column(
1354+
children: [
1355+
Row(
1356+
children: [
1357+
Icon(
1358+
Icons.grain_rounded,
1359+
size: 16,
1360+
color: MyColors.getHotTagTextColor(context),
13771361
),
1378-
),
1379-
Icon(
1380-
Icons.keyboard_arrow_right_rounded,
1381-
size: 16,
1382-
color: Theme.of(context).textTheme.labelSmall?.color,
1383-
),
1384-
],
1385-
),
1386-
],
1362+
const SizedBox(width: 3),
1363+
Text(
1364+
"收录至",
1365+
style: Theme.of(context).textTheme.titleSmall?.apply(
1366+
fontSizeDelta: -1,
1367+
fontWeightDelta: 2,
1368+
color: MyColors.getHotTagTextColor(context)),
1369+
),
1370+
const SizedBox(width: 3),
1371+
Expanded(
1372+
child: Text(
1373+
_postDetailData!.grainInfo!.name,
1374+
style: Theme.of(context)
1375+
.textTheme
1376+
.titleSmall
1377+
?.apply(fontSizeDelta: -1),
1378+
),
1379+
),
1380+
Icon(
1381+
Icons.keyboard_arrow_right_rounded,
1382+
size: 16,
1383+
color: Theme.of(context).textTheme.labelSmall?.color,
1384+
),
1385+
],
1386+
),
1387+
],
1388+
),
13871389
),
13881390
),
13891391
);

lib/Screens/Post/tag_collection_grain_screen.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import 'package:waterfall_flow/waterfall_flow.dart';
1010

1111
import '../../Utils/enums.dart';
1212
import '../../Utils/ilogger.dart';
13+
import '../../Utils/responsive_util.dart';
1314
import '../../Utils/utils.dart';
1415
import '../../Widgets/General/EasyRefresh/easy_refresh.dart';
1516
import '../../Widgets/Item/item_builder.dart';
@@ -107,6 +108,7 @@ class _TagCollectionGrainScreenState extends State<TagCollectionGrainScreen>
107108
},
108109
width: MediaQuery.sizeOf(context).width,
109110
background: MyTheme.getBackground(context),
111+
showBorder: ResponsiveUtil.isLandscape(),
110112
),
111113
actions: [
112114
Visibility(

lib/Screens/Setting/filename_setting_screen.dart

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class _FilenameSettingScreenState extends State<FilenameSettingScreen>
2525
final TextEditingController _controller = TextEditingController();
2626
final FocusNode _focusNode = FocusNode();
2727
String filenameFormat = HiveUtil.getString(HiveUtil.filenameFormatKey,
28-
defaultValue: defaultFilenameFormat) ??
28+
defaultValue: defaultFilenameFormat) ??
2929
defaultFilenameFormat;
3030

3131
@override
@@ -43,14 +43,16 @@ class _FilenameSettingScreenState extends State<FilenameSettingScreen>
4343
transparent: true,
4444
title: "文件命名格式",
4545
context: context,
46-
background: Theme.of(context).scaffoldBackgroundColor,
46+
background: Theme
47+
.of(context)
48+
.scaffoldBackgroundColor,
4749
),
4850
body: EasyRefresh(
4951
child: ScrollConfiguration(
5052
behavior: NoShadowScrollBehavior(),
5153
child: ListView(
52-
padding: EdgeInsets.symmetric(
53-
horizontal: ResponsiveUtil.isLandscape() ? 20 : 10),
54+
padding: const EdgeInsets.symmetric(
55+
horizontal: 10),
5456
children: [
5557
ItemBuilder.buildInputItem(
5658
context: context,
@@ -101,24 +103,30 @@ class _FilenameSettingScreenState extends State<FilenameSettingScreen>
101103
ItemBuilder.buildRoundButton(
102104
context,
103105
text: "可用字段: ",
104-
textStyle: Theme.of(context)
106+
textStyle: Theme
107+
.of(context)
105108
.textTheme
106109
.titleSmall
107110
?.apply(fontWeightDelta: 2),
108111
radius: 10,
109112
padding:
110-
const EdgeInsets.only(top: 8, bottom: 8, left: 8),
113+
const EdgeInsets.only(top: 8, bottom: 8, left: 8),
111114
background: Colors.transparent,
112115
),
113116
...FilenameField.values.map((field) {
114117
return ItemBuilder.buildRoundButton(
115118
context,
116119
text: field.label,
117-
textStyle: Theme.of(context).textTheme.titleSmall,
120+
textStyle: Theme
121+
.of(context)
122+
.textTheme
123+
.titleSmall,
118124
radius: 10,
119125
padding: const EdgeInsets.symmetric(
120126
horizontal: 16, vertical: 8),
121-
background: Theme.of(context).canvasColor,
127+
background: Theme
128+
.of(context)
129+
.canvasColor,
122130
onTap: () {
123131
_focusNode.requestFocus();
124132
final text = _controller.text;
@@ -140,7 +148,9 @@ class _FilenameSettingScreenState extends State<FilenameSettingScreen>
140148
Container(
141149
decoration: BoxDecoration(
142150
borderRadius: BorderRadius.circular(10),
143-
color: Theme.of(context).canvasColor,
151+
color: Theme
152+
.of(context)
153+
.canvasColor,
144154
),
145155
child: Table(
146156
defaultColumnWidth: const IntrinsicColumnWidth(),
@@ -152,7 +162,7 @@ class _FilenameSettingScreenState extends State<FilenameSettingScreen>
152162
], fontWeightDelta: 2),
153163
...List.generate(
154164
FilenameField.values.length,
155-
(index) {
165+
(index) {
156166
return _buildRow([
157167
FilenameField.values[index].label,
158168
FilenameField.values[index].description,
@@ -177,7 +187,8 @@ class _FilenameSettingScreenState extends State<FilenameSettingScreen>
177187
child: Center(
178188
child: Text(
179189
text,
180-
style: Theme.of(context)
190+
style: Theme
191+
.of(context)
181192
.textTheme
182193
.bodyMedium
183194
?.apply(fontWeightDelta: fontWeightDelta),
@@ -193,11 +204,13 @@ class _FilenameSettingScreenState extends State<FilenameSettingScreen>
193204
decoration: BoxDecoration(
194205
border: useBorder
195206
? Border(
196-
bottom: BorderSide(
197-
color: Theme.of(context).dividerColor,
198-
width: 0.5,
199-
),
200-
)
207+
bottom: BorderSide(
208+
color: Theme
209+
.of(context)
210+
.dividerColor,
211+
width: 0.5,
212+
),
213+
)
201214
: null,
202215
),
203216
children: cells

lib/Screens/Setting/general_setting_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class _GeneralSettingScreenState extends State<GeneralSettingScreen>
263263
);
264264
},
265265
),
266-
const SizedBox(height: 10),
266+
if (ResponsiveUtil.isMobile()) const SizedBox(height: 10),
267267
if (ResponsiveUtil.isMobile())
268268
ItemBuilder.buildEntryItem(
269269
context: context,

lib/Utils/responsive_util.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:restart_app/restart_app.dart';
99
import 'package:window_manager/window_manager.dart';
1010

1111
import '../Screens/main_screen.dart';
12+
import '../Widgets/Item/item_builder.dart';
1213
import 'app_provider.dart';
1314
import 'ilogger.dart';
1415

@@ -89,7 +90,7 @@ class ResponsiveUtil {
8990
static Future<void> returnToMainScreen(BuildContext context) async {
9091
if (ResponsiveUtil.isDesktop()) {
9192
globalNavigatorState?.pushAndRemoveUntil(
92-
RouteUtil.getFadeRoute(const MainScreen(), duration: Duration.zero),
93+
RouteUtil.getFadeRoute(ItemBuilder.buildContextMenuOverlay(const MainScreen()), duration: Duration.zero),
9394
(route) => false,
9495
);
9596
} else {

lib/Widgets/BottomSheet/comment_bottom_sheet.dart

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class CommentBottomSheetState extends State<CommentBottomSheet> {
3636
List<Comment> newComments = [];
3737
bool loading = false;
3838
final EasyRefreshController _refreshController = EasyRefreshController();
39+
bool _noMore = false;
3940

4041
@override
4142
void initState() {
@@ -203,6 +204,7 @@ class CommentBottomSheetState extends State<CommentBottomSheet> {
203204
child: ItemBuilder.buildTitle(
204205
context,
205206
title: "最新评论",
207+
left: 8,
206208
bottomMargin: 0,
207209
topMargin: 0,
208210
textStyle: Theme.of(context)
@@ -222,23 +224,27 @@ class CommentBottomSheetState extends State<CommentBottomSheet> {
222224
return SliverList(
223225
delegate: SliverChildListDelegate(
224226
[
225-
ListView.builder(
226-
shrinkWrap: true,
227-
itemCount: comments.length,
228-
padding: EdgeInsets.zero,
229-
physics: const NeverScrollableScrollPhysics(),
230-
itemBuilder: (context, index) => ItemBuilder.buildCommentRow(
231-
context,
232-
comments[index],
233-
padding: const EdgeInsets.only(bottom: 12),
234-
writerId: widget.blogId,
235-
l2Padding: const EdgeInsets.only(top: 12, right: 0),
236-
onL2CommentTap: (comment) {
237-
HapticFeedback.mediumImpact();
238-
_fetchL2Comments(comment);
239-
},
227+
ItemBuilder.buildLoadMoreNotification(
228+
child: ListView.builder(
229+
shrinkWrap: true,
230+
itemCount: comments.length,
231+
padding: EdgeInsets.zero,
232+
physics: const NeverScrollableScrollPhysics(),
233+
itemBuilder: (context, index) => ItemBuilder.buildCommentRow(
234+
context,
235+
comments[index],
236+
padding: const EdgeInsets.only(bottom: 12),
237+
writerId: widget.blogId,
238+
l2Padding: const EdgeInsets.only(top: 12, right: 0),
239+
onL2CommentTap: (comment) {
240+
HapticFeedback.mediumImpact();
241+
_fetchL2Comments(comment);
242+
},
243+
),
240244
),
241-
)
245+
noMore: _noMore,
246+
onLoad: _onLoad,
247+
),
242248
],
243249
),
244250
);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: loftify
2-
version: 2.0.0+2000
2+
version: 2.1.0+2100
33
description: An third-party application for LOFTER
44
publish_to: none
55

0 commit comments

Comments
 (0)