Skip to content

Commit

Permalink
v24.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mrquantumoff committed Jan 13, 2024
1 parent ede8915 commit 7b60c7c
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 47 deletions.
6 changes: 6 additions & 0 deletions dev.mrquantumoff.mcmodpackmanager.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
</keywords>
<releases>

<release date="2024-01-13" version="24.1.0">
<description>
<p>Update dependencies and redesign some things related to mods.</p>
</description>
</release>

<release date="2023-12-16" version="23.12.1">
<description>
<p>Update dependencies</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@ class _ShareModpacksPageState extends State<ShareModpacksPage> {
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,
),
),
Expand Down
11 changes: 4 additions & 7 deletions lib/pages/web/mod/mod.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,7 @@ class _ModState extends State<Mod> 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(
Expand Down Expand Up @@ -189,7 +185,8 @@ class _ModState extends State<Mod> 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,
Expand Down Expand Up @@ -314,7 +311,7 @@ class _ModState extends State<Mod> 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;
Expand Down Expand Up @@ -417,7 +414,7 @@ class _ModState extends State<Mod> with AutomaticKeepAliveClientMixin {
)
: SizedBox.fromSize(
size: const Size(240, 2),
child: const CircularProgressIndicator(),
child: const LinearProgressIndicator(),
)
: Container(),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,38 @@ class _UpdateModpackPageState extends State<UpdateModpackPage> {
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(),
),
),
),
);
Expand Down
43 changes: 26 additions & 17 deletions lib/pages/web/web_sources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ class _WebSourcesPageState extends State<WebSourcesPage> {
TextEditingController searchFieldController = TextEditingController();
List<Widget> searchResults = [];
bool areButtonsEnabled = true;
bool isLoading = false;

void setIsLoading(bool value) {
setState(() {
isLoading = value;
});
}

void setSearchResults(List<Widget> newSearchResults) {
setState(() {
Expand Down Expand Up @@ -200,13 +207,7 @@ class _WebSourcesPageState extends State<WebSourcesPage> {
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());
Expand Down Expand Up @@ -241,6 +242,7 @@ class _WebSourcesPageState extends State<WebSourcesPage> {
widgets.sort((a, b) {
return b.downloadCount.compareTo(a.downloadCount);
});
setIsLoading(false);
setSearchResults(widgets);
}

Expand Down Expand Up @@ -345,16 +347,23 @@ class _WebSourcesPageState extends State<WebSourcesPage> {
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,
),
),
],
),
),
Expand Down

0 comments on commit 7b60c7c

Please sign in to comment.