Skip to content

Commit

Permalink
Show no elements message when document search is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Jun 2, 2024
1 parent 9ad3384 commit 5047891
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
18 changes: 9 additions & 9 deletions app/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.931.0)
aws-partitions (1.937.0)
aws-sdk-core (3.196.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.81.0)
aws-sdk-kms (1.82.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.151.0)
Expand Down Expand Up @@ -119,10 +119,10 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
rexml
google-apis-iamcredentials_v1 (0.20.0)
google-apis-core (>= 0.14.0, < 2.a)
google-apis-playcustomapp_v1 (0.15.0)
google-apis-core (>= 0.14.0, < 2.a)
google-apis-iamcredentials_v1 (0.21.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-playcustomapp_v1 (0.16.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-storage_v1 (0.38.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-core (1.7.0)
Expand All @@ -131,12 +131,12 @@ GEM
google-cloud-env (2.1.1)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.4.0)
google-cloud-storage (1.51.0)
google-cloud-storage (1.52.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-core (~> 0.13)
google-apis-iamcredentials_v1 (~> 0.18)
google-apis-storage_v1 (~> 0.37)
google-apis-storage_v1 (~> 0.38)
google-cloud-core (~> 1.6)
googleauth (~> 1.9)
mini_mime (~> 1.0)
Expand All @@ -148,7 +148,7 @@ GEM
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.5)
http-cookie (1.0.6)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
Expand Down
12 changes: 10 additions & 2 deletions app/lib/dialogs/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Future<List<SearchResult>> _searchIsolate(NoteData noteData, String currentPage,

class _SearchDialogState extends State<SearchDialog> {
final TextEditingController _searchController = TextEditingController();
Future<Iterable<SearchResult>> _searchResults = Future.value([]);
Future<Iterable<SearchResult>?> _searchResults = Future.value(null);
final FocusNode _focusNode = FocusNode();

@override
Expand Down Expand Up @@ -121,7 +121,7 @@ class _SearchDialogState extends State<SearchDialog> {
),
const SizedBox(height: 16),
Flexible(
child: FutureBuilder<Iterable<SearchResult>>(
child: FutureBuilder<Iterable<SearchResult>?>(
future: _searchResults,
builder: (context, snapshot) {
if (snapshot.hasError) {
Expand All @@ -136,7 +136,15 @@ class _SearchDialogState extends State<SearchDialog> {
],
);
}
if (!snapshot.hasData) return const SizedBox();
final results = snapshot.data?.toList() ?? [];
if (results.isEmpty) {
return Text(
AppLocalizations.of(context).noElements,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge,
);
}
return ListView.builder(
itemCount: results.length,
shrinkWrap: true,
Expand Down
28 changes: 14 additions & 14 deletions docs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion metadata/en-US/changelogs/107.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
* Fix file changing in webdav on root folder
* Show no elements message when document search is empty
* Fix file changing in webdav on root folder ([#714](https://github.com/LinwoodDev/Butterfly/pull/714))
* Fix layer not set on automatic shapes ([#717](https://github.com/LinwoodDev/Butterfly/pull/717))
* Fix x icon button in navigator page on mobile
* Fix page not saved after creating a new page

Expand Down

0 comments on commit 5047891

Please sign in to comment.