Skip to content

feat: Download Pages重构#9

Open
futurw4v wants to merge 28 commits intolxdklp:mainfrom
futurw4v:feat/download_page
Open

feat: Download Pages重构#9
futurw4v wants to merge 28 commits intolxdklp:mainfrom
futurw4v:feat/download_page

Conversation

@futurw4v
Copy link
Contributor

  1. 添加模型NavigationDrawerItem(简化侧边栏导航实例创建), MinecraftVersion(便于版本管理)
  2. 在constants里规定了默认间距
  3. 添加intl库,用于格式化时间
  4. 重命名了部分下载有关的页面,移除了test.dart
  5. 重构DownloadGamePage,DownloadVersionPage的排版等,更符合MD3和桌面端等操作逻辑

还有现在的UI看起来比较割裂,后续会梳理统一
以及我觉得这个字体字重看起来有点问题
可以的话我到时候改一下
如:
image

这个是我之前的,字重看起来更合理
image

代码写的有点乱(
原本的文件与文件夹的位置有点不合理,比如Model都是分开放的

还有很多画的大饼没写(
这几天会整完:

  1. 梳理项目文件结构
  2. 重构更多页面
  3. 更改字重(if)

后续会提PR

想不到有啥写的了,脑子有点乱
新年快乐 o( ̄▽ ̄)o

@futurw4v futurw4v changed the title feat: Download Page重构 feat: Download Pages重构 Feb 16, 2026
@dvdamghier dvdamghier requested a review from Copilot February 16, 2026 13:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Download Pages with a new Material Design 3 (MD3) UI structure. It introduces data models to improve code organization, adds time formatting via the intl package, and restructures download-related pages with better navigation patterns using NavigationDrawer instead of TabBar.

Changes:

  • Adds MinecraftVersion and NavigationDrawerItem models for better data management and UI component abstraction
  • Introduces kDefaultPadding constant and intl package for standardized spacing and date formatting
  • Refactors download pages with NavigationDrawer-based navigation and FutureBuilder pattern for better async handling
  • Renames page files (home.dart → home_page.dart, etc.) for consistency and removes unused test.dart

Reviewed changes

Copilot reviewed 10 out of 14 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
pubspec.yaml Adds intl dependency (^0.20.2) for date/time formatting
pubspec.lock Updates transitive dependencies (characters, matcher, material_color_utilities, test_api) and adds intl
lib/pages/test.dart Removes unused test page (NewPage class)
lib/pages/setting_page.dart Renames from setting.dart with Card-based settings layout
lib/pages/online_page.dart Renames from online.dart with same EasyTier functionality
lib/pages/model/navigation_drawer_item.dart Adds model for NavigationDrawer items with page and destination
lib/pages/home_page.dart Renames from home.dart with Card-based game info display
lib/pages/download_page.dart Refactored from download.dart, replaces TabBar with NavigationDrawer and IndexedStack
lib/pages/download/download_version/download_game.dart Major refactor: uses MinecraftVersion model, improved layout with consistent padding, switch statement for loader selection
lib/pages/download/download_version.dart Major refactor: FutureBuilder for async loading, CustomScrollView with SliverAppBar, SegmentedButton for version type filtering, improved error handling
lib/model/minecraft_version.dart New model representing Minecraft version data from API with VersionType enum and parsing utilities
lib/main.dart Updates imports to reflect renamed page files
lib/constants.dart Adds kDefaultPadding constant (16.0) for consistent UI spacing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lxdklp
Copy link
Owner

lxdklp commented Feb 16, 2026

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

@futurw4v
Copy link
Contributor Author

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果
image
image

@lxdklp
Copy link
Owner

lxdklp commented Feb 16, 2026

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

@futurw4v
Copy link
Contributor Author

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

@futurw4v futurw4v requested a review from lxdklp February 16, 2026 16:17
@lxdklp
Copy link
Owner

lxdklp commented Feb 16, 2026

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

@futurw4v
Copy link
Contributor Author

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

@futurw4v
Copy link
Contributor Author

我觉得NavigationDrawer这个问题应该要限制最小窗口大小了,比如PCL都是限制拉不动的 不可能给用户这样随便拉,就算手动指定了大小 你拉到最小还是会因为ListTile的问题崩溃

@futurw4v
Copy link
Contributor Author

对了还要加个根据DPI缩放窗口大小,要不然高DPI设备一打开糊一脸

@lxdklp
Copy link
Owner

lxdklp commented Feb 16, 2026

我觉得NavigationDrawer这个问题应该要限制最小窗口大小了,比如PCL都是限制拉不动的 不可能给用户这样随便拉,就算手动指定了大小 你拉到最小还是会因为ListTile的问题崩溃

我觉得NavigationDrawer这个问题应该要限制最小窗口大小了,比如PCL都是限制拉不动的 不可能给用户这样随便拉,就算手动指定了大小 你拉到最小还是会因为ListTile的问题崩溃

确实应该限制窗口大小,不过目前这个NavigationDrawer也确实过大了。还有一点就是macos上app一打开的默认窗口宽度比windows小很多,接近正方形的窗口,目前的NavigationDrawer会导致内容完全不可读

@lxdklp
Copy link
Owner

lxdklp commented Feb 16, 2026

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

这点主要是不想在app内置字体,整个app一半的大小都是被字体文件占据了

@futurw4v
Copy link
Contributor Author

我现在改成600x600最小了 DPI缩放等下个PR,我现在还发现现在的Page存不住状态 ,明天再修吧

@futurw4v
Copy link
Contributor Author

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

这点主要是不想在app内置字体,整个app一半的大小都是被字体文件占据了

这个简单,我记得可以打开应用时获取一次,然后以后就不用获取了

@futurw4v
Copy link
Contributor Author

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

这点主要是不想在app内置字体,整个app一半的大小都是被字体文件占据了

这个简单,我记得可以打开应用时获取一次,然后以后就不用获取了

https://pub.dev/packages/google_fonts 可以看这个库,运行时HTTP获取然后会缓存

@lxdklp
Copy link
Owner

lxdklp commented Feb 17, 2026

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

关于字体这个,我有计划移除思源雅黑以缩小app体积,但是flutter的Windows平台的中文字体有问题,准备解决完就用默认字重字体了,不过我主要开发是在mac上进行的,也一直没去搞 (´・ω・`) 还有也祝你新年快乐喵(゚∀゚)

其实不用手动指定字重的,这是注释掉显式设置字重的效果 image image

自定义字重这个主要是因为默认情况下的思源雅黑在我的MacBook上看着特别细,不太舒服我才去自定义字重的。mac平台上的flutter默认字体没有那么细Σ(`L_` )

想看看是咋样的,实在不行对应平台分别设置

我的想法是Windows平台上指定用系统自带的微软雅黑,其它平台不做特别处理直接使用系统默认字体。我印象里面Windows上的flutter是因为字体回退问题导致看起来奇怪,所以Windows平台上指定微软雅黑应该能解决。软件直接调用系统字体,不打包进app应该没有侵权风险。。。大概吧

但是微软雅黑不符合MaterialDesign吧,侵权应该就不会毕竟是开源不商用

这点主要是不想在app内置字体,整个app一半的大小都是被字体文件占据了

这个简单,我记得可以打开应用时获取一次,然后以后就不用获取了

https://pub.dev/packages/google_fonts 可以看这个库,运行时HTTP获取然后会缓存

字体这个先不急吧,个人认为优先级不是很高(´・ω・`)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@futurw4v
Copy link
Contributor Author

futurw4v commented Feb 17, 2026

_versionList.contains(_versionFolderName)这个判断条件好像不能判断文件夹是否存在,以及我现在才知道约定式提交type后面可以加scope. _ /

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 14 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

final selectedPath = prefs.getString('SelectedPath') ?? '';
final gameList = prefs.getStringList('Game_$selectedPath') ?? [];
setState(() {
_versionList = gameList;
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After _versionList is loaded, the current form validity isn’t recomputed. If the default folder name already exists, _isFormValid can remain true (because initial validation ran before _versionList was populated), allowing navigation with a duplicate name. Re-run validation and update _isFormValid after _versionList is set.

Suggested change
_versionList = gameList;
_versionList = gameList;
// After loading the version list, recompute form validity so that
// a default folder name that already exists is not treated as valid.
if (gameList.contains(widget.version.id)) {
_isFormValid = false;
}

Copilot uses AI. Check for mistakes.
Comment on lines +387 to +390
setState(() {
_fabricVersionList = versions;
_fabricJson = loaderData;
});
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setState() is called after an await in _loadFabricList() without a mounted check. Add if (!mounted) return; before setState() to avoid exceptions if the page is disposed while the network request is in flight.

Copilot uses AI. Check for mistakes.
Comment on lines +445 to +448
setState(() {
_neoForgeStableVersions = stableVersions;
_neoforgeBetaVersions = betaVersions;
});
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setState() is called after an await in _loadNeoForgeList() without a mounted check. Add if (!mounted) return; before setState() to avoid exceptions if the page is disposed while the network request is in flight.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +4
library;

Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The library; directive here is unnecessary (and can trigger the unnecessary_library_directive lint under flutter_lints). Consider removing it, or give the library a proper name if you intentionally want a named library.

Suggested change
library;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants