Skip to content
Türkçe
All snippets

Flutter Subnet Calculator Card with 32 Bit Network and Host Grid

A Flutter subnet calculator card for network and developer tools: an IPv4 address with its CIDR prefix, all 32 bits by octet with network and host bits in two colours, plus network, mask, first and last host, broadcast and usable hosts. A correct /21 worked example built with wind_kit.

  • WDiv
  • WIcon
  • WText
  • WButton
preview
zx4pms7k.dart
WDiv(
  className: 'w-[340px] rounded-3xl bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 p-5 flex flex-col shadow-xl',
  children: [
    WDiv(
      className: 'flex flex-row items-center justify-between w-full',
      children: [
        WDiv(
          className: 'flex flex-row items-center gap-3',
          children: [
            WDiv(
              className: 'flex flex-row items-center justify-center w-10 h-10 rounded-xl bg-indigo-600 dark:bg-indigo-500',
              child: WIcon(
                Icons.public,
                className: 'text-white text-xl'
              )
            ),
            WDiv(
              className: 'flex flex-col',
              children: [
                WText(
                  'Subnet Calculator',
                  className: 'text-base font-bold text-gray-900 dark:text-white'
                ),
                WText(
                  'IPv4 with CIDR prefix',
                  className: 'text-xs text-gray-500 dark:text-gray-400'
                ),
              ]
            ),
          ]
        ),
        WDiv(
          className: 'rounded-full bg-indigo-50 dark:bg-indigo-900/40 px-3 py-1',
          child: WText(
            'Private',
            className: 'text-xs font-bold text-indigo-600 dark:text-indigo-300'
          )
        ),
      ]
    ),
    WDiv(
      className: 'flex flex-row items-center justify-between w-full mt-4 rounded-2xl bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 px-4 py-3',
      children: [
        WText(
          '10.42.17.200',
          className: 'text-xl font-bold text-gray-900 dark:text-white'
        ),
        WText(
          '/ 21',
          className: 'text-xl font-bold text-indigo-600 dark:text-indigo-400'
        ),
      ]
    ),
    WDiv(
      className: 'flex flex-col w-full mt-4',
      children: [
        WDiv(
          className: 'flex flex-row items-center justify-between w-full',
          children: [
            WDiv(
              className: 'flex flex-col w-[142px]',
              children: [
                WDiv(
                  className: 'flex flex-row items-center justify-between w-full mb-1',
                  children: [
                    WText(
                      'Octet 1',
                      className: 'text-[10px] text-gray-400 dark:text-gray-500'
                    ),
                    WText(
                      '10',
                      className: 'text-xs font-bold text-gray-800 dark:text-gray-100'
                    )
                  ]
                ),
                WDiv(
                  className: 'flex flex-row gap-[2px]',
                  children: [
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    )
                  ]
                )
              ]
            ),
            WDiv(
              className: 'flex flex-col w-[142px]',
              children: [
                WDiv(
                  className: 'flex flex-row items-center justify-between w-full mb-1',
                  children: [
                    WText(
                      'Octet 2',
                      className: 'text-[10px] text-gray-400 dark:text-gray-500'
                    ),
                    WText(
                      '42',
                      className: 'text-xs font-bold text-gray-800 dark:text-gray-100'
                    )
                  ]
                ),
                WDiv(
                  className: 'flex flex-row gap-[2px]',
                  children: [
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    )
                  ]
                )
              ]
            )
          ]
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full mt-3',
          children: [
            WDiv(
              className: 'flex flex-col w-[142px]',
              children: [
                WDiv(
                  className: 'flex flex-row items-center justify-between w-full mb-1',
                  children: [
                    WText(
                      'Octet 3',
                      className: 'text-[10px] text-gray-400 dark:text-gray-500'
                    ),
                    WText(
                      '17',
                      className: 'text-xs font-bold text-gray-800 dark:text-gray-100'
                    )
                  ]
                ),
                WDiv(
                  className: 'flex flex-row gap-[2px]',
                  children: [
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-indigo-500 dark:bg-indigo-500 text-white'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    )
                  ]
                )
              ]
            ),
            WDiv(
              className: 'flex flex-col w-[142px]',
              children: [
                WDiv(
                  className: 'flex flex-row items-center justify-between w-full mb-1',
                  children: [
                    WText(
                      'Octet 4',
                      className: 'text-[10px] text-gray-400 dark:text-gray-500'
                    ),
                    WText(
                      '200',
                      className: 'text-xs font-bold text-gray-800 dark:text-gray-100'
                    )
                  ]
                ),
                WDiv(
                  className: 'flex flex-row gap-[2px]',
                  children: [
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '1',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    ),
                    WText(
                      '0',
                      className: 'w-[16px] h-[22px] rounded-[4px] text-center text-[11px] font-bold pt-[3px] bg-emerald-100 dark:bg-emerald-900/50 text-emerald-800 dark:text-emerald-200'
                    )
                  ]
                )
              ]
            )
          ]
        )
      ]
    ),
    WDiv(
      className: 'flex flex-row items-center gap-4 w-full mt-3',
      children: [
        WDiv(
          className: 'flex flex-row items-center gap-2',
          children: [
            WDiv(
              className: 'w-[10px] h-[10px] rounded-[3px] bg-indigo-500 dark:bg-indigo-500'
            ),
            WText(
              '21 network bits',
              className: 'text-[11px] font-medium text-gray-600 dark:text-gray-300'
            ),
          ]
        ),
        WDiv(
          className: 'flex flex-row items-center gap-2',
          children: [
            WDiv(
              className: 'w-[10px] h-[10px] rounded-[3px] bg-emerald-200 dark:bg-emerald-800'
            ),
            WText(
              '11 host bits',
              className: 'text-[11px] font-medium text-gray-600 dark:text-gray-300'
            ),
          ]
        ),
      ]
    ),
    WDiv(
      className: 'flex flex-col w-full mt-4 rounded-2xl border border-gray-200 dark:border-gray-700 px-4 py-2',
      children: [
        WDiv(
          className: 'flex flex-row items-center justify-between w-full py-1',
          children: [
            WText(
              'Network',
              className: 'text-xs text-gray-500 dark:text-gray-400'
            ),
            WText(
              '10.42.16.0',
              className: 'text-xs font-semibold text-gray-900 dark:text-white'
            )
          ]
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full py-1',
          children: [
            WText(
              'Subnet mask',
              className: 'text-xs text-gray-500 dark:text-gray-400'
            ),
            WText(
              '255.255.248.0',
              className: 'text-xs font-semibold text-gray-900 dark:text-white'
            )
          ]
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full py-1',
          children: [
            WText(
              'First host',
              className: 'text-xs text-gray-500 dark:text-gray-400'
            ),
            WText(
              '10.42.16.1',
              className: 'text-xs font-semibold text-gray-900 dark:text-white'
            )
          ]
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full py-1',
          children: [
            WText(
              'Last host',
              className: 'text-xs text-gray-500 dark:text-gray-400'
            ),
            WText(
              '10.42.23.254',
              className: 'text-xs font-semibold text-gray-900 dark:text-white'
            )
          ]
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full py-1',
          children: [
            WText(
              'Broadcast',
              className: 'text-xs text-gray-500 dark:text-gray-400'
            ),
            WText(
              '10.42.23.255',
              className: 'text-xs font-semibold text-gray-900 dark:text-white'
            )
          ]
        ),
        WDiv(
          className: 'flex flex-row items-center justify-between w-full py-1',
          children: [
            WText(
              'Usable hosts',
              className: 'text-xs text-gray-500 dark:text-gray-400'
            ),
            WText(
              '2,046',
              className: 'text-xs font-bold text-emerald-600 dark:text-emerald-400'
            )
          ]
        ),
      ]
    ),
    WDiv(
      className: 'w-full mt-4',
      child: WButton(
        className: 'w-full rounded-2xl bg-indigo-600 dark:bg-indigo-500 py-3 flex flex-row items-center justify-center',
        child: WText(
          'Copy subnet summary',
          className: 'text-sm font-semibold text-white'
        )
      )
    ),
  ],
)
  • Flutter File Permission Card with rwx Grid and Octal Mode Readout

    A Flutter file permission card for DevOps dashboards, hosting panels and learning apps: a terminal-style grid of owner, group and other against read, write and execute, bits worth 4, 2 and 1 summing to the octal digits of mode 755, plus the chmod command and the -rwxr-xr-x listing. Built with wind_kit.

    • WDiv
    • WIcon
    • WText
    • WButton
  • Flutter Contrast Checker Card with WCAG AA and AAA Pass Badges

    A WCAG 2.2 colour contrast card for design system and accessibility apps: text and background swatches, a live preview of body and large text, the 3.74:1 ratio on a threshold scale, AA and AAA pass or fail tiles for normal and large text, and a one-tap fix to the nearest passing shade.

    • WDiv
    • WIcon
    • WText
    • WButton
  • Flutter Git Commit Graph Card with Branch Lanes and Merge Lines

    A commit history card for developer tools and Git clients, built with Wind in Flutter. Colour-coded lanes for main, a feature branch and a hotfix fork and merge with right-angle connectors, commit rows carry branch, tag and HEAD chips, and an ahead/behind summary sits above a rebase action.

    • WDiv
    • WIcon
    • WText
    • WButton