2023-12-06 11:16:17 +05:30
|
|
|
import 'package:geojson_vi/geojson_vi.dart';
|
2022-07-20 20:55:54 +05:30
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
import 'package:rogapp/pages/index/index_controller.dart';
|
|
|
|
|
|
2023-05-16 20:40:02 +05:30
|
|
|
class SearchBarController extends GetxController {
|
2023-12-06 11:16:17 +05:30
|
|
|
List<GeoJSONFeature> searchResults = <GeoJSONFeature>[].obs;
|
2022-07-20 20:55:54 +05:30
|
|
|
|
2023-12-06 11:16:17 +05:30
|
|
|
@override
|
2022-07-20 20:55:54 +05:30
|
|
|
void onInit() {
|
|
|
|
|
IndexController indexController = Get.find<IndexController>();
|
2023-12-06 11:16:17 +05:30
|
|
|
if (indexController.locations.isNotEmpty) {
|
|
|
|
|
for (int i = 0;
|
|
|
|
|
i <= indexController.locations[0].features.length - 1;
|
|
|
|
|
i++) {
|
|
|
|
|
GeoJSONFeature p = indexController.locations[0].features[i]!;
|
2022-07-21 20:42:33 +05:30
|
|
|
searchResults.add(p);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-20 20:55:54 +05:30
|
|
|
super.onInit();
|
|
|
|
|
}
|
2023-12-06 11:16:17 +05:30
|
|
|
}
|