Show loading state on search tab init (#1617)
This commit is contained in:
commit
84aa9b88d2
|
@ -1,5 +1,6 @@
|
||||||
import "package:fade_indexed_stack/fade_indexed_stack.dart";
|
import "package:fade_indexed_stack/fade_indexed_stack.dart";
|
||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
|
import "package:flutter_animate/flutter_animate.dart";
|
||||||
import "package:photos/core/constants.dart";
|
import "package:photos/core/constants.dart";
|
||||||
import "package:photos/models/search/search_result.dart";
|
import "package:photos/models/search/search_result.dart";
|
||||||
import "package:photos/models/search/search_types.dart";
|
import "package:photos/models/search/search_types.dart";
|
||||||
|
@ -76,7 +77,7 @@ class _AllSearchSectionsState extends State<AllSearchSections> {
|
||||||
future: InheritedAllSectionsExamples.of(context)
|
future: InheritedAllSectionsExamples.of(context)
|
||||||
.allSectionsExamplesFuture,
|
.allSectionsExamplesFuture,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.hasData) {
|
if (snapshot.hasData && snapshot.data!.isNotEmpty) {
|
||||||
if (snapshot.data!.every((element) => element.isEmpty)) {
|
if (snapshot.data!.every((element) => element.isEmpty)) {
|
||||||
return const Padding(
|
return const Padding(
|
||||||
padding: EdgeInsets.only(bottom: 72),
|
padding: EdgeInsets.only(bottom: 72),
|
||||||
|
@ -94,7 +95,20 @@ class _AllSearchSectionsState extends State<AllSearchSections> {
|
||||||
limit: searchSectionLimit,
|
limit: searchSectionLimit,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
)
|
||||||
|
.animate(
|
||||||
|
delay: const Duration(milliseconds: 150),
|
||||||
|
)
|
||||||
|
.slide(
|
||||||
|
begin: const Offset(0, -0.015),
|
||||||
|
end: const Offset(0, 0),
|
||||||
|
duration: const Duration(milliseconds: 300),
|
||||||
|
curve: Curves.easeOut,
|
||||||
|
)
|
||||||
|
.fadeIn(
|
||||||
|
duration: const Duration(milliseconds: 150),
|
||||||
|
curve: Curves.easeOut,
|
||||||
|
);
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
//Errors are handled and this else if condition will be false always
|
//Errors are handled and this else if condition will be false always
|
||||||
//is the understanding.
|
//is the understanding.
|
||||||
|
|
Loading…
Reference in a new issue