Location fixes (#1721)
This commit is contained in:
commit
ea723f1183
2 changed files with 10 additions and 8 deletions
|
@ -731,6 +731,8 @@ class SearchService {
|
|||
tagToItemsMap[tag]!.add(file);
|
||||
}
|
||||
}
|
||||
// If the location tag already exists for a city, do not consider
|
||||
// it for the city suggestions
|
||||
if (!hasLocationTag) {
|
||||
filesWithNoLocTag.add(file);
|
||||
}
|
||||
|
@ -769,14 +771,12 @@ class SearchService {
|
|||
..sort((a, b) => results[b]!.length.compareTo(results[a]!.length));
|
||||
for (final city in sortedByResultCount) {
|
||||
if (results[city]!.length <= 1) continue;
|
||||
// If the location tag already exists for a city, don't add it again
|
||||
tagSearchResults.add(
|
||||
GenericSearchResult(
|
||||
ResultType.locationSuggestion,
|
||||
city.city,
|
||||
results[city]!,
|
||||
onResultTap: (ctx) {
|
||||
Navigator.of(ctx).pop();
|
||||
showAddLocationSheet(
|
||||
ctx,
|
||||
Location(latitude: city.lat, longitude: city.lng),
|
||||
|
|
|
@ -76,12 +76,13 @@ class _AddLocationSheetState extends State<AddLocationSheet> {
|
|||
late ValueNotifier<double> _selectedRadiusNotifier;
|
||||
final _focusNode = FocusNode();
|
||||
final _textEditingController = TextEditingController();
|
||||
final _isEmptyNotifier = ValueNotifier(true);
|
||||
late final ValueNotifier<bool> _isEmptyNotifier;
|
||||
Widget? _keyboardTopButtons;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_textEditingController.text = widget.name;
|
||||
_isEmptyNotifier = ValueNotifier(widget.name.isEmpty);
|
||||
_focusNode.addListener(_focusNodeListener);
|
||||
_selectedRadiusNotifier = ValueNotifier(widget.radius);
|
||||
_selectedRadiusNotifier.addListener(_selectedRadiusListener);
|
||||
|
@ -169,11 +170,12 @@ class _AddLocationSheetState extends State<AddLocationSheet> {
|
|||
RadiusPickerWidget(
|
||||
_selectedRadiusNotifier,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
S.of(context).locationTagFeatureDescription,
|
||||
style: textTheme.smallMuted,
|
||||
),
|
||||
if (widget.name.isEmpty) const SizedBox(height: 16),
|
||||
if (widget.name.isEmpty)
|
||||
Text(
|
||||
S.of(context).locationTagFeatureDescription,
|
||||
style: textTheme.smallMuted,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Add table
Reference in a new issue