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

class SubPerfPage extends StatelessWidget {
  SubPerfPage({super.key});

  IndexController indexController = Get.find<IndexController>();

  @override
  Widget build(BuildContext context) {
    debugPrint("SubPerfPage ---->");
    return Scaffold(
      appBar: AppBar(
        title: const Text("Select Sub Perfecture"),
      ),
      body: ListView.builder(
        itemCount: indexController.subPerfs.length,
        itemBuilder: (context, index){
          return ListTile(
            onTap: (){
              indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
              //indexController.populateForPerf(indexController.dropdownValue, indexController.mapController!);
              Get.back();
            },
            title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),
          );
        },
      ),
    );
  }
}