Improved messages
This commit is contained in:
@@ -5,11 +5,11 @@ import 'package:linkdy/screens/bookmarks/provider/search_bookmarks.provider.dart
|
|||||||
import 'package:linkdy/screens/bookmarks/ui/bookmark_item.dart';
|
import 'package:linkdy/screens/bookmarks/ui/bookmark_item.dart';
|
||||||
import 'package:linkdy/widgets/enter_search_term_screen.dart';
|
import 'package:linkdy/widgets/enter_search_term_screen.dart';
|
||||||
import 'package:linkdy/widgets/error_screen.dart';
|
import 'package:linkdy/widgets/error_screen.dart';
|
||||||
import 'package:linkdy/widgets/no_data_screen.dart';
|
|
||||||
|
|
||||||
import 'package:linkdy/providers/router_provider.dart';
|
import 'package:linkdy/providers/router_provider.dart';
|
||||||
|
|
||||||
import 'package:linkdy/i18n/strings.g.dart';
|
import 'package:linkdy/i18n/strings.g.dart';
|
||||||
|
import 'package:linkdy/widgets/no_data_screen.dart';
|
||||||
|
|
||||||
class SearchBookmarksScreen extends ConsumerWidget {
|
class SearchBookmarksScreen extends ConsumerWidget {
|
||||||
const SearchBookmarksScreen({Key? key}) : super(key: key);
|
const SearchBookmarksScreen({Key? key}) : super(key: key);
|
||||||
@@ -66,6 +66,10 @@ class SearchBookmarksScreen extends ConsumerWidget {
|
|||||||
return ErrorScreen(
|
return ErrorScreen(
|
||||||
error: t.bookmarks.search.cannotSearchError,
|
error: t.bookmarks.search.cannotSearchError,
|
||||||
);
|
);
|
||||||
|
} else if (data.content!.results!.isEmpty) {
|
||||||
|
return NoDataScreen(
|
||||||
|
message: t.bookmarks.search.inputtedSearchTermNoResults,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return ListView.builder(
|
return ListView.builder(
|
||||||
itemCount: data.content!.results!.length,
|
itemCount: data.content!.results!.length,
|
||||||
|
|||||||
@@ -15,24 +15,26 @@ class NoDataScreen extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Expanded(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Column(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Icon(
|
children: [
|
||||||
Icons.clear_rounded,
|
Icon(
|
||||||
size: 50,
|
Icons.clear_rounded,
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
size: 50,
|
||||||
),
|
|
||||||
const SizedBox(height: 30),
|
|
||||||
Text(
|
|
||||||
message,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 24,
|
|
||||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 30),
|
||||||
],
|
Text(
|
||||||
|
message,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24,
|
||||||
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user