Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

display no documents and loading message #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions lib/routes/documents_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,17 @@ class _DocumentsRouteState extends State<DocumentsRoute> {

Widget getCurrentMainWidget() {
if (documents == null) {
return Container();
return Container(
height : 100,
margin : EdgeInsets.symmetric(horizontal : 100, vertical : 100),
child : Column(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a CircularProgressIndicator would look better instead of the text.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this may be shown if the request fails. Can you change this so it only shows when requesting == true?

children:[
Text("Loading".i18n,
style : TextStyle(fontSize : 25),
textAlign : TextAlign.center,),
],
)
);
}
if (searchOpen) {
List<Widget>? matchingTags = getFilterResults(
Expand Down Expand Up @@ -272,7 +282,22 @@ class _DocumentsRouteState extends State<DocumentsRoute> {
}
return RefreshIndicator(
onRefresh: reloadDocuments,
child: GridView.builder(
child: documents!.results.length == 0 ? Container(//noDocuments
height : 100,
margin : EdgeInsets.symmetric(horizontal : 100, vertical : 100),
child : Column(
children:[
Text("There are no documents \n containing".i18n,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you didn't want to use Heading instead of Text? Are there visual issues?

style : TextStyle(fontSize : 15),
textAlign : TextAlign.center,),

Text(('$searchString').i18n,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the .i18n, we don't want to translate the search string 🙂

style : TextStyle(fontSize: 21, color : Colors.green),
textAlign : TextAlign.center,),
],
)
)
:GridView.builder(
controller: scrollController,
itemCount: documents!.results.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
Expand Down