v0.1.2flutter_chord
适用于 Flutter 的歌词和弦解析器和渲染器。它还附带移调和自动滚动功能。
40喜欢 98近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
适用于 Flutter 的歌词和弦解析器
{"sdk":"flutter"}{"sdk":"flutter"}^5.0.17以下为英文项目原文快照,最新内容请访问 GitHub。
Chord parser for Flutter apps.
https://raw.githubusercontent.com/paurakhsharma/flutter_chord/main/screenshot.png
1) Render the Lyrics and Chords directly.
final textStyle = TextStyle(fontSize: 18, color: Colors.white);
final chordStyle = TextStyle(fontSize: 20, color: Colors.green);
final lyrics = '''
[C]Give me Freedom, [F]Give me fire
[Am] Give me reason, [G]Take me higher
''';
@override
Widget build(BuildContext context) {
return LyricsRenderer(
lyrics: _lyrics,
textStyle: textStyle,
chordStyle: chordStyle,
widgetPadding: 50,
onTapChord: (String chord) {
print('pressed chord: $chord');
},
transposeIncrement: 0,
scrollSpeed: 0,
);
}
2. Get a parsed ChordLyricsDocument and style it as you like.
final textStyle = TextStyle(fontSize: 18, color: Colors.white);
final chordStyle = TextStyle(fontSize: 20, color: Colors.green);
final lyrics = '''
[C]Give me Freedom , [F]Give me fire
[Am] Give me reason , [G]Take me higher
''';
ChordProcessor _chordProcessor = ChordProcessor(context);
ChordLyricsDocument chordLyricsDocument = _chordProcessor.processText(
text: lyrics,
lyricsStyle: textStyle,
chordStyle: chordStyle,
transposeIncrement: 0,
);