Skip to content

Commit 9569ba9

Browse files
authored
Update README.md
1 parent f551e25 commit 9569ba9

File tree

1 file changed

+67
-3
lines changed

1 file changed

+67
-3
lines changed

README.md

+67-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,72 @@
1-
# flutter_visualizers
1+
# flutter_visualizers [![Pub](https://img.shields.io/pub/v/flutter_visualizers.svg?style=flat-square)](https://pub.dartlang.org/packages/flutter_visualizers)
22

3-
A new Flutter plugin.
3+
A Flutter plugin to Visualize the audio being played (only android).
44

5-
## Getting Started
5+
## Usage
6+
* Add this to your pubspec.yaml
7+
```
8+
dependencies:
9+
flutter_visualizers: ^0.0.1
10+
11+
```
12+
* Get package from Pub:
13+
14+
```
15+
flutter packages get
16+
```
17+
* Import it in your file
18+
19+
```
20+
import 'package:flutter_visualizers/flutter_visualizers.dart';
21+
```
22+
23+
## Example
24+
* Firstly, get a audioSessionID from your native android Mediaplayer.
25+
```
26+
player.getAudioSessionId()
27+
```
28+
* Simply Include this code in ``` body ```
29+
```
30+
new Visualizer(
31+
builder: (BuildContext context, List<int> wave) {
32+
return new CustomPaint(
33+
painter: new LineVisualizer(
34+
waveData: wave,
35+
height: MediaQuery.of(context).size.height,
36+
width : MediaQuery.of(context).size.width,
37+
color: Colors.blueAccent,
38+
),
39+
child: new Container(),
40+
);
41+
},
42+
id: playerID,
43+
)
44+
```
45+
Here playerId is the AudioSessionId which id needed to initialize the Visualizer.
46+
47+
See the Complete [Example](https://github.com/iamSahdeep/FlutterVisualizers/tree/master/example)
48+
49+
### Credits
50+
- [GautamChibde](https://github.com/GautamChibde) for awesome [Visualizers](https://github.com/GautamChibde/android-audio-visualizer) in Android from which I made this.
51+
- [Matt Carroll](https://github.com/matthew-carroll) for this [UI](https://github.com/matthew-carroll/flutter_ui_challenge_music_player/blob/recording/lib/main.dart)
52+
53+
## License
54+
55+
Copyright [2018] [Sahdeep Singh]
56+
57+
Licensed under the Apache License, Version 2.0 (the "License");
58+
you may not use this file except in compliance with the License.
59+
You may obtain a copy of the License at
60+
61+
http://www.apache.org/licenses/LICENSE-2.0
62+
63+
Unless required by applicable law or agreed to in writing, software
64+
distributed under the License is distributed on an "AS IS" BASIS,
65+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66+
See the License for the specific language governing permissions and
67+
limitations under the License.
68+
69+
### Getting Started with Flutter
670
771
This project is a starting point for a Flutter
872
[plug-in package](https://flutter.io/developing-packages/),

0 commit comments

Comments
 (0)