Skip to content

Commit

Permalink
Merge pull request #954 from airqo-platform/MOB-143-review-the-search…
Browse files Browse the repository at this point in the history
…-feature

[Mobile app] - hotfix search feature
  • Loading branch information
Baalmart authored Nov 21, 2022
2 parents d55ef26 + 8a0f8c0 commit a983c4b
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 184 deletions.
1 change: 0 additions & 1 deletion mobile/lib/models/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ export 'kya.dart';
export 'notification.dart';
export 'place_details.dart';
export 'profile.dart';
export 'suggestion.dart';
77 changes: 0 additions & 77 deletions mobile/lib/models/suggestion.dart

This file was deleted.

42 changes: 0 additions & 42 deletions mobile/lib/models/suggestion.g.dart

This file was deleted.

62 changes: 0 additions & 62 deletions mobile/lib/screens/search/search_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,68 +119,6 @@ class _SearchResultsWidgetState extends State<SearchResultsWidget> {
}
}

class SearchPlaceTile extends StatelessWidget {
const SearchPlaceTile({
super.key,
required this.searchSuggestion,
});

final Suggestion searchSuggestion;

@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(left: 16.0, right: 30.0),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
border: Border.fromBorderSide(
BorderSide(color: Colors.transparent),
),
),
child: ListTile(
contentPadding: const EdgeInsets.only(left: 0.0),
title: Text(
searchSuggestion.suggestionDetails.getMainText(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: CustomTextStyle.headline8(context),
),
subtitle: Text(
searchSuggestion.suggestionDetails.getSecondaryText(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: CustomTextStyle.bodyText4(context)?.copyWith(
color: CustomColors.appColorBlack.withOpacity(0.3),
),
),
trailing: SvgPicture.asset(
'assets/icon/more_arrow.svg',
semanticsLabel: 'more',
height: 6.99,
width: 4,
),
leading: Container(
height: 40,
width: 40,
decoration: BoxDecoration(
color: CustomColors.appColorBlue.withOpacity(0.15),
shape: BoxShape.circle,
),
child: Center(
child: SvgPicture.asset(
'assets/icon/location.svg',
color: CustomColors.appColorBlue,
),
),
),
),
);
}
}

class SearchResultItemTile extends StatelessWidget {
const SearchResultItemTile({
Key? key,
Expand Down
3 changes: 1 addition & 2 deletions mobile/packages/airqo_api/lib/src/models/prediction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class Prediction {
static List<Prediction> parsePredictions(Map<String, dynamic> jsonBody) {
final suggestions = <Prediction>[];

final jsonArray = jsonBody['predictions'];
for (final jsonElement in jsonArray as List<Map<String, dynamic>>) {
for (final jsonElement in jsonBody['predictions']) {
try {
final measurement = Prediction.fromJson(jsonElement);
suggestions.add(measurement);
Expand Down

0 comments on commit a983c4b

Please sign in to comment.