Skip to content

Commit cba78a6

Browse files
Merge pull request #34 from SimformSolutionsPvtLtd/hotfix/pub-point-fixes
📝 fixed pub point warning and updated banner
2 parents b003a22 + b36a47d commit cba78a6

File tree

10 files changed

+31
-29
lines changed

10 files changed

+31
-29
lines changed

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _HomeState extends State<Home> with WidgetsBindingObserver {
6161
return await rootBundle.load(path);
6262
}
6363

64-
void _initialiseControllers(){
64+
void _initialiseControllers() {
6565
recorderController = RecorderController()
6666
..androidEncoder = AndroidEncoder.aac
6767
..androidOutputFormat = AndroidOutputFormat.mpeg4

lib/src/audio_file_waveforms.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'dart:math';
22

33
import 'package:audio_waveforms/src/base/platform_streams.dart';
4-
import 'package:audio_waveforms/src/base/player_wave_style.dart';
54
import 'package:audio_waveforms/src/painters/player_wave_painter.dart';
65
import 'package:flutter/material.dart';
6+
77
import '../audio_waveforms.dart';
88
import 'base/constants.dart';
99

lib/src/base/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ class Constants {
3535
static const String stopAllPlayers = "stopAllPlayers";
3636

3737
static const int byteSize = 8;
38-
}
38+
}

lib/src/base/current_duration_identifier.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
class CurrentDurationIndentifier {
44
///Unique key associated with any [player].
55
String playerKey;
6+
67
///current duration associated with that [key].
78
int duration;
89

lib/src/base/utils.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ enum PlayerState {
8888

8989
///When player is playing the audio file
9090
playing,
91+
9192
///When player is paused.
9293
paused,
9394

lib/src/controllers/recorder_controller.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ class RecorderController extends ChangeNotifier {
6565
/// Returned duration is in [milliseconds].
6666
ValueNotifier<int> get currentScrolledDuration => _currentScrolledDuration;
6767

68-
69-
7068
///Use this to check permission and starts recording.
7169
///
7270
///Can be called after pausing.
@@ -254,7 +252,7 @@ class RecorderController extends ChangeNotifier {
254252

255253
///[Internally] used to set scrolled position
256254
///to duration.
257-
void setScrolledPostionDuration(int duration){
255+
void setScrolledPostionDuration(int duration) {
258256
_currentScrolledDuration.value = duration;
259257
}
260258

lib/src/painters/player_wave_painter.dart

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class FileWaveformsPainter extends CustomPainter {
5050
Paint liveWavePaint;
5151
Paint seeklinePaint;
5252

53-
double _seekerXPosition = 0.0;
53+
// double _seekerXPosition = 0.0;
5454

5555
@override
5656
void paint(Canvas canvas, Size size) {
@@ -61,33 +61,33 @@ class FileWaveformsPainter extends CustomPainter {
6161
bool shouldRepaint(FileWaveformsPainter oldDelegate) => true;
6262

6363
//TODO: fix seek line
64-
void _drawSeekLine(Size size, Canvas canvas) {
65-
if (audioProgress == 1.0) {
66-
canvas.drawLine(
67-
Offset(_seekerXPosition + liveWavePaint.strokeWidth * 3, 0),
68-
Offset(_seekerXPosition + liveWavePaint.strokeWidth * 3, size.height),
69-
seeklinePaint,
70-
);
71-
} else {
72-
canvas.drawLine(
73-
Offset(
74-
waveformXPostion.last * audioProgress + liveWavePaint.strokeWidth,
75-
0),
76-
Offset(
77-
waveformXPostion.last * audioProgress + liveWavePaint.strokeWidth,
78-
size.height),
79-
seeklinePaint,
80-
);
81-
}
82-
}
64+
// void _drawSeekLine(Size size, Canvas canvas) {
65+
// if (audioProgress == 1.0) {
66+
// canvas.drawLine(
67+
// Offset(_seekerXPosition + liveWavePaint.strokeWidth * 3, 0),
68+
// Offset(_seekerXPosition + liveWavePaint.strokeWidth * 3, size.height),
69+
// seeklinePaint,
70+
// );
71+
// } else {
72+
// canvas.drawLine(
73+
// Offset(
74+
// waveformXPostion.last * audioProgress + liveWavePaint.strokeWidth,
75+
// 0),
76+
// Offset(
77+
// waveformXPostion.last * audioProgress + liveWavePaint.strokeWidth,
78+
// size.height),
79+
// seeklinePaint,
80+
// );
81+
// }
82+
// }
8383

8484
void _drawLiveWave(Size size, Canvas canvas) {
8585
if (liveWaveGradient != null) liveWavePaint.shader = liveWaveGradient;
8686
for (int i = 0; i < waveformData.length; i++) {
8787
int x = i * _dp(3);
8888
if (x < size.width) {
8989
if (x < denseness && x + _dp(2) < denseness) {
90-
_seekerXPosition = x.toDouble();
90+
//_seekerXPosition = x.toDouble();
9191
if (showBottom) {
9292
canvas.drawLine(
9393
Offset(waveformXPostion[i], size.height / 2),

lib/src/painters/recorder_wave_painter.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import '/src/base/label.dart';
21
import 'package:flutter/material.dart';
2+
3+
import '/src/base/label.dart';
34
import '../base/utils.dart';
45

56
///This will paint the waveform

preview/banner.png

-4.65 MB
Loading

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ issue_tracker: https://github.com/SimformSolutionsPvtLtd/audio_waveforms/issues
66

77
environment:
88
sdk: ">=2.12.0 <3.0.0"
9+
flutter: ">=1.20.0"
910

1011
dependencies:
1112
flutter:
@@ -14,7 +15,7 @@ dependencies:
1415
dev_dependencies:
1516
flutter_test:
1617
sdk: flutter
17-
flutter_lints: ^1.0.0
18+
flutter_lints: ^1.0.4
1819

1920
flutter:
2021
plugin:

0 commit comments

Comments
 (0)