Skip to content

Commit 28c5c44

Browse files
Support Windows installation;Update version to 1.9.0
1 parent 078cb43 commit 28c5c44

File tree

76 files changed

+2390
-2687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+2390
-2687
lines changed

certificate/Loftify.iss

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "Loftify"
5+
#define MyAppVersion "1.9.0"
6+
#define MyAppPublisher "Cloudchewie"
7+
#define MyAppURL "https://apps.cloudchewie.com/loftify"
8+
#define MyAppExeName "Loftify.exe"
9+
10+
[Setup]
11+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
12+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
13+
AppId={{BED24EC1-0C45-4AED-94C7-69F3A620CFCD}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
VersionInfoVersion = {#MyAppVersion}
17+
;AppVerName={#MyAppName} {#MyAppVersion}
18+
AppPublisher={#MyAppPublisher}
19+
AppPublisherURL={#MyAppURL}
20+
AppSupportURL={#MyAppURL}
21+
AppUpdatesURL={#MyAppURL}
22+
AppCopyright=Copyright (C) 2024 {#MyAppPublisher}, Inc.
23+
DefaultDirName={autopf}\{#MyAppName}
24+
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
25+
; on anything but x64 and Windows 11 on Arm.
26+
ArchitecturesAllowed=x64compatible
27+
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
28+
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
29+
; meaning it should use the native 64-bit Program Files directory and
30+
; the 64-bit view of the registry.
31+
ArchitecturesInstallIn64BitMode=x64compatible
32+
DisableProgramGroupPage=yes
33+
LicenseFile=D:\Repositories\Loftify\LICENSE
34+
; Remove the following line to run in administrative install mode (install for all users.)
35+
PrivilegesRequiredOverridesAllowed=commandline
36+
OutputDir=D:\Ruida\Downloads
37+
OutputBaseFilename={#MyAppName}-{#MyAppVersion}
38+
SetupIconFile=D:\Repositories\Loftify\assets\logo-transparent-big.ico
39+
Compression=lzma
40+
SolidCompression=yes
41+
WizardStyle=modern
42+
43+
[Languages]
44+
Name: "english"; MessagesFile: "compiler:Default.isl"
45+
46+
[Tasks]
47+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
48+
49+
[Files]
50+
Source: "D:\Repositories\Loftify\build\windows\x64\runner\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
51+
Source: "D:\Repositories\Loftify\build\windows\x64\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
52+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
53+
54+
[Icons]
55+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
56+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
57+
58+
[Run]
59+
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
60+

lib/Resources/fonts.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ enum FontEnum {
5757

5858
static getCurrentFont() {
5959
return FontEnum.values[Utils.patchEnum(
60-
HiveUtil.getInt(key: HiveUtil.fontFamilyKey, defaultValue: 0),
60+
HiveUtil.getInt(HiveUtil.fontFamilyKey, defaultValue: 0),
6161
FontEnum.values.length,
6262
)];
6363
}
@@ -93,7 +93,7 @@ enum FontEnum {
9393
static void loadFont(BuildContext context, FontEnum item,
9494
{bool autoRestartApp = false}) async {
9595
var dialog = showProgressDialog(context, msg: "已下载");
96-
await HiveUtil.put(key: HiveUtil.fontFamilyKey, value: item.index);
96+
await HiveUtil.put(HiveUtil.fontFamilyKey, item.index);
9797
await FontEnum.downloadFont(
9898
context: context,
9999
onFinished: (value) {

lib/Resources/theme_color_data.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ class ThemeColorData {
271271
thumbColor: WidgetStateProperty.resolveWith((states) {
272272
if (states.contains(WidgetState.selected)) {
273273
return canvasBackground;
274+
} else if (states.contains(WidgetState.disabled)) {
275+
return Colors.grey;
274276
} else {
275277
return textGrayColor.withAlpha(200);
276278
}

lib/Screens/Info/dress_detail_screen.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class _DressDetailScreenState extends State<DressDetailScreen>
4848
}
4949
super.initState();
5050
_onRefresh();
51-
currentAvatarImg = HiveUtil.getString(
52-
key: HiveUtil.customAvatarBoxKey, defaultValue: null);
51+
currentAvatarImg =
52+
HiveUtil.getString(HiveUtil.customAvatarBoxKey, defaultValue: null);
5353
setState(() {});
5454
}
5555

@@ -126,12 +126,12 @@ class _DressDetailScreenState extends State<DressDetailScreen>
126126
_dressOrUnDress(GiftPartItem item) async {
127127
HapticFeedback.mediumImpact();
128128
if (currentAvatarImg == item.partUrl) {
129-
await HiveUtil.put(key: HiveUtil.customAvatarBoxKey, value: "");
129+
await HiveUtil.put(HiveUtil.customAvatarBoxKey, "");
130130
currentAvatarImg = "";
131131
setState(() {});
132132
IToast.showTop("取消佩戴成功");
133133
} else {
134-
await HiveUtil.put(key: HiveUtil.customAvatarBoxKey, value: item.partUrl);
134+
await HiveUtil.put(HiveUtil.customAvatarBoxKey, item.partUrl);
135135
currentAvatarImg = item.partUrl;
136136
setState(() {});
137137
IToast.showTop("佩戴成功");

lib/Screens/Info/dress_screen.dart

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'package:loftify/Screens/Info/dress_detail_screen.dart';
88
import 'package:waterfall_flow/waterfall_flow.dart';
99

1010
import '../../Api/dress_api.dart';
11-
import '../../Utils/constant.dart';
1211
import '../../Utils/enums.dart';
1312
import '../../Utils/itoast.dart';
1413
import '../../Utils/route_util.dart';
@@ -40,7 +39,6 @@ class _DressScreenState extends State<DressScreen>
4039
bool _loading = false;
4140
int offset = 0;
4241
final EasyRefreshController _refreshController = EasyRefreshController();
43-
final ScrollController _scrollController = ScrollController();
4442
bool _noMore = false;
4543

4644
@override
@@ -52,13 +50,6 @@ class _DressScreenState extends State<DressScreen>
5250
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
5351
}
5452
super.initState();
55-
_scrollController.addListener(() {
56-
if (!_noMore &&
57-
_scrollController.position.pixels >
58-
_scrollController.position.maxScrollExtent - kLoadExtentOffset) {
59-
_onLoad();
60-
}
61-
});
6253
}
6354

6455
_fetchList({bool refresh = false}) async {
@@ -147,20 +138,23 @@ class _DressScreenState extends State<DressScreen>
147138
}
148139

149140
Widget _buildBody(ScrollPhysics physics) {
150-
return WaterfallFlow.builder(
151-
physics: physics,
152-
cacheExtent: 9999,
153-
controller: _scrollController,
154-
padding: const EdgeInsets.all(10),
155-
itemCount: _giftDressList.length,
156-
gridDelegate: const SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
157-
mainAxisSpacing: 10,
158-
crossAxisSpacing: 10,
159-
maxCrossAxisExtent: 300,
141+
return ItemBuilder.buildLoadMoreNotification(
142+
child: WaterfallFlow.builder(
143+
physics: physics,
144+
cacheExtent: 9999,
145+
padding: const EdgeInsets.all(10),
146+
itemCount: _giftDressList.length,
147+
gridDelegate: const SliverWaterfallFlowDelegateWithMaxCrossAxisExtent(
148+
mainAxisSpacing: 10,
149+
crossAxisSpacing: 10,
150+
maxCrossAxisExtent: 300,
151+
),
152+
itemBuilder: (context, index) {
153+
return _buildGiftDressItem(_giftDressList[index]);
154+
},
160155
),
161-
itemBuilder: (context, index) {
162-
return _buildGiftDressItem(_giftDressList[index]);
163-
},
156+
noMore: _noMore,
157+
onLoad: _onLoad,
164158
);
165159
}
166160

lib/Screens/Info/favorite_folder_detail_screen.dart

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,12 @@ class _FavoriteFolderDetailScreenState extends State<FavoriteFolderDetailScreen>
4343
FavoriteFolderDetailLayoutMode.nineGrid;
4444
bool _loading = false;
4545
final EasyRefreshController _refreshController = EasyRefreshController();
46-
final ScrollController _scrollController = ScrollController();
4746
bool _noMore = false;
4847

4948
@override
5049
void initState() {
5150
super.initState();
5251
favoriteFolderId = widget.favoriteFolderId;
53-
_scrollController.addListener(() {
54-
if (!_noMore &&
55-
_scrollController.position.pixels >
56-
_scrollController.position.maxScrollExtent - kLoadExtentOffset) {
57-
_fetchDetail();
58-
}
59-
});
6052
}
6153

6254
_fetchDetail({bool refresh = false}) async {
@@ -184,37 +176,40 @@ class _FavoriteFolderDetailScreenState extends State<FavoriteFolderDetailScreen>
184176
}
185177

186178
Widget _buildNineGrid(int startIndex, int count) {
187-
return GridView.extent(
188-
controller: _scrollController,
189-
padding: const EdgeInsets.only(top: 12, left: 12, right: 12),
190-
shrinkWrap: true,
191-
maxCrossAxisExtent: 160,
192-
mainAxisSpacing: 6,
193-
crossAxisSpacing: 6,
194-
physics: const NeverScrollableScrollPhysics(),
195-
children: List.generate(count, (index) {
196-
int trueIndex = startIndex + index;
197-
return GestureDetector(
198-
child: FavoriteFolderPostItemBuilder.buildNineGridPostItem(
199-
context, _posts[trueIndex],
200-
wh: 160),
201-
onTap: () {
202-
if (FavoriteFolderPostItemBuilder.isInvalid(_posts[trueIndex])) {
203-
IToast.showTop("无效内容");
204-
} else {
205-
RouteUtil.pushCupertinoRoute(
206-
context,
207-
PostDetailScreen(
208-
favoritePostDetailData: _posts[trueIndex],
209-
isArticle: FavoriteFolderPostItemBuilder.getPostType(
210-
_posts[index]) ==
211-
PostType.article,
212-
),
213-
);
214-
}
215-
},
216-
);
217-
}),
179+
return ItemBuilder.buildLoadMoreNotification(
180+
child: GridView.extent(
181+
padding: const EdgeInsets.only(top: 12, left: 12, right: 12),
182+
shrinkWrap: true,
183+
maxCrossAxisExtent: 160,
184+
mainAxisSpacing: 6,
185+
crossAxisSpacing: 6,
186+
physics: const NeverScrollableScrollPhysics(),
187+
children: List.generate(count, (index) {
188+
int trueIndex = startIndex + index;
189+
return GestureDetector(
190+
child: FavoriteFolderPostItemBuilder.buildNineGridPostItem(
191+
context, _posts[trueIndex],
192+
wh: 160),
193+
onTap: () {
194+
if (FavoriteFolderPostItemBuilder.isInvalid(_posts[trueIndex])) {
195+
IToast.showTop("无效内容");
196+
} else {
197+
RouteUtil.pushCupertinoRoute(
198+
context,
199+
PostDetailScreen(
200+
favoritePostDetailData: _posts[trueIndex],
201+
isArticle: FavoriteFolderPostItemBuilder.getPostType(
202+
_posts[index]) ==
203+
PostType.article,
204+
),
205+
);
206+
}
207+
},
208+
);
209+
}),
210+
),
211+
noMore: _noMore,
212+
onLoad: _onLoad,
218213
);
219214
}
220215

lib/Screens/Info/following_follower_screen.dart

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class _FollowingFollowerScreenState extends State<FollowingFollowerScreen>
4949
bool _loading = false;
5050
int total = 0;
5151
final EasyRefreshController _refreshController = EasyRefreshController();
52-
final ScrollController _scrollController = ScrollController();
5352
bool _noMore = false;
5453

5554
@override
@@ -62,13 +61,6 @@ class _FollowingFollowerScreenState extends State<FollowingFollowerScreen>
6261
}
6362
total = widget.total;
6463
super.initState();
65-
_scrollController.addListener(() {
66-
if (!_noMore &&
67-
_scrollController.position.pixels >
68-
_scrollController.position.maxScrollExtent - kLoadExtentOffset) {
69-
_fetchList();
70-
}
71-
});
7264
}
7365

7466
_processResult(value, {bool refresh = false}) {
@@ -165,17 +157,20 @@ class _FollowingFollowerScreenState extends State<FollowingFollowerScreen>
165157
}
166158

167159
Widget _buildBody(ScrollPhysics physics) {
168-
return WaterfallFlow.extent(
169-
maxCrossAxisExtent: 600,
170-
controller: _scrollController,
171-
physics: physics,
172-
children: List.generate(_followingList.length, (index) {
173-
return ItemBuilder.buildFollowerOrFollowingItem(
174-
context, index, _followingList[index], onFollowOrUnFollow: () {
175-
total += _followingList[index].following ? 1 : -1;
176-
setState(() {});
177-
});
178-
}),
160+
return ItemBuilder.buildLoadMoreNotification(
161+
noMore: _noMore,
162+
onLoad: _onLoad,
163+
child: WaterfallFlow.extent(
164+
maxCrossAxisExtent: 600,
165+
physics: physics,
166+
children: List.generate(_followingList.length, (index) {
167+
return ItemBuilder.buildFollowerOrFollowingItem(
168+
context, index, _followingList[index], onFollowOrUnFollow: () {
169+
total += _followingList[index].following ? 1 : -1;
170+
setState(() {});
171+
});
172+
}),
173+
),
179174
);
180175
}
181176

lib/Screens/Info/history_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class _HistoryScreenState extends State<HistoryScreen>
284284
});
285285
} else if (idx == 1) {
286286
UserApi.deleteInvalidHistory(
287-
blogId: HiveUtil.getInt(key: HiveUtil.userIdKey))
287+
blogId: HiveUtil.getInt(HiveUtil.userIdKey))
288288
.then((value) {
289289
if (value['meta']['status'] != 200) {
290290
IToast.showTop(

lib/Screens/Info/like_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class _LikeScreenState extends State<LikeScreen>
313313
Navigator.pop(sheetContext);
314314
if (idx == 1) {
315315
UserApi.deleteInvalidLike(
316-
blogId: HiveUtil.getInt(key: HiveUtil.userIdKey))
316+
blogId: HiveUtil.getInt(HiveUtil.userIdKey))
317317
.then((value) {
318318
if (value['meta']['status'] != 200) {
319319
IToast.showTop(

lib/Screens/Info/share_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class _ShareScreenState extends State<ShareScreen>
300300
Navigator.pop(sheetContext);
301301
if (idx == 0) {
302302
UserApi.deleteInvalidLike(
303-
blogId: HiveUtil.getInt(key: HiveUtil.userIdKey))
303+
blogId: HiveUtil.getInt(HiveUtil.userIdKey))
304304
.then((value) {
305305
if (value['meta']['status'] != 200) {
306306
IToast.showTop(

0 commit comments

Comments
 (0)