Skip to content
Türkçe
All snippets

A grocery assistant that asks before making a substitution

Make grocery substitutions a conversation, not a surprise at the door. Alternating chat bubbles explain a dietary-safe swap, while quick replies and a WInput composer keep the shopper in control.

  • WDiv
  • WIcon
  • WText
  • WButton
  • WInput
preview
a_grocery_assistant_that_asks_before_mak_iaghvd.dart
WDiv(
  className: '''
    w-full px-4 py-6
    flex flex-col gap-3
    bg-emerald-950 dark:bg-emerald-950
  ''',
  children: [
    WDiv(className: 'flex flex-row items-center gap-3 pb-3', children: [
      WDiv(className: '''
        size-11 rounded-full
        flex items-center justify-center
        bg-emerald-800 dark:bg-emerald-800
      ''', child: WIcon(Icons.shopping_bag, className: 'size-5 text-emerald-100 dark:text-emerald-100')),
      WDiv(className: 'flex flex-col', children: [
        WText('Your grocery assistant', className: '''
          text-base font-semibold
          text-white dark:text-white
        '''),
        WText('Waiting for your approval', className: 'text-xs text-emerald-300 dark:text-emerald-300'),
      ]),
    ]),
    WDiv(className: 'flex flex-col items-start gap-3', children: [
      WDiv(className: '''
        max-w-72 px-4 py-3
        rounded-tl-2xl rounded-tr-2xl rounded-br-2xl rounded-bl-sm
        bg-emerald-900 dark:bg-emerald-900
      ''', child: WText('The oat milk you usually buy is out of stock.', className: 'text-base text-emerald-50 dark:text-emerald-50')),
      WDiv(className: '''
        max-w-72 px-4 py-3
        rounded-tl-2xl rounded-tr-2xl rounded-br-2xl rounded-bl-sm
        bg-emerald-900 dark:bg-emerald-900
      ''', child: WText('I found an unsweetened oat alternative. Same size, same price. Nothing changed yet.', className: 'text-base text-emerald-50 dark:text-emerald-50')),
    ]),
    WDiv(className: 'flex flex-col items-end gap-3', children: [
      WDiv(className: '''
        max-w-72 px-4 py-3
        rounded-tl-2xl rounded-tr-2xl rounded-bl-2xl rounded-br-sm
        bg-emerald-300 dark:bg-emerald-300
      ''', child: WText('Only if it works in coffee. No sweeteners, please.', className: 'text-base text-emerald-950 dark:text-emerald-950')),
    ]),
    WDiv(className: 'flex flex-col items-start gap-3', children: [
      WDiv(className: '''
        max-w-72 px-4 py-3
        rounded-tl-2xl rounded-tr-2xl rounded-br-2xl rounded-bl-sm
        bg-emerald-900 dark:bg-emerald-900
      ''', child: WText('It is a barista blend with no added sweeteners. Ready for your approval.', className: 'text-base text-emerald-50 dark:text-emerald-50')),
    ]),
    WDiv(className: 'flex flex-row gap-2 pt-2', children: [
      WButton(onTap: () {}, className: '''
        px-4 py-2 rounded-full border
        border-emerald-700 dark:border-emerald-700
        hover:bg-emerald-900 dark:hover:bg-emerald-900
        focus:ring-2 focus:ring-emerald-300 dark:focus:ring-emerald-300
      ''', child: WText('Approve swap', className: 'text-sm text-emerald-100 dark:text-emerald-100')),
      WButton(onTap: () {}, className: '''
        px-4 py-2 rounded-full border
        border-emerald-700 dark:border-emerald-700
        hover:bg-emerald-900 dark:hover:bg-emerald-900
        focus:ring-2 focus:ring-emerald-300 dark:focus:ring-emerald-300
      ''', child: WText('Skip item', className: 'text-sm text-emerald-100 dark:text-emerald-100')),
    ]),
    WDiv(className: 'flex flex-row items-center gap-2 pt-1', children: [
      WInput(placeholder: 'Add a preference', onChanged: (v) {}, className: '''
        flex-1 h-11 px-4 rounded-full
        bg-emerald-900 dark:bg-emerald-900
        text-base text-white dark:text-white
        focus:ring-2 focus:ring-emerald-300 dark:focus:ring-emerald-300
      '''),
      WButton(onTap: () {}, semanticLabel: 'Send preference', className: '''
        size-12 rounded-full
        flex items-center justify-center
        bg-emerald-300 dark:bg-emerald-300
        hover:bg-emerald-200 dark:hover:bg-emerald-200
        focus:ring-2 focus:ring-emerald-100 dark:focus:ring-emerald-100
      ''', child: WIcon(Icons.send, className: 'size-5 text-emerald-950 dark:text-emerald-950')),
    ]),
  ],
)
  • An eSIM top-up comparison that avoids buying another full plan

    Help travelers cover the last three days of a trip without paying for a fresh week. Equal WCard panels compare a new plan with a smaller top-up, with the saving and expiry visible before purchase.

    • WDiv
    • WText
    • WCard
    • WBadge
    • WButton
  • A speaking warm-up that turns cafe nerves into a first sentence

    Give learners a real scene, a useful opening line and a low-pressure way to speak. A warm cafe roleplay card with a phrase preview and a clear three-minute commitment, built around WCard.

    • WDiv
    • WIcon
    • WText
    • WBadge
    • WCard
    • WSpacer
    • WButton
  • An instant resale offer that makes your take-home price clear

    Turn unused gear into a confident decision: a bold cash offer, an honest fee breakdown and free pickup in one compact resale screen. Built with WCard and paired light/dark tokens, ready to copy into Flutter.

    • WDiv
    • WCard
    • WIcon
    • WText
    • WBadge
    • WButton