Skip to content

Commit 9fc5118

Browse files
Fix the bug of abnormal version update;Update version to 1.10.0
1 parent f7f1595 commit 9fc5118

File tree

11 files changed

+150
-405
lines changed

11 files changed

+150
-405
lines changed

lib/Screens/Info/favorite_folder_list_screen.dart

Lines changed: 69 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -106,87 +106,89 @@ class _FavoriteFolderListScreenState extends State<FavoriteFolderListScreen>
106106
cacheExtent: 9999,
107107
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 16),
108108
children: List.generate(_favoriteFolderList.length, (index) {
109-
return GestureDetector(
110-
onTap: () {
111-
RouteUtil.pushCupertinoRoute(
112-
context,
113-
FavoriteFolderDetailScreen(
114-
favoriteFolderId: _favoriteFolderList[index].id ?? 0),
115-
);
116-
},
117-
child: _buildFolderItem(
118-
context,
119-
_favoriteFolderList[index],
120-
),
109+
return _buildFolderItem(
110+
context,
111+
_favoriteFolderList[index],
121112
);
122113
}),
123114
);
124115
}
125116

126117
static Widget _buildFolderItem(BuildContext context, FavoriteFolder item) {
127-
return Container(
128-
color: Colors.transparent,
129-
child: Row(
130-
children: <Widget>[
131-
Container(
132-
decoration: BoxDecoration(
133-
border:
134-
Border.all(color: Theme.of(context).dividerColor, width: 0.5),
135-
borderRadius: BorderRadius.circular(10),
136-
color: Colors.transparent,
137-
),
138-
child: ClipRRect(
139-
borderRadius: BorderRadius.circular(10),
140-
child: SizedBox(
141-
height: 80,
142-
width: 80,
143-
child: ItemBuilder.buildCachedImage(
144-
context: context,
145-
fit: BoxFit.cover,
146-
showLoading: false,
147-
imageUrl: Utils.removeWatermark(item.coverUrl ?? ""),
118+
return ItemBuilder.buildClickItem(
119+
GestureDetector(
120+
onTap: () {
121+
RouteUtil.pushCupertinoRoute(
122+
context,
123+
FavoriteFolderDetailScreen(
124+
favoriteFolderId: item.id ?? 0),
125+
);
126+
},
127+
child: Container(
128+
color: Colors.transparent,
129+
child: Row(
130+
children: <Widget>[
131+
Container(
132+
decoration: BoxDecoration(
133+
border: Border.all(
134+
color: Theme.of(context).dividerColor, width: 0.5),
135+
borderRadius: BorderRadius.circular(10),
136+
color: Colors.transparent,
148137
),
149-
),
150-
),
151-
),
152-
Expanded(
153-
child: Container(
154-
padding: const EdgeInsets.only(left: 10),
155-
child: Column(
156-
crossAxisAlignment: CrossAxisAlignment.start,
157-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
158-
mainAxisSize: MainAxisSize.max,
159-
children: <Widget>[
160-
ItemBuilder.buildCopyItem(
161-
context,
162-
child: Text(
163-
item.name ?? "",
164-
style: const TextStyle(
165-
fontSize: 16,
166-
fontWeight: FontWeight.bold,
167-
),
138+
child: ClipRRect(
139+
borderRadius: BorderRadius.circular(10),
140+
child: SizedBox(
141+
height: 80,
142+
width: 80,
143+
child: ItemBuilder.buildCachedImage(
144+
context: context,
145+
fit: BoxFit.cover,
146+
showLoading: false,
147+
imageUrl: Utils.removeWatermark(item.coverUrl ?? ""),
168148
),
169-
copyText: item.name ?? "",
170-
toastText: "已复制收藏夹名称",
171149
),
172-
const SizedBox(height: 10),
173-
ItemBuilder.buildCopyItem(context,
174-
child: Text(
175-
"ID: ${item.id}",
150+
),
151+
),
152+
Expanded(
153+
child: Container(
154+
padding: const EdgeInsets.only(left: 10),
155+
child: Column(
156+
crossAxisAlignment: CrossAxisAlignment.start,
157+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
158+
mainAxisSize: MainAxisSize.max,
159+
children: <Widget>[
160+
ItemBuilder.buildCopyItem(
161+
context,
162+
child: Text(
163+
item.name ?? "",
164+
style: const TextStyle(
165+
fontSize: 16,
166+
fontWeight: FontWeight.bold,
167+
),
168+
),
169+
copyText: item.name ?? "",
170+
toastText: "已复制收藏夹名称",
171+
),
172+
const SizedBox(height: 10),
173+
ItemBuilder.buildCopyItem(context,
174+
child: Text(
175+
"ID: ${item.id}",
176+
style: Theme.of(context).textTheme.titleSmall,
177+
),
178+
copyText: item.id.toString(),
179+
toastText: "已复制收藏夹ID"),
180+
const SizedBox(height: 10),
181+
Text(
182+
"${item.postCount}篇",
176183
style: Theme.of(context).textTheme.titleSmall,
177184
),
178-
copyText: item.id.toString(),
179-
toastText: "已复制收藏夹ID"),
180-
const SizedBox(height: 10),
181-
Text(
182-
"${item.postCount}篇",
183-
style: Theme.of(context).textTheme.titleSmall,
185+
],
184186
),
185-
],
187+
),
186188
),
187-
),
189+
],
188190
),
189-
],
191+
),
190192
),
191193
);
192194
}

lib/Screens/Info/history_screen.dart

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ import 'package:loftify/Models/history_response.dart';
77
import 'package:loftify/Resources/theme.dart';
88
import 'package:loftify/Utils/hive_util.dart';
99
import 'package:tuple/tuple.dart';
10-
import 'package:waterfall_flow/waterfall_flow.dart';
1110

12-
import '../../Api/post_api.dart';
1311
import '../../Models/post_detail_response.dart';
14-
import '../../Utils/enums.dart';
1512
import '../../Utils/itoast.dart';
1613
import '../../Utils/utils.dart';
1714
import '../../Widgets/BottomSheet/bottom_sheet_builder.dart';
@@ -37,7 +34,6 @@ class _HistoryScreenState extends State<HistoryScreen>
3734
final List<ArchiveData> _archiveDataList = [];
3835
int _total = 0;
3936
int _recordHistory = 0;
40-
HistoryLayoutMode _layoutMode = HistoryLayoutMode.nineGrid;
4137
bool _loading = false;
4238
final EasyRefreshController _refreshController = EasyRefreshController();
4339
bool _noMore = false;
@@ -122,20 +118,11 @@ class _HistoryScreenState extends State<HistoryScreen>
122118
onRefresh: _onRefresh,
123119
onLoad: _onLoad,
124120
triggerAxis: Axis.vertical,
125-
child: _buildBody(),
121+
child: _buildNineGridGroup(),
126122
),
127123
);
128124
}
129125

130-
Widget _buildBody() {
131-
switch (_layoutMode) {
132-
case HistoryLayoutMode.waterFlow:
133-
return _buildWaterflow();
134-
case HistoryLayoutMode.nineGrid:
135-
return _buildNineGridGroup();
136-
}
137-
}
138-
139126
Widget _buildNineGridGroup() {
140127
List<Widget> widgets = [];
141128
int startIndex = 0;
@@ -186,56 +173,7 @@ class _HistoryScreenState extends State<HistoryScreen>
186173
);
187174
}
188175

189-
Widget _buildWaterflow() {
190-
return ItemBuilder.buildLoadMoreNotification(
191-
noMore: _noMore,
192-
onLoad: _onLoad,
193-
child: WaterfallFlow.builder(
194-
cacheExtent: 9999,
195-
padding: const EdgeInsets.only(top: 10, left: 8, right: 8),
196-
gridDelegate: const SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
197-
mainAxisSpacing: 6,
198-
crossAxisSpacing: 6,
199-
maxCrossAxisExtent: 300,
200-
),
201-
itemBuilder: (BuildContext context, int index) {
202-
return CommonInfoItemBuilder.buildWaterfallFlowPostItem(
203-
context, _histories[index], onLikeTap: () async {
204-
var item = _histories[index];
205-
HapticFeedback.mediumImpact();
206-
return await PostApi.likeOrUnLike(
207-
isLike: !(item.liked == true),
208-
postId: item.post!.id,
209-
blogId: item.post!.blogId,
210-
).then((value) {
211-
setState(() {
212-
if (value['meta']['status'] != 200) {
213-
IToast.showTop(value['meta']['desc'] ?? value['meta']['msg']);
214-
} else {
215-
item.liked = !(item.liked == true);
216-
item.post!.postCount?.favoriteCount +=
217-
item.liked == true ? 1 : -1;
218-
}
219-
});
220-
return value['meta']['status'];
221-
});
222-
});
223-
},
224-
itemCount: _histories.length,
225-
),
226-
);
227-
}
228-
229176
PreferredSizeWidget _buildAppBar() {
230-
IconData icon = Icons.transform_rounded;
231-
switch (_layoutMode) {
232-
case HistoryLayoutMode.waterFlow:
233-
icon = Icons.layers_outlined;
234-
break;
235-
case HistoryLayoutMode.nineGrid:
236-
icon = Icons.grid_3x3_rounded;
237-
break;
238-
}
239177
return ItemBuilder.buildAppBar(
240178
context: context,
241179
leading: Icons.arrow_back_rounded,
@@ -245,15 +183,6 @@ class _HistoryScreenState extends State<HistoryScreen>
245183
},
246184
title: Text("我的足迹", style: Theme.of(context).textTheme.titleLarge),
247185
actions: [
248-
ItemBuilder.buildIconButton(
249-
context: context,
250-
icon: Icon(icon, color: Theme.of(context).iconTheme.color),
251-
onTap: () {
252-
_layoutMode = HistoryLayoutMode.values[
253-
(_layoutMode.index + 1) % HistoryLayoutMode.values.length];
254-
setState(() {});
255-
}),
256-
const SizedBox(width: 5),
257186
ItemBuilder.buildIconButton(
258187
context: context,
259188
icon: Icon(Icons.more_vert_rounded,

lib/Screens/Info/like_screen.dart

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import 'package:loftify/Models/history_response.dart';
77
import 'package:loftify/Resources/theme.dart';
88
import 'package:loftify/Utils/hive_util.dart';
99
import 'package:tuple/tuple.dart';
10-
import 'package:waterfall_flow/waterfall_flow.dart';
1110

12-
import '../../Api/post_api.dart';
1311
import '../../Models/post_detail_response.dart';
1412
import '../../Utils/enums.dart';
1513
import '../../Utils/itoast.dart';
@@ -51,7 +49,6 @@ class _LikeScreenState extends State<LikeScreen>
5149
final List<PostDetailData> _likeList = [];
5250
List<ArchiveData> _archiveDataList = [];
5351
int _total = 0;
54-
HistoryLayoutMode _layoutMode = HistoryLayoutMode.nineGrid;
5552
bool _loading = false;
5653
final EasyRefreshController _refreshController = EasyRefreshController();
5754
bool _noMore = false;
@@ -161,21 +158,12 @@ class _LikeScreenState extends State<LikeScreen>
161158
onLoad: _onLoad,
162159
triggerAxis: Axis.vertical,
163160
childBuilder: (context, physics) {
164-
return _buildBody(physics);
161+
return _buildNineGridGroup(physics);
165162
},
166163
),
167164
);
168165
}
169166

170-
Widget _buildBody(ScrollPhysics physics) {
171-
switch (_layoutMode) {
172-
case HistoryLayoutMode.waterFlow:
173-
return _buildWaterflow(physics);
174-
case HistoryLayoutMode.nineGrid:
175-
return _buildNineGridGroup(physics);
176-
}
177-
}
178-
179167
Widget _buildNineGridGroup(ScrollPhysics physics) {
180168
List<Widget> widgets = [];
181169
int startIndex = 0;
@@ -225,61 +213,7 @@ class _LikeScreenState extends State<LikeScreen>
225213
);
226214
}
227215

228-
Widget _buildWaterflow(ScrollPhysics physics) {
229-
return ItemBuilder.buildLoadMoreNotification(
230-
noMore: _noMore,
231-
onLoad: _onLoad,
232-
child: WaterfallFlow.builder(
233-
physics: physics,
234-
cacheExtent: 9999,
235-
padding: const EdgeInsets.only(top: 10, left: 8, right: 8),
236-
gridDelegate: const SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
237-
mainAxisSpacing: 6,
238-
crossAxisSpacing: 6,
239-
maxCrossAxisExtent: 300,
240-
),
241-
itemBuilder: (BuildContext context, int index) {
242-
return CommonInfoItemBuilder.buildWaterfallFlowPostItem(
243-
context, _likeList[index], onLikeTap: () async {
244-
var item = _likeList[index];
245-
HapticFeedback.mediumImpact();
246-
return await PostApi.likeOrUnLike(
247-
isLike: !(item.liked == true),
248-
postId: item.post!.id,
249-
blogId: item.post!.blogId)
250-
.then((value) {
251-
setState(() {
252-
if (value['meta']['status'] != 200) {
253-
if (Utils.isNotEmpty(
254-
value['meta']['desc'] ?? value['meta']['msg'])) {
255-
IToast.showTop(
256-
value['meta']['desc'] ?? value['meta']['msg']);
257-
}
258-
} else {
259-
item.liked = !(item.liked == true);
260-
item.post!.postCount?.favoriteCount +=
261-
item.liked == true ? 1 : -1;
262-
}
263-
});
264-
return value['meta']['status'];
265-
});
266-
});
267-
},
268-
itemCount: _likeList.length,
269-
),
270-
);
271-
}
272-
273216
PreferredSizeWidget _buildAppBar() {
274-
IconData icon = Icons.transform_rounded;
275-
switch (_layoutMode) {
276-
case HistoryLayoutMode.waterFlow:
277-
icon = Icons.layers_outlined;
278-
break;
279-
case HistoryLayoutMode.nineGrid:
280-
icon = Icons.grid_3x3_rounded;
281-
break;
282-
}
283217
return ItemBuilder.buildAppBar(
284218
context: context,
285219
leading: Icons.arrow_back_rounded,
@@ -289,15 +223,6 @@ class _LikeScreenState extends State<LikeScreen>
289223
},
290224
title: Text("我的喜欢", style: Theme.of(context).textTheme.titleLarge),
291225
actions: [
292-
ItemBuilder.buildIconButton(
293-
context: context,
294-
icon: Icon(icon, color: Theme.of(context).iconTheme.color),
295-
onTap: () {
296-
_layoutMode = HistoryLayoutMode.values[
297-
(_layoutMode.index + 1) % HistoryLayoutMode.values.length];
298-
setState(() {});
299-
}),
300-
const SizedBox(width: 5),
301226
ItemBuilder.buildIconButton(
302227
context: context,
303228
icon: Icon(Icons.more_vert_rounded,

0 commit comments

Comments
 (0)