navigate method

  1. @override
Future<Country?> navigate(
  1. BuildContext context,
  2. FlagCache flagCache
)
override

Implementation

@override
Future<Country?> navigate(BuildContext context, FlagCache flagCache) {
  final effectiveBorderRadius = borderRadius ??
      const BorderRadius.only(
        topLeft: Radius.circular(16),
        topRight: Radius.circular(16),
      );
  return showModalBottomSheet<Country>(
    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(
            onCountrySelected: (country) => Navigator.pop(context, country),
            scrollController: scrollController,
            flagCache: flagCache,
          ),
        );
      },
    ),
    useRootNavigator: useRootNavigator,
    isScrollControlled: true,
  );
}