mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
fix: UI glitch when loading more user artists and albums
This commit is contained in:
parent
6e1cd96903
commit
3c45732b0a
@ -73,41 +73,41 @@ class UserAlbums extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SliverGap(10),
|
const SliverGap(10),
|
||||||
Skeletonizer.sliver(
|
SliverLayoutBuilder(builder: (context, constrains) {
|
||||||
enabled: albumsQuery.isLoading,
|
return SliverGrid.builder(
|
||||||
child: SliverLayoutBuilder(builder: (context, constrains) {
|
itemCount: albums.isEmpty ? 6 : albums.length + 1,
|
||||||
return SliverGrid.builder(
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
itemCount: albums.isEmpty ? 6 : albums.length + 1,
|
maxCrossAxisExtent: 200,
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
mainAxisExtent: constrains.smAndDown ? 225 : 250,
|
||||||
maxCrossAxisExtent: 200,
|
crossAxisSpacing: 8,
|
||||||
mainAxisExtent: constrains.smAndDown ? 225 : 250,
|
mainAxisSpacing: 8,
|
||||||
crossAxisSpacing: 8,
|
),
|
||||||
mainAxisSpacing: 8,
|
itemBuilder: (context, index) {
|
||||||
),
|
if (albums.isNotEmpty && index == albums.length) {
|
||||||
itemBuilder: (context, index) {
|
if (albumsQuery.asData?.value.hasMore != true) {
|
||||||
if (albums.isNotEmpty && index == albums.length) {
|
return const SizedBox.shrink();
|
||||||
if (albumsQuery.asData?.value.hasMore != true) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Waypoint(
|
|
||||||
controller: controller,
|
|
||||||
isGrid: true,
|
|
||||||
onTouchEdge: albumsQueryNotifier.fetchMore,
|
|
||||||
child: Skeletonizer(
|
|
||||||
enabled: true,
|
|
||||||
child: AlbumCard(FakeData.albumSimple),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return AlbumCard(
|
return Waypoint(
|
||||||
albums.elementAtOrNull(index) ?? FakeData.albumSimple,
|
controller: controller,
|
||||||
|
isGrid: true,
|
||||||
|
onTouchEdge: albumsQueryNotifier.fetchMore,
|
||||||
|
child: Skeletonizer(
|
||||||
|
enabled: true,
|
||||||
|
child: AlbumCard(FakeData.albumSimple),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
);
|
|
||||||
}),
|
return Skeletonizer(
|
||||||
),
|
enabled: albumsQuery.isLoading,
|
||||||
|
child: AlbumCard(
|
||||||
|
albums.elementAtOrNull(index) ?? FakeData.albumSimple,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -74,45 +74,45 @@ class UserArtists extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SliverGap(10),
|
const SliverGap(10),
|
||||||
Skeletonizer.sliver(
|
SliverLayoutBuilder(builder: (context, constrains) {
|
||||||
enabled: artistQuery.isLoading,
|
return SliverGrid.builder(
|
||||||
child: SliverLayoutBuilder(builder: (context, constrains) {
|
itemCount: filteredArtists.isEmpty
|
||||||
return SliverGrid.builder(
|
? 6
|
||||||
itemCount: filteredArtists.isEmpty
|
: filteredArtists.length + 1,
|
||||||
? 6
|
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
||||||
: filteredArtists.length + 1,
|
maxCrossAxisExtent: 200,
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
mainAxisExtent: constrains.smAndDown ? 225 : 250,
|
||||||
maxCrossAxisExtent: 200,
|
crossAxisSpacing: 8,
|
||||||
mainAxisExtent: constrains.smAndDown ? 225 : 250,
|
mainAxisSpacing: 8,
|
||||||
crossAxisSpacing: 8,
|
),
|
||||||
mainAxisSpacing: 8,
|
itemBuilder: (context, index) {
|
||||||
),
|
if (filteredArtists.isNotEmpty &&
|
||||||
itemBuilder: (context, index) {
|
index == filteredArtists.length) {
|
||||||
if (filteredArtists.isNotEmpty &&
|
if (artistQuery.asData?.value.hasMore != true) {
|
||||||
index == filteredArtists.length) {
|
return const SizedBox.shrink();
|
||||||
if (artistQuery.asData?.value.hasMore != true) {
|
|
||||||
return const SizedBox.shrink();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Waypoint(
|
|
||||||
controller: controller,
|
|
||||||
isGrid: true,
|
|
||||||
onTouchEdge: artistQueryNotifier.fetchMore,
|
|
||||||
child: Skeletonizer(
|
|
||||||
enabled: true,
|
|
||||||
child: ArtistCard(FakeData.artist),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ArtistCard(
|
return Waypoint(
|
||||||
|
controller: controller,
|
||||||
|
isGrid: true,
|
||||||
|
onTouchEdge: artistQueryNotifier.fetchMore,
|
||||||
|
child: Skeletonizer(
|
||||||
|
enabled: true,
|
||||||
|
child: ArtistCard(FakeData.artist),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Skeletonizer(
|
||||||
|
enabled: artistQuery.isLoading,
|
||||||
|
child: ArtistCard(
|
||||||
filteredArtists.elementAtOrNull(index) ??
|
filteredArtists.elementAtOrNull(index) ??
|
||||||
FakeData.artist,
|
FakeData.artist,
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
);
|
},
|
||||||
}),
|
);
|
||||||
),
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
57
pubspec.lock
57
pubspec.lock
@ -731,12 +731,11 @@ packages:
|
|||||||
flutter_discord_rpc:
|
flutter_discord_rpc:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "packages/flutter_discord_rpc"
|
name: flutter_discord_rpc
|
||||||
ref: cargokit
|
sha256: "9363a803863d56fd89c0a21639c70b126245fcbafaeb0a3d091e7ac06951d03f"
|
||||||
resolved-ref: "331636d8e378e3ac9ad30a4b0d3eed17d5a85fe9"
|
url: "https://pub.dev"
|
||||||
url: "https://github.com/KRTirtho/frb_plugins.git"
|
source: hosted
|
||||||
source: git
|
version: "1.0.0"
|
||||||
version: "0.1.0+1"
|
|
||||||
flutter_displaymode:
|
flutter_displaymode:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -895,10 +894,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: flutter_rust_bridge
|
name: flutter_rust_bridge
|
||||||
sha256: fac14d2dd67eeba29a20e5d99fac0d4d9fcd552cdf6bf4f8945f7679c6b07b1d
|
sha256: "0ad5079de35d317650fec59b26cb4d0c116ebc2ce703a29f9367513b8a91c287"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.0"
|
version: "2.5.0"
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1319,6 +1318,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.0"
|
version: "3.0.0"
|
||||||
|
lists:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: lists
|
||||||
|
sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.1"
|
||||||
local_notifier:
|
local_notifier:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1450,12 +1457,11 @@ packages:
|
|||||||
metadata_god:
|
metadata_god:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "packages/metadata_god"
|
name: metadata_god
|
||||||
ref: cargokit
|
sha256: "025d8149059f62f44108ab9d74ebd77aa8f0af98b238f3f25121a4711ee3e5d0"
|
||||||
resolved-ref: "331636d8e378e3ac9ad30a4b0d3eed17d5a85fe9"
|
url: "https://pub.dev"
|
||||||
url: "https://github.com/KRTirtho/frb_plugins.git"
|
source: hosted
|
||||||
source: git
|
version: "1.0.0"
|
||||||
version: "0.5.3"
|
|
||||||
mime:
|
mime:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1945,12 +1951,11 @@ packages:
|
|||||||
smtc_windows:
|
smtc_windows:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: "packages/smtc_windows"
|
name: smtc_windows
|
||||||
ref: cargokit
|
sha256: "80f7c10867da485ffdf87f842bf27e6763589933c18c11af5dc1cd1e158c3154"
|
||||||
resolved-ref: "331636d8e378e3ac9ad30a4b0d3eed17d5a85fe9"
|
url: "https://pub.dev"
|
||||||
url: "https://github.com/KRTirtho/frb_plugins.git"
|
source: hosted
|
||||||
source: git
|
version: "1.0.0"
|
||||||
version: "0.1.3"
|
|
||||||
source_gen:
|
source_gen:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2183,6 +2188,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.2"
|
version: "1.3.2"
|
||||||
|
unicode:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: unicode
|
||||||
|
sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.3.1"
|
||||||
universal_io:
|
universal_io:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -2427,10 +2440,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: youtube_explode_dart
|
name: youtube_explode_dart
|
||||||
sha256: "28dca07fefb4b6518beab95f0c1ef81031f921ed0fe87ebcd9c51378546edfee"
|
sha256: "523a01ef948607d3e8fdcdcdcef1ce805c7d26480f609e3b209d1c73520a6c3c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.3"
|
version: "2.3.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.5.0 <4.0.0"
|
dart: ">=3.5.0 <4.0.0"
|
||||||
flutter: ">=3.24.0"
|
flutter: ">=3.24.0"
|
||||||
|
20
pubspec.yaml
20
pubspec.yaml
@ -62,11 +62,7 @@ dependencies:
|
|||||||
logger: ^2.0.2
|
logger: ^2.0.2
|
||||||
media_kit: ^1.1.10+1
|
media_kit: ^1.1.10+1
|
||||||
media_kit_libs_audio: ^1.0.4
|
media_kit_libs_audio: ^1.0.4
|
||||||
metadata_god:
|
metadata_god: ^1.0.0
|
||||||
git:
|
|
||||||
url: https://github.com/KRTirtho/frb_plugins.git
|
|
||||||
path: packages/metadata_god
|
|
||||||
ref: cargokit
|
|
||||||
mime: ^1.0.2
|
mime: ^1.0.2
|
||||||
package_info_plus: ^6.0.0
|
package_info_plus: ^6.0.0
|
||||||
palette_generator: ^0.3.3
|
palette_generator: ^0.3.3
|
||||||
@ -82,11 +78,7 @@ dependencies:
|
|||||||
scroll_to_index: ^3.0.1
|
scroll_to_index: ^3.0.1
|
||||||
sidebarx: ^0.17.1
|
sidebarx: ^0.17.1
|
||||||
shared_preferences: ^2.2.3
|
shared_preferences: ^2.2.3
|
||||||
smtc_windows:
|
smtc_windows: ^1.0.0
|
||||||
git:
|
|
||||||
url: https://github.com/KRTirtho/frb_plugins.git
|
|
||||||
path: packages/smtc_windows
|
|
||||||
ref: cargokit
|
|
||||||
stroke_text: ^0.0.2
|
stroke_text: ^0.0.2
|
||||||
system_theme: ^2.1.0
|
system_theme: ^2.1.0
|
||||||
titlebar_buttons: ^1.0.0
|
titlebar_buttons: ^1.0.0
|
||||||
@ -95,7 +87,7 @@ dependencies:
|
|||||||
version: ^3.0.2
|
version: ^3.0.2
|
||||||
visibility_detector: ^0.4.0+2
|
visibility_detector: ^0.4.0+2
|
||||||
window_manager: ^0.3.9
|
window_manager: ^0.3.9
|
||||||
youtube_explode_dart: ^2.2.3
|
youtube_explode_dart: ^2.3.1
|
||||||
simple_icons: ^10.1.3
|
simple_icons: ^10.1.3
|
||||||
jiosaavn: ^0.1.0
|
jiosaavn: ^0.1.0
|
||||||
draggable_scrollbar:
|
draggable_scrollbar:
|
||||||
@ -105,11 +97,7 @@ dependencies:
|
|||||||
very_good_infinite_list: ^0.7.1
|
very_good_infinite_list: ^0.7.1
|
||||||
gap: ^3.0.1
|
gap: ^3.0.1
|
||||||
sliver_tools: ^0.2.12
|
sliver_tools: ^0.2.12
|
||||||
flutter_discord_rpc:
|
flutter_discord_rpc: ^1.0.0
|
||||||
git:
|
|
||||||
url: https://github.com/KRTirtho/frb_plugins.git
|
|
||||||
path: packages/flutter_discord_rpc
|
|
||||||
ref: cargokit
|
|
||||||
html_unescape: ^2.0.0
|
html_unescape: ^2.0.0
|
||||||
wikipedia_api: ^0.1.0
|
wikipedia_api: ^0.1.0
|
||||||
skeletonizer: ^1.1.1
|
skeletonizer: ^1.1.1
|
||||||
|
Loading…
Reference in New Issue
Block a user