show loading state when memories are being fetched
This commit is contained in:
parent
67c0912fc7
commit
b4705d92ae
1 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,7 @@ import "package:photos/core/event_bus.dart";
|
|||
import "package:photos/events/memories_setting_changed.dart";
|
||||
import 'package:photos/models/memory.dart';
|
||||
import 'package:photos/services/memories_service.dart';
|
||||
import "package:photos/ui/common/loading_widget.dart";
|
||||
import 'package:photos/ui/home/memories/memory_cover_widget.dart';
|
||||
|
||||
class MemoriesWidget extends StatefulWidget {
|
||||
|
@ -58,7 +59,10 @@ class _MemoriesWidgetState extends State<MemoriesWidget> {
|
|||
future: MemoriesService.instance.getMemories(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError || !snapshot.hasData || snapshot.data!.isEmpty) {
|
||||
return const SizedBox.shrink();
|
||||
return SizedBox(
|
||||
height: _maxHeight + 12 + 10,
|
||||
child: const EnteLoadingWidget(),
|
||||
);
|
||||
} else {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
Loading…
Add table
Reference in a new issue