|
1 |
| -# flutter_visualizers |
| 1 | +# flutter_visualizers [](https://pub.dartlang.org/packages/flutter_visualizers) |
2 | 2 |
|
3 |
| -A new Flutter plugin. |
| 3 | +A Flutter plugin to Visualize the audio being played (only android). |
4 | 4 |
|
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 |
6 | 70 |
|
7 | 71 | This project is a starting point for a Flutter
|
8 | 72 | [plug-in package](https://flutter.io/developing-packages/),
|
|
0 commit comments