FLUTTER ECOSYSTEM

paurakhsharma/flutter_chord

适用于 Flutter 的歌词和弦解析器

flutter_chord 项目封面
Stars
31
Forks
14
最近推送(UTC)
2026年7月9日
项目状态
未归档
Paurakh Sharma Humagain GitHub avatar
GITHUB User

Paurakh Sharma Humagain ↗

Fullstack Developer. Instructs computers to do cool stuffs. (Python || JavaScript || Flutter) == ♥️

OneSheepNepal
语言DartHTMLSwiftKotlinObjective-C

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • mockito开发依赖^5.0.17

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

flutter_chord

Test

Chord parser for Flutter apps.

Features

  • Transpose Chord
  • Auto Scroll

https://raw.githubusercontent.com/paurakhsharma/flutter_chord/main/screenshot.png

Usage

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,
);