File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,6 +176,15 @@ class _AlbumViewPageState extends State<AlbumViewPage> {
176176 future: _data,
177177 builder: (context, snapshot) {
178178 if (snapshot.hasData) {
179+ if (snapshot.data! .first.hasError && snapshot.data! .last.hasError) {
180+ return Padding (
181+ padding: const EdgeInsets .symmetric (horizontal: 16.0 , vertical: 8.0 ),
182+ child: Text (
183+ appStrings.categoryImageList_noDataError,
184+ textAlign: TextAlign .center,
185+ ),
186+ );
187+ }
179188 return Column (
180189 crossAxisAlignment: CrossAxisAlignment .center,
181190 children: [
@@ -410,11 +419,6 @@ class _AlbumViewPageState extends State<AlbumViewPage> {
410419 Widget _imageGrid (AsyncSnapshot snapshot) {
411420 if (_imageList.isEmpty && _page == 0 ) {
412421 final ApiResult <List <ImageModel >> result = snapshot.data! .last as ApiResult <List <ImageModel >>;
413- if (result.hasError || ! result.hasData) {
414- return Center (
415- child: Text (appStrings.categoryImageList_noDataError),
416- );
417- }
418422 _imageList = result.data! ;
419423 WidgetsBinding .instance.addPostFrameCallback ((timeStamp) => setState (() {}));
420424 }
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ class _RootAlbumViewPageState extends State<RootAlbumViewPage> {
7171 child: SafeArea (
7272 child: CustomScrollView (
7373 controller: _scrollController,
74+ physics: const AlwaysScrollableScrollPhysics (),
7475 slivers: [
7576 RootSearchAppBar (
7677 scrollController: _scrollController,
@@ -96,14 +97,22 @@ class _RootAlbumViewPageState extends State<RootAlbumViewPage> {
9697 if (snapshot.hasData) {
9798 ApiResult <List <AlbumModel >> result = snapshot.data! ;
9899 if (! result.hasData) {
99- return Center (
100- child: Text (appStrings.categoryImageList_noDataError),
100+ return Padding (
101+ padding: const EdgeInsets .symmetric (horizontal: 16.0 , vertical: 8.0 ),
102+ child: Text (
103+ appStrings.categoryImageList_noDataError,
104+ textAlign: TextAlign .center,
105+ ),
101106 );
102107 }
103108 if (_albumList.isEmpty) {
104109 if (result.data! .isEmpty) {
105- return Center (
106- child: Text (appStrings.categoryMainEmpty),
110+ return Padding (
111+ padding: const EdgeInsets .symmetric (horizontal: 16.0 , vertical: 8.0 ),
112+ child: Text (
113+ appStrings.categoryMainEmpty,
114+ textAlign: TextAlign .center,
115+ ),
107116 );
108117 }
109118 _albumList = result.data! ;
You can’t perform that action at this time.
0 commit comments