map updated to 6
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:geojson_vi/geojson_vi.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
@ -48,46 +48,32 @@ class SearchPage extends StatelessWidget {
|
||||
//title: const CupertinoSearchTextField(),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: TypeAheadField(
|
||||
textFieldConfiguration: TextFieldConfiguration(
|
||||
autofocus: true,
|
||||
style: DefaultTextStyle.of(context).style.copyWith(
|
||||
fontStyle: FontStyle.normal,
|
||||
fontSize: 15.0,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: "検索",
|
||||
prefixIcon: const Icon(Icons.search),
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
// clear the text field
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
suggestionsCallback: (pattern) async {
|
||||
return searchController.searchResults.where(
|
||||
(GeoJsonFeature element) => element.properties!["location_name"]
|
||||
.toString()
|
||||
.contains(pattern));
|
||||
//return await
|
||||
},
|
||||
itemBuilder: (context, GeoJsonFeature suggestion) {
|
||||
return ListTile(
|
||||
title: Text(suggestion.properties!["location_name"]),
|
||||
subtitle: suggestion.properties!["category"] != null
|
||||
? Text(suggestion.properties!["category"])
|
||||
: const Text(""),
|
||||
//leading: getImage(index),
|
||||
);
|
||||
},
|
||||
onSuggestionSelected: (GeoJsonFeature suggestion) {
|
||||
child: TypeAheadField<GeoJSONFeature>(
|
||||
// textFieldConfiguration: TextFieldConfiguration(
|
||||
// autofocus: true,
|
||||
// style: DefaultTextStyle.of(context).style.copyWith(
|
||||
// fontStyle: FontStyle.normal,
|
||||
// fontSize: 15.0,
|
||||
// ),
|
||||
// decoration: InputDecoration(
|
||||
// border: const OutlineInputBorder(),
|
||||
// hintText: "検索",
|
||||
// prefixIcon: const Icon(Icons.search),
|
||||
// suffixIcon: IconButton(
|
||||
// icon: const Icon(Icons.clear),
|
||||
// onPressed: () {
|
||||
// // clear the text field
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
onSelected: (GeoJSONFeature suggestion) {
|
||||
indexController.currentFeature.clear();
|
||||
indexController.currentFeature.add(suggestion);
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
Destination des = destinationController.festuretoDestination(suggestion);
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
Destination des =
|
||||
destinationController.festuretoDestination(suggestion);
|
||||
Get.back();
|
||||
showModalBottomSheet(
|
||||
constraints:
|
||||
@ -95,7 +81,28 @@ class SearchPage extends StatelessWidget {
|
||||
isScrollControlled: true,
|
||||
context: context,
|
||||
//builder: (context) => BottomSheetWidget(),
|
||||
builder: ((context) => BottomSheetNew(destination: des,)));
|
||||
builder: ((context) => BottomSheetNew(
|
||||
destination: des,
|
||||
)));
|
||||
},
|
||||
|
||||
suggestionsCallback: (pattern) async {
|
||||
return searchController.searchResults
|
||||
.where((GeoJSONFeature element) => element
|
||||
.properties!["location_name"]
|
||||
.toString()
|
||||
.contains(pattern))
|
||||
.toList();
|
||||
//return await
|
||||
},
|
||||
itemBuilder: (context, GeoJSONFeature suggestion) {
|
||||
return ListTile(
|
||||
title: Text(suggestion.properties!["location_name"]),
|
||||
subtitle: suggestion.properties!["category"] != null
|
||||
? Text(suggestion.properties!["category"])
|
||||
: const Text(""),
|
||||
//leading: getImage(index),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user