changed skeleton to only show when loading

This commit is contained in:
2025-11-16 19:53:32 +01:00
parent 4befc85c9f
commit 9ffb7d6ca3

View File

@@ -68,17 +68,16 @@ class _GroupsViewState extends State<GroupsView> {
} }
final bool isLoading = final bool isLoading =
snapshot.connectionState == ConnectionState.waiting; snapshot.connectionState == ConnectionState.waiting;
final List<Group> groups = skeletonData; final List<Group> groups = isLoading
//final List<Group> groups = isLoading ? skeletonData
// ? skeletonData : (snapshot.data ?? []);
// : (snapshot.data ?? []);
return Skeletonizer( return Skeletonizer(
effect: PulseEffect( effect: PulseEffect(
from: Colors.grey[800]!, from: Colors.grey[800]!,
to: Colors.grey[600]!, to: Colors.grey[600]!,
duration: const Duration(milliseconds: 800), duration: const Duration(milliseconds: 800),
), ),
enabled: true, enabled: isLoading,
enableSwitchAnimation: true, enableSwitchAnimation: true,
switchAnimationConfig: const SwitchAnimationConfig( switchAnimationConfig: const SwitchAnimationConfig(
duration: Duration(milliseconds: 200), duration: Duration(milliseconds: 200),