showCountrySelectorDialog method

Future<Country?> showCountrySelectorDialog({
  1. required BuildContext inheritedContext,
  2. required List<Map<String, dynamic>> countries,
})

Implementation

Future<Country?> showCountrySelectorDialog(
    {required BuildContext inheritedContext,
    required List<Map<String, dynamic>> countries}) {
  return showDialog(
    context: inheritedContext,
    barrierDismissible: false,
    builder: (BuildContext context) => AlertDialog(
      content: Directionality(
        textDirection: Directionality.of(inheritedContext),
        child: GetBuilder<PhoneInputController>(builder: (logic) {
          return SizedBox(
            width: double.maxFinite,
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                Padding(
                  padding:
                      const EdgeInsets.symmetric(horizontal: 8, vertical: 16),
                  child: TextFormField(
                    decoration: inputDecoration,
                    autofocus: autoFocus,
                    onChanged: (value) => logic.filterCountryMethod(value),
                  ),
                ),
                showCountryWithSearch(logic),
              ],
            ),
          );
        }),
      ),
    ),
  );
}