diff --git a/dev.mrquantumoff.mcmodpackmanager.metainfo.xml b/dev.mrquantumoff.mcmodpackmanager.metainfo.xml index 7f8ac28..9571f39 100644 --- a/dev.mrquantumoff.mcmodpackmanager.metainfo.xml +++ b/dev.mrquantumoff.mcmodpackmanager.metainfo.xml @@ -37,6 +37,12 @@ + + +

Update dependencies and redesign some things related to mods.

+
+
+

Update dependencies

diff --git a/lib/pages/modpack_installer/import_modpacks/import_modpacks_page.dart b/lib/pages/modpack_installer/import_modpacks/import_modpacks_page.dart index 7776321..bf7b4e9 100644 --- a/lib/pages/modpack_installer/import_modpacks/import_modpacks_page.dart +++ b/lib/pages/modpack_installer/import_modpacks/import_modpacks_page.dart @@ -211,8 +211,10 @@ class _ShareModpacksPageState extends State { margin: const EdgeInsets.only( bottom: 24, left: 120, right: 120), child: GridView.extent( - maxCrossAxisExtent: 540, - shrinkWrap: true, + maxCrossAxisExtent: 480, + childAspectRatio: 2.25, + padding: const EdgeInsets.symmetric(vertical: 12), + mainAxisSpacing: 24, children: mods, ), ), diff --git a/lib/pages/web/mod/mod.dart b/lib/pages/web/mod/mod.dart index e7365fc..8eb2e43 100644 --- a/lib/pages/web/mod/mod.dart +++ b/lib/pages/web/mod/mod.dart @@ -148,11 +148,7 @@ class _ModState extends State with AutomaticKeepAliveClientMixin { } return Visibility( - maintainSize: widget.showPreVersion, maintainState: widget.showPreVersion, - maintainAnimation: widget.showPreVersion, - maintainInteractivity: widget.showPreVersion, - maintainSemantics: widget.showPreVersion, child: // child: widget.downloadable // ? const Divider( @@ -189,7 +185,8 @@ class _ModState extends State with AutomaticKeepAliveClientMixin { ), ), Container( - margin: const EdgeInsets.only(left: 12), + margin: EdgeInsets.only( + left: 12, top: widget.showPreVersion ? 24 : 0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -314,7 +311,7 @@ class _ModState extends State with AutomaticKeepAliveClientMixin { Container( margin: widget.downloadable ? const EdgeInsets.symmetric(horizontal: 0) - : const EdgeInsets.symmetric(vertical: 20), + : const EdgeInsets.symmetric(vertical: 0), child: TextButton.icon( onPressed: () async { final String slug = widget.slug; @@ -417,7 +414,7 @@ class _ModState extends State with AutomaticKeepAliveClientMixin { ) : SizedBox.fromSize( size: const Size(240, 2), - child: const CircularProgressIndicator(), + child: const LinearProgressIndicator(), ) : Container(), ), diff --git a/lib/pages/web/modpack_update_page/modpack_update_page.dart/modpack_update.dart b/lib/pages/web/modpack_update_page/modpack_update_page.dart/modpack_update.dart index 71eba38..7578743 100644 --- a/lib/pages/web/modpack_update_page/modpack_update_page.dart/modpack_update.dart +++ b/lib/pages/web/modpack_update_page/modpack_update_page.dart/modpack_update.dart @@ -71,27 +71,38 @@ class _UpdateModpackPageState extends State { title: Text(AppLocalizations.of(context)!.update), ), body: Center( - child: FutureBuilder( - builder: (context, snapshot) { - if (!snapshot.hasData) { - return const Center( - child: CircularProgressIndicator(), - ); - } else if (snapshot.hasError) { - return Column( - children: [ - const Icon(Icons.error), - Text(AppLocalizations.of(context)!.unknown) - ], - ); - } else { - return GridView.extent( - maxCrossAxisExtent: 540, - children: snapshot.data ?? [], - ); - } - }, - future: getFullMods(), + child: Visibility( + maintainAnimation: true, + maintainInteractivity: true, + maintainSemantics: true, + maintainSize: true, + maintainState: true, + child: FutureBuilder( + builder: (context, snapshot) { + if (!snapshot.hasData) { + return const Center( + child: CircularProgressIndicator(), + ); + } else if (snapshot.hasError) { + return Column( + children: [ + const Icon(Icons.error), + Text(AppLocalizations.of(context)!.unknown) + ], + ); + } else { + return GridView.extent( + maxCrossAxisExtent: 840, + mainAxisSpacing: 15, + crossAxisSpacing: 0, + childAspectRatio: 2.25, + padding: const EdgeInsets.only(bottom: 120), + children: snapshot.data ?? [], + ); + } + }, + future: getFullMods(), + ), ), ), ); diff --git a/lib/pages/web/web_sources.dart b/lib/pages/web/web_sources.dart index 0116764..a3d3c8c 100644 --- a/lib/pages/web/web_sources.dart +++ b/lib/pages/web/web_sources.dart @@ -39,6 +39,13 @@ class _WebSourcesPageState extends State { TextEditingController searchFieldController = TextEditingController(); List searchResults = []; bool areButtonsEnabled = true; + bool isLoading = false; + + void setIsLoading(bool value) { + setState(() { + isLoading = value; + }); + } void setSearchResults(List newSearchResults) { setState(() { @@ -200,13 +207,7 @@ class _WebSourcesPageState extends State { void searchModsFunction({bool forceSearch = false}) async { if (searchFieldController.text.trim() == "" && !forceSearch) return; bool isCurseForgeAllowed = await checkCurseForge(); - setSearchResults( - searchResults = [ - Container( - margin: const EdgeInsets.only(top: 50, left: 20, right: 20), - child: const LinearProgressIndicator()) - ], - ); + setIsLoading(true); String searchText = Uri.encodeQueryComponent(searchFieldController.text.trim()); @@ -241,6 +242,7 @@ class _WebSourcesPageState extends State { widgets.sort((a, b) { return b.downloadCount.compareTo(a.downloadCount); }); + setIsLoading(false); setSearchResults(widgets); } @@ -345,16 +347,23 @@ class _WebSourcesPageState extends State { Container( margin: const EdgeInsets.only(top: 15), ), - Expanded( - child: GridView.extent( - maxCrossAxisExtent: 540, - mainAxisSpacing: 15, - crossAxisSpacing: 0, - childAspectRatio: 2.25, - padding: const EdgeInsets.only(bottom: 120), - children: searchResults, - ), - ) + isLoading + ? Center( + child: Container( + margin: const EdgeInsets.symmetric(horizontal: 512), + child: const LinearProgressIndicator(), + ), + ) + : Expanded( + child: GridView.extent( + maxCrossAxisExtent: 540, + mainAxisSpacing: 15, + crossAxisSpacing: 0, + childAspectRatio: 2.25, + padding: const EdgeInsets.only(bottom: 120), + children: searchResults, + ), + ), ], ), ),