selectIl method

Future<String?> selectIl(
  1. BuildContext context
)

müşteri seç

Implementation

Future<String?> selectIl(BuildContext context) async {
  String? il;
    await  SelectDialog.showModal<String>(
    context,
    label: "İl Ara",
    items: City.list().map((e) => e.city).toList(),
    searchBoxDecoration: const InputDecoration(
      border: OutlineInputBorder(),
      labelText: "İl Ara",
      hintText: "İl Adı",
      prefixIcon: Icon(Icons.search),
    ),
    loadingBuilder: (e) {
      return Center(
        child: CircularProgressIndicator(),
      );
    },
    emptyBuilder: (e) {
      return Center(
        child: Text("İl Bulunamadı"),
      );
    },
    errorBuilder: (e, t) {
      return Center(
        child: Text("Hata"),
      );
    },
    itemBuilder: (context, item, isSelected) {
      return SizedBox(
        child: ListTile(
          title: Text('$item '),
          trailing: isSelected ? Icon(Icons.check) : null,
        ),
      );
    },
      onChange: (String? selected) {
        il = selected;
      }
  );


  return il;
}