Skip to content

Instantly share code, notes, and snippets.

@haashem
Created September 26, 2022 12:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haashem/e3a8ef0fcad1e5a8eff2ef026a6642cd to your computer and use it in GitHub Desktop.
Save haashem/e3a8ef0fcad1e5a8eff2ef026a6642cd to your computer and use it in GitHub Desktop.
Responsive Modal
@override
Widget build(BuildContext context) {
return AnimatedLayout(
duration: const Duration(milliseconds: 250),
layoutState: Responsive.isMobile(context) ? LayoutState.open : LayoutState.close,
fromBuilder: (context) => _NonMobileModal(
icon: icon,
title: title,
onCloseButtonPressed: onCloseButtonPressed,
child: child),
toBuilder: (context) => _MobileModal(
icon: icon,
title: title,
onCloseButtonPressed: onCloseButtonPressed,
child: child),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment