requestCountrySelector method

  1. @override
Future<Country?> requestCountrySelector(
  1. BuildContext context
)
override

Implementation

@override
Future<Country?> requestCountrySelector(BuildContext context) {
  final effectiveBorderRadius = borderRadius ??
      const BorderRadius.only(
        topLeft: Radius.circular(16),
        topRight: Radius.circular(16),
      );
  return showModalBottomSheet<Country>(
    clipBehavior: Clip.hardEdge,
    context: context,
    shape: RoundedRectangleBorder(
      borderRadius: effectiveBorderRadius,
    ),
    builder: (_) => DraggableScrollableSheet(
      initialChildSize: initialChildSize,
      minChildSize: minChildSize,
      maxChildSize: maxChildSize,
      expand: false,
      builder: (context, scrollController) {
        return Container(
          decoration: ShapeDecoration(
            color: Theme.of(context).canvasColor,
            shape: RoundedRectangleBorder(
              borderRadius: effectiveBorderRadius,
            ),
          ),
          child: _getCountrySelector(
            isBottomSheet: true,
            onCountrySelected: (country) => Navigator.pop(context, country),
            scrollController: scrollController,
          ),
        );
      },
    ),
    useRootNavigator: useRootNavigator,
    isScrollControlled: true,
  );
}