update
This commit is contained in:
@ -89,11 +89,11 @@ class DestinationController extends GetxController {
|
|||||||
makeCheckin(value, true);
|
makeCheckin(value, true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
// showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||||
builder:((context) => BottomSheetWidget())
|
// builder:((context) => BottomSheetWidget())
|
||||||
).whenComplete((){
|
// ).whenComplete((){
|
||||||
checking_in = false;
|
// checking_in = false;
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -92,13 +92,13 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
|
|||||||
return IconButton(
|
return IconButton(
|
||||||
onPressed: ()async {
|
onPressed: ()async {
|
||||||
Destination? fs = await destinationController.getDEstinationForLatLong(d.lat!, d.lon!);
|
Destination? fs = await destinationController.getDEstinationForLatLong(d.lat!, d.lon!);
|
||||||
print("----fsf-----${fs}");
|
print("-- Destination is --- ${fs!.name} ------");
|
||||||
if(fs != null){
|
if(fs != null){
|
||||||
if(indexController.currentFeature.length > 0) {
|
if(indexController.currentDestinationFeature.length > 0) {
|
||||||
indexController.currentDestinationFeature.clear();
|
indexController.currentDestinationFeature.clear();
|
||||||
}
|
}
|
||||||
indexController.currentDestinationFeature.add(fs);
|
indexController.currentDestinationFeature.add(fs);
|
||||||
indexController.getAction();
|
//indexController.getAction();
|
||||||
|
|
||||||
showModalBottomSheet(context: context, isScrollControlled: true,
|
showModalBottomSheet(context: context, isScrollControlled: true,
|
||||||
//builder:((context) => BottomSheetWidget())
|
//builder:((context) => BottomSheetWidget())
|
||||||
@ -141,19 +141,19 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
|
|||||||
child:
|
child:
|
||||||
TravelMap(),
|
TravelMap(),
|
||||||
),
|
),
|
||||||
Positioned(
|
// Positioned(
|
||||||
bottom: 200,
|
// bottom: 200,
|
||||||
left: 10,
|
// left: 10,
|
||||||
child: Container(
|
// child: Container(
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
child: Row(
|
// child: Row(
|
||||||
children: [
|
// children: [
|
||||||
Text(destinationController.gps[0]),
|
// Text(destinationController.gps[0]),
|
||||||
Text(destinationController.locationPermission[0])
|
// Text(destinationController.locationPermission[0])
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
)
|
// )
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
@ -214,12 +214,12 @@ class _DestinationMapPageState extends State<DestinationMapPage> {
|
|||||||
// examplePopup(marker),
|
// examplePopup(marker),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
|
LocationMarkerLayerWidget(),
|
||||||
MarkerLayerWidget(
|
MarkerLayerWidget(
|
||||||
options: MarkerLayerOptions(
|
options: MarkerLayerOptions(
|
||||||
markers: getMarkers()!
|
markers: getMarkers()!
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
LocationMarkerLayerWidget(),
|
|
||||||
],
|
],
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -13,11 +13,12 @@ List<GeoJsonFeature> searchResults = <GeoJsonFeature>[].obs;
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
IndexController indexController = Get.find<IndexController>();
|
IndexController indexController = Get.find<IndexController>();
|
||||||
for(int i=0; i<= indexController.locations[0].collection.length - 1; i++){
|
if(indexController.locations.isNotEmpty){
|
||||||
GeoJsonFeature p = indexController.locations[0].collection[i];
|
for(int i=0; i<= indexController.locations[0].collection.length - 1; i++){
|
||||||
searchResults.add(p);
|
GeoJsonFeature p = indexController.locations[0].collection[i];
|
||||||
|
searchResults.add(p);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||||
|
import 'package:geojson/geojson.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:rogapp/pages/index/index_controller.dart';
|
import 'package:rogapp/pages/index/index_controller.dart';
|
||||||
import 'package:rogapp/pages/search/search_controller.dart';
|
import 'package:rogapp/pages/search/search_controller.dart';
|
||||||
@ -36,21 +38,24 @@ class SearchPage extends StatelessWidget {
|
|||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.arrow_back_ios_new, color: Colors.black,)),
|
icon: const Icon(Icons.arrow_back_ios_new, color: Colors.black,)),
|
||||||
title: const CupertinoSearchTextField(),
|
title: TypeAheadField(
|
||||||
|
textFieldConfiguration: TextFieldConfiguration(
|
||||||
),
|
autofocus: true,
|
||||||
body:
|
),
|
||||||
//Obx(() =>
|
suggestionsCallback: (pattern) async{
|
||||||
ListView.builder(
|
return searchController.searchResults.where((GeoJsonFeature element) => element.properties!["location_name"].toString().contains(pattern));
|
||||||
itemCount: searchController.searchResults.length,
|
//return await
|
||||||
itemBuilder: (context, index){
|
},
|
||||||
return ListTile(
|
itemBuilder: (context, GeoJsonFeature suggestion){
|
||||||
title: Text(searchController.searchResults[index].properties!["location_name"]),
|
return ListTile(
|
||||||
subtitle: Text(searchController.searchResults[index].properties!["category"]),
|
title: Text(suggestion.properties!["location_name"]),
|
||||||
leading: getImage(index),
|
subtitle: suggestion.properties!["category"] != null ? Text(suggestion.properties!["category"]) : Text(""),
|
||||||
onTap: (){
|
//leading: getImage(index),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
onSuggestionSelected: (GeoJsonFeature suggestion){
|
||||||
indexController.currentFeature.clear();
|
indexController.currentFeature.clear();
|
||||||
indexController.currentFeature.add(searchController.searchResults[index]);
|
indexController.currentFeature.add(suggestion);
|
||||||
Get.back();
|
Get.back();
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
@ -58,11 +63,35 @@ class SearchPage extends StatelessWidget {
|
|||||||
//builder: (context) => BottomSheetWidget(),
|
//builder: (context) => BottomSheetWidget(),
|
||||||
builder:((context) => BottomSheetNew())
|
builder:((context) => BottomSheetNew())
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
),
|
||||||
},
|
//title: const CupertinoSearchTextField(),
|
||||||
|
|
||||||
),
|
),
|
||||||
//)
|
//body:
|
||||||
|
// Obx(() =>
|
||||||
|
// ListView.builder(
|
||||||
|
// itemCount: searchController.searchResults.length,
|
||||||
|
// itemBuilder: (context, index){
|
||||||
|
// return ListTile(
|
||||||
|
// title: searchController.searchResults[index].properties!["location_name"] != null ? Text(searchController.searchResults[index].properties!["location_name"]) : Text(""),
|
||||||
|
// subtitle: searchController.searchResults[index].properties!["category"] != null ? Text(searchController.searchResults[index].properties!["category"]) : Text(""),
|
||||||
|
// leading: getImage(index),
|
||||||
|
// onTap: (){
|
||||||
|
// indexController.currentFeature.clear();
|
||||||
|
// indexController.currentFeature.add(searchController.searchResults[index]);
|
||||||
|
// Get.back();
|
||||||
|
// showModalBottomSheet(
|
||||||
|
// isScrollControlled: true,
|
||||||
|
// context: context,
|
||||||
|
// //builder: (context) => BottomSheetWidget(),
|
||||||
|
// builder:((context) => BottomSheetNew())
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
28
pubspec.lock
28
pubspec.lock
@ -125,6 +125,27 @@ packages:
|
|||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.1.0"
|
version: "4.1.0"
|
||||||
|
flutter_keyboard_visibility:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_keyboard_visibility
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "5.3.0"
|
||||||
|
flutter_keyboard_visibility_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_keyboard_visibility_platform_interface
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
|
flutter_keyboard_visibility_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_keyboard_visibility_web
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@ -179,6 +200,13 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_typeahead:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_typeahead
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.0"
|
||||||
flutter_web_plugins:
|
flutter_web_plugins:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
|
|||||||
@ -65,6 +65,7 @@ dependencies:
|
|||||||
#flutter_map_marker_popup: any
|
#flutter_map_marker_popup: any
|
||||||
flutter_polyline_points: ^1.0.0
|
flutter_polyline_points: ^1.0.0
|
||||||
google_maps_webservice: ^0.0.19
|
google_maps_webservice: ^0.0.19
|
||||||
|
flutter_typeahead: ^4.0.0
|
||||||
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user