v1.2.0waveform_flutter
अपने फ्लटर ऐप में बहुत कस्टमाइज़ेबल और सुंदर एनिमेटेड वेवफॉर्म बनाएं
अपने Flutter ऐप में एनिमेटेड वेवफॉर्म बनाएं
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
WaveForm is a Flutter package that helps you build animated waveforms in your Flutter app. With the popularity of voice-based chat UIs rising, WaveForm provides an easy and efficient way to visualize audio waveforms. Inspired by WaveSurfer.js, WaveForm offers a range of features to integrate beautiful and functional waveforms into your Flutter applications.
Please note that this package does not provide a connection to an audio source (like microphone). I recommend using record to connect this package to a live stream of audio.
Add the following to your pubspec.yaml file:
dependencies:
waveform: latest_version
Then run flutter pub get to install the package.
Below is an example of how to use WaveForm to display an animated waveform:
import 'package:flutter/material.dart';
import 'package:waveform_flutter/waveform_flutter.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('WaveForm Example')),
body: WaveFormExample(),
),
);
}
}
class WaveFormExample extends StatefulWidget {
const WaveFormExample({super.key});
@override
// ignore: library_private_types_in_public_api
_WaveFormExampleState createState() => _WaveFormExampleState();
}
class _WaveFormExampleState extends State<WaveFormExample> {
final Stream<Amplitude> _amplitudeStream = createRandomAmplitudeStream();
@override
Widget build(BuildContext context) {
return AnimatedWaveList(stream: _amplitudeStream);
}
}
Displays an animated list of waveform bars based on a stream of amplitude values.
const AnimatedWaveList({
required Stream<Amplitude> stream,
});
Represents a single bar in the waveform visualisation.
const WaveFormBar({
required Amplitude amplitude,
Animation<double>? animation,
int maxHeight = 2,
Color color = Colors.cyan,
});
Creates a stream of random amplitude values.
Stream<Amplitude> createRandomAmplitudeStream() {
return Stream.periodic(
const Duration(milliseconds: 70),
(count) => Amplitude(
current: Random().nextDouble() * 100,
max: 100,
),
);
}
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
WaveForm is licensed under the MIT License. See the LICENSE file for more details.
WaveForm is inspired by WaveSurfer.js.
निर्भरता सूची 2 आइटम
{"sdk":"flutter"}^5.0.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗