Flutter API Key Usage and Rate Limit Card for Developer Tools

A developer console usage card built with Wind for Flutter: a masked API key with a copy action, a plan badge, a monthly request quota bar, per-endpoint status chips (200 OK and 429 rate-limited), and a reset countdown above a manage-keys button. A focused single-key rate-limit console using Tailwind-style className utilities with dark-mode pairs.

Anılcan Çakır by Anılcan Çakır 18 views 0 stars 5 days ago Rev 1
Flutter API Key Usage and Rate Limit Card for Developer Tools preview
main.dart
WDiv(
  className: 'max-w-sm w-full rounded-3xl bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 shadow-xl p-6',
  children: [
    WDiv(
      className: 'flex flex-row items-center justify-between w-full',
      children: [
        WDiv(
          className: 'flex flex-col',
          children: [
            WText(
              'API Usage',
              className: 'text-lg font-bold text-gray-900 dark:text-white'
            ),
            WText(
              'Production environment',
              className: 'text-xs text-gray-500 dark:text-gray-400'
            ),
          ],
        ),
        WDiv(
          className: 'px-3 py-1 rounded-full bg-indigo-100 dark:bg-indigo-800',
          child: WText(
            'Pro plan',
            className: 'text-xs font-semibold text-indigo-700 dark:text-indigo-100'
          ),
        ),
      ],
    ),
    WDiv(
      className: 'flex flex-row items-center justify-between w-full rounded-xl bg-gray-50 dark:bg-gray-800 px-3 py-2.5 mt-5',
      children: [
        WDiv(
          className: 'flex flex-row items-center',
          children: [
            WIcon(
              Icons.code,
              className: 'text-gray-400 dark:text-gray-500 text-base'
            ),
            WText(
              'sk_live_••••••4f2a',
              className: 'text-sm font-medium text-gray-700 dark:text-gray-200 ml-2'
            ),
          ],
        ),
        WButton(
          className: 'px-2 py-1 rounded-lg',
          child: WText(
            'Copy',
            className: 'text-xs font-semibold text-indigo-600 dark:text-indigo-400'
          ),
        ),
      ],
    ),
    WDiv(
      className: 'flex flex-row items-center justify-between w-full mt-5',
      children: [
        WText(
          'Requests this month',
          className: 'text-sm text-gray-600 dark:text-gray-300'
        ),
        WText(
          '84.2k / 100k',
          className: 'text-sm font-semibold text-gray-900 dark:text-white'
        ),
      ],
    ),
    WDiv(
      className: 'flex flex-row items-center w-full h-2.5 rounded-full bg-gray-200 dark:bg-gray-700 mt-2',
      child: WDiv(
        className: 'h-2.5 w-[283px] rounded-full bg-indigo-500 dark:bg-indigo-400'
      ),
    ),
    WText(
      'ENDPOINT ACTIVITY',
      className: 'text-xs font-semibold tracking-widest text-gray-400 dark:text-gray-500 mt-6'
    ),
    WDiv(
      className: 'flex flex-col w-full mt-3',
      children: [
        WDiv(
          className: 'flex flex-row items-center justify-between w-full',
          children: [
            WText(
              'POST  /v1/messages',
              className: 'text-sm font-medium text-gray-700 dark:text-gray-200'
            ),
            WDiv(
              className: 'px-2 py-0.5 rounded-md bg-emerald-100 dark:bg-emerald-800',
              child: WText(
                '200 OK',
                className: 'text-xs font-semibold text-emerald-700 dark:text-emerald-100'
              ),
            ),
          ],
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full mt-3',
          children: [
            WText(
              'GET  /v1/models',
              className: 'text-sm font-medium text-gray-700 dark:text-gray-200'
            ),
            WDiv(
              className: 'px-2 py-0.5 rounded-md bg-emerald-100 dark:bg-emerald-800',
              child: WText(
                '200 OK',
                className: 'text-xs font-semibold text-emerald-700 dark:text-emerald-100'
              ),
            ),
          ],
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full mt-3',
          children: [
            WText(
              'POST  /v1/embeddings',
              className: 'text-sm font-medium text-gray-700 dark:text-gray-200'
            ),
            WDiv(
              className: 'px-2 py-0.5 rounded-md bg-rose-100 dark:bg-rose-900',
              child: WText(
                '429 Limited',
                className: 'text-xs font-semibold text-rose-700 dark:text-rose-200'
              ),
            ),
          ],
        ),
      ],
    ),
    WDiv(
      className: 'w-full border-t border-gray-100 dark:border-gray-800 mt-5'
    ),
    WDiv(
      className: 'flex flex-row items-center w-full mt-4',
      children: [
        WIcon(
          Icons.schedule,
          className: 'text-gray-400 dark:text-gray-500 text-sm'
        ),
        WText(
          'Rate limit resets in 6h 12m',
          className: 'text-xs text-gray-500 dark:text-gray-400 ml-1.5'
        ),
      ],
    ),
    WButton(
      className: 'w-full mt-4 rounded-2xl bg-gray-900 dark:bg-white py-3',
      child: WText(
        'Manage API Keys',
        className: 'text-white dark:text-gray-900 text-center font-semibold text-sm'
      ),
    ),
  ],
)
Stats
Views
18
Stars
0
Revisions
1
Size
4,901 chars
Created
Jul 20, 2026