navigate method
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,
);
}