Flutter Piano Chord Trainer Card with Highlighted Keys
A music lesson card that draws a real keyboard: ten white keys in a row, seven black keys absolutely positioned across the gaps, and the four chord notes highlighted at the bottom of each key. Note tiles name the root, third, fifth and seventh, and a footer stat tracks weekly accuracy. Every key is a Wind styled div, no custom painter.
main.dart
WDiv(
className: 'flex flex-col w-full max-w-sm rounded-3xl bg-white dark:bg-gray-900 border border-gray-100 dark:border-gray-800 p-6',
children: [
WDiv(
className: 'flex flex-row items-center justify-between w-full',
children: [
WText(
'CHORD TRAINER',
className: 'text-[10px] font-bold tracking-wide text-indigo-500 dark:text-indigo-400'
),
WDiv(
className: 'flex flex-row items-center rounded-full bg-gray-100 dark:bg-gray-800 px-3 py-1',
child: WText(
'Lesson 4 of 12',
className: 'text-[11px] font-semibold text-gray-600 dark:text-gray-300'
),
),
],
),
WDiv(
className: 'flex flex-row items-center w-full mt-2',
children: [
WText(
'F major 7',
className: 'text-2xl font-bold text-gray-900 dark:text-white'
),
WDiv(
className: 'flex flex-row items-center rounded-full bg-emerald-50 dark:bg-emerald-500/20 px-2 py-1 ml-3',
child: WText(
'Root position',
className: 'text-[10px] font-semibold text-emerald-600 dark:text-emerald-300'
),
),
],
),
WText(
'Press the four highlighted keys together',
className: 'text-xs text-gray-500 dark:text-gray-400 mt-1'
),
WDiv(
className: 'flex flex-row items-center justify-center w-full mt-4',
child: WDiv(
className: 'relative w-[300px] h-[104px]',
children: [
WDiv(
className: 'flex flex-row items-start w-[300px] h-[104px]',
children: [
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] ',
child: WText(
'C',
className: 'text-[11px] text-gray-400 dark:text-gray-500 font-semibold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] ',
child: WText(
'D',
className: 'text-[11px] text-gray-400 dark:text-gray-500 font-semibold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] ',
child: WText(
'E',
className: 'text-[11px] text-gray-400 dark:text-gray-500 font-semibold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] rounded-b-lg bg-indigo-500 dark:bg-indigo-400',
child: WText(
'F',
className: 'text-[11px] text-white dark:text-indigo-950 font-bold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] ',
child: WText(
'G',
className: 'text-[11px] text-gray-400 dark:text-gray-500 font-semibold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] rounded-b-lg bg-indigo-500 dark:bg-indigo-400',
child: WText(
'A',
className: 'text-[11px] text-white dark:text-indigo-950 font-bold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] ',
child: WText(
'B',
className: 'text-[11px] text-gray-400 dark:text-gray-500 font-semibold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] rounded-b-lg bg-indigo-500 dark:bg-indigo-400',
child: WText(
'C',
className: 'text-[11px] text-white dark:text-indigo-950 font-bold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] ',
child: WText(
'D',
className: 'text-[11px] text-gray-400 dark:text-gray-500 font-semibold'
),
),
),
WDiv(
className: 'flex flex-col items-center justify-end w-[30px] h-[104px] rounded-b-lg border bg-white dark:bg-gray-100 border-gray-300 dark:border-gray-400',
child: WDiv(
className: 'flex flex-row items-center justify-center w-full h-[40px] rounded-b-lg bg-indigo-500 dark:bg-indigo-400',
child: WText(
'E',
className: 'text-[11px] text-white dark:text-indigo-950 font-bold'
),
),
),
],
),
WDiv(
className: 'absolute left-[21px] top-[0px] w-[18px] h-[64px] rounded-b-md bg-gray-900 dark:bg-gray-800'
),
WDiv(
className: 'absolute left-[51px] top-[0px] w-[18px] h-[64px] rounded-b-md bg-gray-900 dark:bg-gray-800'
),
WDiv(
className: 'absolute left-[111px] top-[0px] w-[18px] h-[64px] rounded-b-md bg-gray-900 dark:bg-gray-800'
),
WDiv(
className: 'absolute left-[141px] top-[0px] w-[18px] h-[64px] rounded-b-md bg-gray-900 dark:bg-gray-800'
),
WDiv(
className: 'absolute left-[171px] top-[0px] w-[18px] h-[64px] rounded-b-md bg-gray-900 dark:bg-gray-800'
),
WDiv(
className: 'absolute left-[231px] top-[0px] w-[18px] h-[64px] rounded-b-md bg-gray-900 dark:bg-gray-800'
),
WDiv(
className: 'absolute left-[261px] top-[0px] w-[18px] h-[64px] rounded-b-md bg-gray-900 dark:bg-gray-800'
),
],
),
),
WDiv(
className: 'flex flex-row items-center justify-center w-full mt-4',
children: [
WDiv(
className: 'flex flex-col items-center w-[72px] rounded-xl bg-gray-50 dark:bg-gray-800 py-2',
children: [
WText(
'F',
className: 'text-base font-bold text-gray-900 dark:text-white'
),
WText(
'Root',
className: 'text-[10px] font-medium text-gray-500 dark:text-gray-400'
),
],
),
WDiv(
className: 'flex flex-col items-center w-[72px] rounded-xl bg-gray-50 dark:bg-gray-800 py-2 ml-2',
children: [
WText(
'A',
className: 'text-base font-bold text-gray-900 dark:text-white'
),
WText(
'3rd',
className: 'text-[10px] font-medium text-gray-500 dark:text-gray-400'
),
],
),
WDiv(
className: 'flex flex-col items-center w-[72px] rounded-xl bg-gray-50 dark:bg-gray-800 py-2 ml-2',
children: [
WText(
'C',
className: 'text-base font-bold text-gray-900 dark:text-white'
),
WText(
'5th',
className: 'text-[10px] font-medium text-gray-500 dark:text-gray-400'
),
],
),
WDiv(
className: 'flex flex-col items-center w-[72px] rounded-xl bg-gray-50 dark:bg-gray-800 py-2 ml-2',
children: [
WText(
'E',
className: 'text-base font-bold text-gray-900 dark:text-white'
),
WText(
'7th',
className: 'text-[10px] font-medium text-gray-500 dark:text-gray-400'
),
],
),
],
),
WDiv(
className: 'flex flex-row items-center justify-between w-full rounded-2xl bg-gray-50 dark:bg-gray-800 px-4 py-3 mt-4',
children: [
WDiv(
className: 'flex flex-col',
children: [
WText(
'Accuracy this week',
className: 'text-[10px] font-semibold tracking-wide text-gray-500 dark:text-gray-400'
),
WText(
'92 percent',
className: 'text-sm font-bold text-gray-900 dark:text-white'
),
],
),
WDiv(
className: 'flex flex-row items-center',
children: [
WIcon(
Icons.trending_up,
className: 'text-base text-emerald-500 dark:text-emerald-400'
),
WDiv(
className: 'ml-1',
child: WText(
'up 6 points',
className: 'text-[11px] font-semibold text-emerald-600 dark:text-emerald-400'
),
),
],
),
],
),
WDiv(
className: 'w-full mt-4',
child: WButton(
className: 'flex flex-row items-center justify-center w-full rounded-2xl bg-indigo-600 dark:bg-indigo-500 py-3',
child: WDiv(
className: 'flex flex-row items-center',
children: [
WIcon(
Icons.play_arrow,
className: 'text-base text-white dark:text-white'
),
WDiv(
className: 'ml-2',
child: WText(
'Hear the chord',
className: 'text-sm font-semibold text-white dark:text-white'
),
),
],
),
),
),
],
)
Stats
- Views
- 34
- Stars
- 0
- Revisions
- 1
- Size
- 11,647 chars
- Created
- Aug 14, 2026