Flutter Resistor Colour Code Card with Four Band Decoder and Ohm Readout
A 4-band resistor decoder card for electronics and maker apps: a through-hole resistor drawn in red, violet, green and gold, a per-band legend, the decoded 2.7 MΩ value with its ±5% range, and the full 0 to 9 digit colour strip with the used bands outlined.
main.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-amber-500 dark:bg-amber-400',
child: WIcon(
Icons.bolt,
className: 'text-white text-xl'
)
),
WDiv(
className: 'flex flex-col',
children: [
WText(
'Resistor Decoder',
className: 'text-base font-bold text-gray-900 dark:text-white'
),
WText(
'4-band colour code, IEC 60062',
className: 'text-xs text-gray-500 dark:text-gray-400'
),
]
),
]
),
WDiv(
className: 'rounded-full bg-amber-50 dark:bg-amber-900/40 px-3 py-1',
child: WText(
'THT',
className: 'text-xs font-bold text-amber-700 dark:text-amber-300'
)
),
]
),
WDiv(
className: 'flex flex-row items-center justify-center w-full mt-4 rounded-2xl bg-slate-50 dark:bg-slate-800 border border-gray-200 dark:border-gray-700 py-2',
child: WDiv(
className: 'relative w-[286px] h-[72px]',
children: [
WDiv(
className: 'absolute left-[0px] top-[35px] w-[286px] h-[3px] rounded-full bg-gray-400 dark:bg-gray-500'
),
WDiv(
className: 'absolute left-[53px] top-[12px] w-[180px] h-[48px] rounded-full bg-[#e7cf9f] dark:bg-[#e7cf9f]'
),
WDiv(
className: 'absolute left-[80px] top-[12px] w-[14px] h-[48px] bg-[#dc2626] dark:bg-[#dc2626]'
),
WDiv(
className: 'absolute left-[104px] top-[12px] w-[14px] h-[48px] bg-[#7c3aed] dark:bg-[#7c3aed]'
),
WDiv(
className: 'absolute left-[128px] top-[12px] w-[14px] h-[48px] bg-[#16a34a] dark:bg-[#16a34a]'
),
WDiv(
className: 'absolute left-[190px] top-[12px] w-[14px] h-[48px] bg-[#d4a017] dark:bg-[#d4a017]'
),
WDiv(
className: 'absolute left-[78px] top-[17px] w-[130px] h-[5px] rounded-full bg-white/40 dark:bg-white/40'
),
]
)
),
WDiv(
className: 'flex flex-row gap-2 w-full mt-4',
children: [
WDiv(
className: 'flex flex-col items-center w-[68px] rounded-xl border border-gray-200 dark:border-gray-700 py-2',
children: [
WDiv(
className: 'w-[22px] h-[8px] rounded-full bg-[#dc2626] dark:bg-[#dc2626]'
),
WText(
'2',
className: 'text-sm font-bold text-gray-900 dark:text-white mt-1'
),
WText(
'1st digit',
className: 'text-[10px] text-gray-500 dark:text-gray-400'
),
]
),
WDiv(
className: 'flex flex-col items-center w-[68px] rounded-xl border border-gray-200 dark:border-gray-700 py-2',
children: [
WDiv(
className: 'w-[22px] h-[8px] rounded-full bg-[#7c3aed] dark:bg-[#7c3aed]'
),
WText(
'7',
className: 'text-sm font-bold text-gray-900 dark:text-white mt-1'
),
WText(
'2nd digit',
className: 'text-[10px] text-gray-500 dark:text-gray-400'
),
]
),
WDiv(
className: 'flex flex-col items-center w-[68px] rounded-xl border border-gray-200 dark:border-gray-700 py-2',
children: [
WDiv(
className: 'w-[22px] h-[8px] rounded-full bg-[#16a34a] dark:bg-[#16a34a]'
),
WText(
'×100k',
className: 'text-sm font-bold text-gray-900 dark:text-white mt-1'
),
WText(
'Multiplier',
className: 'text-[10px] text-gray-500 dark:text-gray-400'
),
]
),
WDiv(
className: 'flex flex-col items-center w-[68px] rounded-xl border border-gray-200 dark:border-gray-700 py-2',
children: [
WDiv(
className: 'w-[22px] h-[8px] rounded-full bg-[#d4a017] dark:bg-[#d4a017]'
),
WText(
'±5%',
className: 'text-sm font-bold text-gray-900 dark:text-white mt-1'
),
WText(
'Tolerance',
className: 'text-[10px] text-gray-500 dark:text-gray-400'
),
]
),
]
),
WDiv(
className: 'flex flex-row items-end justify-between w-full mt-4',
children: [
WDiv(
className: 'flex flex-col',
children: [
WText(
'Resistance',
className: 'text-xs text-gray-500 dark:text-gray-400'
),
WText(
'2.7 MΩ',
className: 'text-3xl font-bold text-gray-900 dark:text-white'
),
]
),
WDiv(
className: 'flex flex-col items-end',
children: [
WText(
'±5% tolerance',
className: 'text-xs font-semibold text-amber-700 dark:text-amber-300'
),
WText(
'2.565 to 2.835 MΩ',
className: 'text-xs text-gray-500 dark:text-gray-400'
),
]
),
]
),
WText(
'Digit bands',
className: 'text-[11px] font-semibold text-gray-500 dark:text-gray-400 mt-4'
),
WDiv(
className: 'flex flex-row gap-[4px] w-full mt-2',
children: [
WText(
'0',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-200 dark:border-gray-700 bg-[#1f2937] dark:bg-[#1f2937] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'1',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-200 dark:border-gray-700 bg-[#8b4513] dark:bg-[#8b4513] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'2',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-900 dark:border-white bg-[#dc2626] dark:bg-[#dc2626] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'3',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-200 dark:border-gray-700 bg-[#f97316] dark:bg-[#f97316] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'4',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-200 dark:border-gray-700 bg-[#facc15] dark:bg-[#facc15] text-gray-900 text-center text-xs font-bold pt-[4px]'
),
WText(
'5',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-900 dark:border-white bg-[#16a34a] dark:bg-[#16a34a] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'6',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-200 dark:border-gray-700 bg-[#2563eb] dark:bg-[#2563eb] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'7',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-900 dark:border-white bg-[#7c3aed] dark:bg-[#7c3aed] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'8',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-200 dark:border-gray-700 bg-[#9ca3af] dark:bg-[#9ca3af] text-white text-center text-xs font-bold pt-[4px]'
),
WText(
'9',
className: 'w-[26px] h-[26px] rounded-md border-2 border-gray-200 dark:border-gray-700 bg-[#ffffff] dark:bg-[#ffffff] text-gray-900 text-center text-xs font-bold pt-[4px]'
),
]
),
WDiv(
className: 'w-full mt-4',
child: WButton(
className: 'w-full rounded-2xl bg-gray-900 dark:bg-white py-3 flex flex-row items-center justify-center',
child: WText(
'Copy 2.7 MΩ ±5%',
className: 'text-sm font-semibold text-white dark:text-gray-900'
)
)
),
]
)
Stats
- Views
- 118
- Stars
- 0
- Revisions
- 1
- Size
- 8,607 chars
- Created
- Oct 8, 2026