Flutter Cookie Consent Privacy Banner
A privacy and cookie consent banner for web and mobile: an icon header, a plain-language explanation, an always-on essentials note, and a clear action hierarchy of accept, customize, and reject. A reusable compliance pattern composed from Wind className strings with dark-mode pairs.
WDiv(
className: 'flex flex-col gap-4 w-full max-w-sm p-6 rounded-3xl bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 shadow-xl',
children: [
WDiv(
className: 'flex flex-row items-center gap-3 w-full',
children: [
WDiv(
className: 'flex flex-row items-center justify-center w-11 h-11 rounded-2xl bg-amber-100 dark:bg-amber-500/15',
child: WIcon(
Icons.info,
className: 'text-xl text-amber-600 dark:text-amber-400'
),
),
WText(
'We value your privacy',
className: 'text-lg font-bold text-gray-900 dark:text-white'
),
],
),
WText(
'We use cookies to improve your experience, analyze traffic, and personalize content. You can accept all or choose what to allow.',
className: 'text-sm leading-relaxed text-gray-500 dark:text-gray-400',
),
WDiv(
className: 'flex flex-row items-center gap-2 px-3 py-2 rounded-xl bg-gray-50 dark:bg-gray-800',
children: [
WIcon(
Icons.check,
className: 'text-sm text-emerald-500 dark:text-emerald-400'
),
WText(
'Essential cookies are always on',
className: 'text-xs text-gray-500 dark:text-gray-400'
),
],
),
WButton(
className: 'flex flex-row items-center justify-center w-full py-3 rounded-xl bg-indigo-600 dark:bg-indigo-500 shadow-lg',
child: WText(
'Accept all',
className: 'text-sm font-semibold text-white dark:text-white'
),
),
WButton(
className: 'flex flex-row items-center justify-center w-full py-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800',
child: WText(
'Customize settings',
className: 'text-sm font-semibold text-gray-700 dark:text-gray-200'
),
),
WDiv(
className: 'flex flex-row items-center justify-center w-full',
child: WText(
'Reject all non-essential',
className: 'text-xs font-semibold text-gray-400 dark:text-gray-500'
),
),
],
)
More like this
-
Flutter Progress Stepper Wizard with Plan Selection
A multi-step wizard header with a connected step rail (completed, active, and upcoming states) over a plan selection step and a continue button, all composed from Wind utility classes.
-
Flutter Onboarding Slide with Feature Highlight and Page Dots
A polished onboarding slide built with Wind utility classes: a gradient feature icon, a bold headline, supporting copy, page indicator dots, and a full-width call to action. Dark mode pairs are included on every color token.
-
Flutter Component Search Card with Live Suggestions
A component search card built on the real WInput widget, with a focused search field and a categorized suggestion list. Demonstrates Wind form inputs with icon tiles and dark-mode pairs.