Created
April 4, 2021 21:47
-
-
Save guilhermecarvalhocarneiro/e4f8850a1aa84f7eefe74c115412a93c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return Observer( | |
| builder: (context) { | |
| if (_feedController.processing == true) { | |
| return customCupertinoActivity(context); | |
| } else if (_feedController.errorMessage.isNotEmpty) { | |
| return Center( | |
| child: Text(_feedController.errorMessage), | |
| ); | |
| } else { | |
| if (_feedController.list != null) { | |
| if (_feedController.list.length == 0) { | |
| return EmptyData( | |
| context: context, | |
| titleMessage: "", | |
| bodyMessage: AppLocalizations.of(context).translate("label_feed_em_branco"), | |
| ); | |
| } else { | |
| // Testando para saber se a listview deve ser movida para o início. | |
| if (_feedController.scrollListViewToTop != null && | |
| _feedController.scrollListViewToTop == true && | |
| scrollController.hasClients) { | |
| _moveScrollListViewPositionTop(); | |
| } | |
| return Stack( | |
| children: [ | |
| Container( | |
| color: Color(vestterCustomGray), | |
| child: RefreshIndicator( | |
| onRefresh: _reloadData, | |
| child: ListView.builder( | |
| // addAutomaticKeepAlives: true, | |
| controller: scrollController, | |
| itemCount: _feedController.list.length, | |
| itemBuilder: (BuildContext context, int index) { | |
| List<PostModel> items = _feedController.list; | |
| return FeedCardView( | |
| context, | |
| post: items[index], | |
| user: _user, | |
| offsetListViewPosition: offsetPositionListView, | |
| ); | |
| }, | |
| ), | |
| ), | |
| ), | |
| Visibility( | |
| visible: _loading, | |
| child: customCupertinoActivity(context), | |
| ), | |
| ], | |
| ); | |
| } | |
| } else { | |
| return customCupertinoActivity(context); | |
| } | |
| } | |
| }, | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment