mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 06:19:35 +00:00
格式化代码
This commit is contained in:
parent
94f1376572
commit
de8b0bc066
5 changed files with 65 additions and 30 deletions
|
|
@ -62,8 +62,8 @@ class MySearchBar extends HookConsumerWidget {
|
|||
currentQuery = query;
|
||||
|
||||
// In a real application, there should be some error handling here.
|
||||
final options =
|
||||
await api.libraries.search(libraryId: settings.activeLibraryId!, query: query, limit: 3);
|
||||
final options = await api.libraries
|
||||
.search(libraryId: settings.activeLibraryId!, query: query, limit: 3);
|
||||
|
||||
// If another search happened after this one, throw away these options.
|
||||
if (currentQuery != query) {
|
||||
|
|
@ -82,7 +82,8 @@ class MySearchBar extends HookConsumerWidget {
|
|||
dividerColor: Colors.transparent,
|
||||
builder: (context, controller) {
|
||||
return SearchBar(
|
||||
constraints: const BoxConstraints(minWidth: 360.0, maxWidth: 1050.0, minHeight: 56.0),
|
||||
constraints: const BoxConstraints(
|
||||
minWidth: 360.0, maxWidth: 1050.0, minHeight: 56.0),
|
||||
controller: controller,
|
||||
focusNode: searchBarFocusNode,
|
||||
// "What's your next page-turner?"
|
||||
|
|
@ -99,7 +100,10 @@ class MySearchBar extends HookConsumerWidget {
|
|||
// opacity: 0.5 for the hint text
|
||||
hintStyle: WidgetStatePropertyAll(
|
||||
Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.5),
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.5),
|
||||
),
|
||||
),
|
||||
textInputAction: TextInputAction.search,
|
||||
|
|
@ -232,8 +236,9 @@ class BookSearchResultMini extends HookConsumerWidget {
|
|||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final item = ref.watch(libraryItemProvider(book.libraryItemId)).valueOrNull;
|
||||
final image =
|
||||
item == null ? const AsyncValue.loading() : ref.watch(coverImageProvider(item.id));
|
||||
final image = item == null
|
||||
? const AsyncValue.loading()
|
||||
: ref.watch(coverImageProvider(item.id));
|
||||
return ListTile(
|
||||
leading: SizedBox(
|
||||
width: 50,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue