Skip to content

Commit 7fa1ced

Browse files
Merge pull request #523 from solid-illiaaihistov/update-solid-lints
Fixed code for Solid Lints 0.2.3
2 parents f9085ba + 16bde94 commit 7fa1ced

File tree

15 files changed

+42
-34
lines changed

15 files changed

+42
-34
lines changed

flutter_vlc_player/example/lib/controls_overlay.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ class ControlsOverlay extends StatelessWidget {
1919
});
2020

2121
@override
22+
// ignore: cyclomatic_complexity
2223
Widget build(BuildContext context) {
2324
return AnimatedSwitcher(
2425
duration: const Duration(milliseconds: 50),
2526
reverseDuration: const Duration(milliseconds: 200),
2627
child: Builder(
27-
builder: (ctx) {
28+
builder: (_) {
2829
if (controller.value.isEnded || controller.value.hasError) {
2930
return Center(
3031
child: FittedBox(
@@ -113,6 +114,7 @@ class ControlsOverlay extends StatelessWidget {
113114
}
114115

115116
Future<void> _pause() async {
117+
// ignore: prefer_early_return
116118
if (controller.value.isPlaying) {
117119
await controller.pause();
118120
}

flutter_vlc_player/example/lib/multiple_tab.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class MultipleTab extends StatefulWidget {
1010
class _MultipleTabState extends State<MultipleTab> {
1111
static const _heightWithControls = 400.0;
1212
static const _heightWithoutControls = 300.0;
13+
static const _networkCachingTime = 2000;
1314

1415
List<VlcPlayerController> controllers = <VlcPlayerController>[];
1516

@@ -31,7 +32,7 @@ class _MultipleTabState extends State<MultipleTab> {
3132
autoPlay: false,
3233
options: VlcPlayerOptions(
3334
advanced: VlcAdvancedOptions([
34-
VlcAdvancedOptions.networkCaching(2000),
35+
VlcAdvancedOptions.networkCaching(_networkCachingTime),
3536
]),
3637
rtp: VlcRtpOptions([
3738
VlcRtpOptions.rtpOverRtsp(true),
@@ -46,7 +47,7 @@ class _MultipleTabState extends State<MultipleTab> {
4647
Widget build(BuildContext context) {
4748
return ListView.separated(
4849
itemCount: controllers.length,
49-
separatorBuilder: (_, index) {
50+
separatorBuilder: (_, __) {
5051
return const Divider(height: 5, thickness: 5, color: Colors.grey);
5152
},
5253
itemBuilder: (_, index) {
@@ -64,10 +65,10 @@ class _MultipleTabState extends State<MultipleTab> {
6465

6566
@override
6667
Future<void> dispose() async {
67-
super.dispose();
6868
for (final controller in controllers) {
6969
await controller.stopRendererScanning();
7070
await controller.dispose();
7171
}
72+
super.dispose();
7273
}
7374
}

flutter_vlc_player/example/lib/single_tab.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
// ignore_for_file: cyclomatic_complexity
12
import 'dart:io';
23

4+
import 'package:flutter/foundation.dart';
35
import 'package:flutter/material.dart';
46
import 'package:flutter/services.dart';
57
import 'package:flutter_vlc_player/flutter_vlc_player.dart';
@@ -19,7 +21,7 @@ class _SingleTabState extends State<SingleTab> {
1921

2022
final _key = GlobalKey<VlcPlayerWithControlsState>();
2123

22-
// ignore: avoid-late-keyword
24+
// ignore: avoid_late_keyword
2325
late final VlcPlayerController _controller;
2426

2527
//
@@ -120,7 +122,10 @@ class _SingleTabState extends State<SingleTab> {
120122
await _controller.startRendererScanning();
121123
});
122124
_controller.addOnRendererEventListener((type, id, name) {
123-
debugPrint('OnRendererEventListener $type $id $name');
125+
// ignore: prefer_early_return
126+
if (!kReleaseMode) {
127+
debugPrint('OnRendererEventListener $type $id $name');
128+
}
124129
});
125130
}
126131

@@ -258,15 +263,9 @@ class _SingleTabState extends State<SingleTab> {
258263

259264
@override
260265
Future<void> dispose() async {
261-
super.dispose();
262266
await _controller.stopRecording();
263267
await _controller.stopRendererScanning();
264268
await _controller.dispose();
269+
super.dispose();
265270
}
266271
}
267-
268-
class MyClass {
269-
final int _myField = 0;
270-
271-
int get myField => _myField;
272-
}

flutter_vlc_player/example/lib/vlc_player_with_controls.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore_for_file: prefer_early_return, function_lines_of_code
12
import 'dart:typed_data';
23

34
import 'package:flutter/material.dart';
@@ -36,7 +37,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
3637
final double initSnapshotRightPosition = 10;
3738
final double initSnapshotBottomPosition = 10;
3839

39-
// ignore: avoid-late-keyword
40+
// ignore: avoid_late_keyword
4041
late VlcPlayerController _controller;
4142

4243
//
@@ -363,7 +364,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
363364
IconButton(
364365
icon: const Icon(Icons.fullscreen),
365366
color: Colors.white,
366-
// ignore: no-empty-block
367+
// ignore: no_empty_block
367368
onPressed: () {},
368369
),
369370
],
@@ -456,7 +457,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
456457
if (!mounted) return;
457458
final selectedSubId = await showDialog<int>(
458459
context: context,
459-
builder: (BuildContext context) {
460+
builder: (BuildContext _) {
460461
return AlertDialog(
461462
title: const Text('Select Subtitle'),
462463
content: SizedBox(
@@ -502,7 +503,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
502503
if (!mounted) return;
503504
final selectedAudioTrackId = await showDialog<int>(
504505
context: context,
505-
builder: (BuildContext context) {
506+
builder: (BuildContext _) {
506507
return AlertDialog(
507508
title: const Text('Select Audio'),
508509
content: SizedBox(
@@ -546,7 +547,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
546547
if (!mounted) return;
547548
final selectedCastDeviceName = await showDialog<String>(
548549
context: context,
549-
builder: (BuildContext context) {
550+
builder: (BuildContext _) {
550551
return AlertDialog(
551552
title: const Text('Display Devices'),
552553
content: SizedBox(
@@ -596,7 +597,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
596597

597598
if (!mounted) return;
598599

599-
// ignore: avoid-non-null-assertion
600+
// ignore: avoid_non_null_assertion
600601
Overlay.of(context).insert(_overlayEntry!);
601602
}
602603

@@ -617,7 +618,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
617618
_overlayEntry = null;
618619
await showDialog<void>(
619620
context: context,
620-
builder: (ctx) {
621+
builder: (_) {
621622
return AlertDialog(
622623
contentPadding: EdgeInsets.zero,
623624
content: Image.memory(snapshot),
@@ -633,7 +634,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
633634
right -= dragUpdateDetails.delta.dx;
634635
_overlayEntry?.markNeedsBuild();
635636
},
636-
onHorizontalDragEnd: (dragEndDetails) {
637+
onHorizontalDragEnd: (_) {
637638
if ((initSnapshotRightPosition - right).abs() >= _overlayWidth) {
638639
_overlayEntry?.remove();
639640
_overlayEntry = null;
@@ -642,7 +643,7 @@ class VlcPlayerWithControlsState extends State<VlcPlayerWithControls> {
642643
_overlayEntry?.markNeedsBuild();
643644
}
644645
},
645-
onVerticalDragEnd: (dragEndDetails) {
646+
onVerticalDragEnd: (_) {
646647
if ((initSnapshotBottomPosition - bottom).abs() >=
647648
_overlayWidth) {
648649
_overlayEntry?.remove();

flutter_vlc_player/lib/src/flutter_vlc_player.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:flutter/widgets.dart';
22
import 'package:flutter_vlc_player/src/vlc_player_controller.dart';
33
import 'package:flutter_vlc_player/src/vlc_player_platform.dart';
44

5-
// ignore: prefer-match-file-name
5+
// ignore: prefer_match_file_name
66
class VlcPlayer extends StatefulWidget {
77
final VlcPlayerController controller;
88
final double aspectRatio;
@@ -36,7 +36,7 @@ class VlcPlayer extends StatefulWidget {
3636
class _VlcPlayerState extends State<VlcPlayer> {
3737
bool _isInitialized = false;
3838

39-
//ignore: avoid-late-keyword
39+
//ignore: avoid_late_keyword
4040
late VoidCallback _listener;
4141

4242
_VlcPlayerState() {

flutter_vlc_player/lib/src/vlc_player_controller.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
6363
bool? _isReadyToInitialize;
6464

6565
/// The viewId for this controller
66-
// ignore: avoid-late-keyword
66+
// ignore: avoid_late_keyword
6767
late int _viewId;
6868

6969
/// List of onInit listeners
@@ -351,9 +351,9 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
351351
_onRendererEventListeners.clear();
352352
_lifeCycleObserver?.dispose();
353353
_isDisposed = true;
354-
super.dispose();
355354
//
356355
await vlcPlayerPlatform.dispose(_viewId);
356+
super.dispose();
357357
}
358358

359359
/// Notify onInit callback & all registered listeners
@@ -953,6 +953,7 @@ class VlcPlayerController extends ValueNotifier<VlcPlayerValue> {
953953
'$functionName() was called on an uninitialized VlcPlayerController.',
954954
);
955955
}
956+
// ignore: prefer_early_return
956957
if (_isDisposed) {
957958
throw Exception(
958959
'$functionName() was called on a disposed VlcPlayerController.',

flutter_vlc_player/lib/src/vlc_player_value.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class VlcPlayerValue {
153153

154154
/// Returns a new instance that has the same values as this current instance,
155155
/// except for any overrides passed in as arguments to [copyWidth].
156+
// ignore: number_of_parameters
156157
VlcPlayerValue copyWith({
157158
Duration? duration,
158159
Size? size,

flutter_vlc_player/pigeons/messages.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:pigeon/pigeon_lib.dart';
22

3-
//ignore: prefer-match-file-name
3+
//ignore: prefer_match_file_name
44
class ViewMessage {
55
int? viewId;
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// ignore: prefer-match-file-name
1+
// ignore: prefer_match_file_name
22
enum HwAcc { auto, disabled, decoding, full }

flutter_vlc_player_platform_interface/lib/src/enums/media_event_type.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ignore: prefer-match-file-name
1+
// ignore: prefer_match_file_name
22
enum VlcMediaEventType {
33
opening,
44
playing,

0 commit comments

Comments
 (0)