flutter_circle_of_fifths 1.1.1
flutter_circle_of_fifths: ^1.1.1 copied to clipboard
An interactive, customizable, Material 3 Circle of Fifths widget library for Flutter with support for Major and Minor keys, diatonic scale breakdown, and theme adaptation.
flutter_circle_of_fifths #
An interactive, customizable, Material 3 Circle of Fifths widget library for Flutter. Supports Major and Minor modes, diatonic scale breakdown, dark/light theme adaptation, and touch-based circular navigation.
π Languages / Idiomas: EspaΓ±ol | English
β Support the Project / Apoya el Proyecto #
If this package has been helpful and you'd like to support its ongoing development and maintenance, feel free to contribute:
- π³ PayPal: paypal.me/NyKservice
- π ΏοΈ Patreon: patreon.com/JuanPabloGosalvez
Your support is greatly appreciated to keep this project 100% free, open-source, and constantly evolving!
π Features #
- π‘ Interactive 12-Sector Wheel: Tap the outer ring for Major keys or the middle ring for Relative Minor keys.
- π Dynamic 12:00 Rotation: Smoothly centers the selected key at the top of the wheel.
- π¨ Material 3 Theme Adaptive: Inherits application Light & Dark theme colors out of the box using
.withValues(alpha: ...). - π΅ Diatonic Scale Breakdown: Shows Major and Natural Minor scale formulas (
2-2-1-2-2-2-1and2-1-2-2-1-2-2), note degree numbers (1-8), and chord variations. - π Degree Highlight Colors: Distinct semantic highlights for Tonic ($I / i$), Subdominant ($IV / iv$), Dominant ($V / v$), and Diminished ($vii^\circ / ii^\circ$).
- π·οΈ Customizable Theme & Logo: Set custom brand text (e.g.
'NyK') or degree colors viaCircleOfFifthsTheme. - π± Modal BottomSheet Ready: Display as a bottom sheet with interactive wheel and summary grid modes in a single function call.
π Getting Started #
Add the dependency to your pubspec.yaml:
dependencies:
flutter_circle_of_fifths: ^1.1.1
Run:
flutter pub get
π» Usage #
1. Show as a Modal BottomSheet (One Line) #
import 'package:flutter/material.dart';
import 'package:flutter_circle_of_fifths/flutter_circle_of_fifths.dart';
void openCircleOfFifths(BuildContext context) {
CircleOfFifthsSheet.show(
context,
customTheme: const CircleOfFifthsTheme(
centerLabel: 'NyK',
),
);
}
2. Standalone Interactive Wheel Widget #
import 'package:flutter/material.dart';
import 'package:flutter_circle_of_fifths/flutter_circle_of_fifths.dart';
class MyPage extends StatefulWidget {
const MyPage({super.key});
@override
State<MyPage> createState() => _MyPageState();
}
class _MyPageState extends State<MyPage> {
int _selectedIndex = 0; // 0 = 'C'
bool _isMinorMode = false;
@override
Widget build(BuildContext context) {
final selectedModel = CircleOfFifthsModel.defaultKeys[_selectedIndex];
return Scaffold(
appBar: AppBar(title: const Text('Circle of Fifths')),
body: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Column(
children: [
CircleOfFifthsWheelWidget(
selectedIndex: _selectedIndex,
isMinorMode: _isMinorMode,
onKeySelected: (index, isMinor) {
setState(() {
_selectedIndex = index;
_isMinorMode = isMinor;
});
},
),
const SizedBox(height: 20),
ScaleDetailCard(
model: selectedModel,
isMinorMode: _isMinorMode,
),
],
),
),
);
}
}
π¨ Custom Theme Configuration #
Customize colors and brand center text easily:
CircleOfFifthsTheme(
centerLabel: 'NyK',
tonicColor: Colors.amber,
subdominantDominantColor: Colors.deepOrange,
minorChordsColor: Colors.teal,
diminishedColor: Colors.indigo,
)
π Project Structure #
lib/
βββ flutter_circle_of_fifths.dart # Main package exports
βββ src/
βββ models/
β βββ circle_of_fifths_model.dart # Music theory model & 12 key definitions
βββ theme/
β βββ circle_of_fifths_theme.dart # Color palette & label configuration
βββ widgets/
βββ circle_of_fifths_sheet.dart # Draggable Modal Sheet with Wheel & Summary Grid
βββ circle_of_fifths_wheel.dart # Interactive Canvas Wheel widget
βββ scale_detail_card.dart # Diatonic scale breakdown card
π License #
This project is licensed under the MIT License - see the LICENSE file for details.