Skip to content

Commit

Permalink
Fix _searchAutoCompletePanel for linux-build
Browse files Browse the repository at this point in the history
  • Loading branch information
TaYaKi71751 committed Dec 12, 2023
1 parent 55effe8 commit e013d3c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/pages/search/search_bar_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// This source code is a part of Project Violet.
// Copyright (C) 2020-2023. violet-team. Licensed under the Apache-2.0 License.

import 'dart:io';
import 'dart:math';

import 'package:flare_flutter/asset_provider.dart';
Expand Down Expand Up @@ -288,17 +289,21 @@ class _SearchBarPageState extends State<SearchBarPage>
_searchAutoCompletePanel() {
if (_searchLists.isEmpty || _nothing) {
return Center(
child: Text(_nothing
child: Padding(padding: EdgeInsets.all(8.0),child: Text(_nothing
? Translations.of(context).trans('nosearchresult')
: Translations.of(context).trans('inputsearchtoken')));
: Translations.of(context).trans('inputsearchtoken'))));
}
return ListView(
padding: const EdgeInsets.symmetric(horizontal: 8),
physics: const BouncingScrollPhysics(),
children: [
Wrap(
spacing: 4.0,
runSpacing: -10.0,
runSpacing: ((){
if(Platform.isAndroid || Platform.isIOS) return -10.0;
if(Platform.isLinux) return 10.0;
return -10.0;
})(),
children: _searchLists.map((item) => chip(item)).toList(),
),
],
Expand Down

0 comments on commit e013d3c

Please sign in to comment.