import 'package:geojson_vi/geojson_vi.dart';
import 'package:get/get.dart';
import 'package:gifunavi/pages/index/index_controller.dart';

class SearchBarController extends GetxController {
  List<GeoJSONFeature> searchResults = <GeoJSONFeature>[].obs;

  @override
  void onInit() {
    IndexController indexController = Get.find<IndexController>();
    if (indexController.locations.isNotEmpty) {
      for (int i = 0;
          i <= indexController.locations[0].features.length - 1;
          i++) {
        GeoJSONFeature p = indexController.locations[0].features[i]!;
        searchResults.add(p);
      }
    }
    super.onInit();
  }
}
