diff --git a/audio_service/example/lib/common.dart b/audio_service/example/lib/common.dart index 5dc9373c..4fb42820 100644 --- a/audio_service/example/lib/common.dart +++ b/audio_service/example/lib/common.dart @@ -22,13 +22,13 @@ class SeekBar extends StatefulWidget { final ValueChanged? onChangeEnd; const SeekBar({ - Key? key, + super.key, required this.duration, required this.position, this.bufferedPosition = Duration.zero, this.onChanged, this.onChangeEnd, - }) : super(key: key); + }); @override SeekBarState createState() => SeekBarState(); @@ -141,7 +141,7 @@ class HiddenThumbComponentShape extends SliderComponentShape { } class LoggingAudioHandler extends CompositeAudioHandler { - LoggingAudioHandler(AudioHandler inner) : super(inner) { + LoggingAudioHandler(super.inner) { playbackState.listen((state) { _log('playbackState changed: $state'); }); diff --git a/audio_service/example/lib/example_android13.dart b/audio_service/example/lib/example_android13.dart index 90a7e1bd..3eb1c84e 100644 --- a/audio_service/example/lib/example_android13.dart +++ b/audio_service/example/lib/example_android13.dart @@ -37,7 +37,7 @@ Future main() async { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -50,7 +50,7 @@ class MyApp extends StatelessWidget { } class MainScreen extends StatelessWidget { - const MainScreen({Key? key}) : super(key: key); + const MainScreen({super.key}); @override Widget build(BuildContext context) { diff --git a/audio_service/example/lib/example_android_songs.dart b/audio_service/example/lib/example_android_songs.dart index 0c9fdd11..baaae302 100644 --- a/audio_service/example/lib/example_android_songs.dart +++ b/audio_service/example/lib/example_android_songs.dart @@ -85,7 +85,7 @@ Future main() async { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -98,7 +98,7 @@ class MyApp extends StatelessWidget { } class MainScreen extends StatefulWidget { - const MainScreen({Key? key}) : super(key: key); + const MainScreen({super.key}); @override State createState() => _MainScreenState(); @@ -225,7 +225,7 @@ class _MainScreenState extends State { } class SongListScreen extends StatelessWidget { - const SongListScreen({Key? key}) : super(key: key); + const SongListScreen({super.key}); IconButton _button(IconData iconData, VoidCallback onPressed) => IconButton( icon: Icon(iconData), @@ -303,10 +303,10 @@ class SongListScreen extends StatelessWidget { class SongTile extends StatelessWidget { const SongTile({ - Key? key, + super.key, required this.song, this.tappable = true, - }) : super(key: key); + }); final Song song; final bool tappable; @@ -337,7 +337,7 @@ class SongTile extends StatelessWidget { /// /// See the comment at the top of the example for the full context. class SongArt extends StatefulWidget { - const SongArt({Key? key, required this.song}) : super(key: key); + const SongArt({super.key, required this.song}); final Song song; diff --git a/audio_service/example/lib/example_multiple_handlers.dart b/audio_service/example/lib/example_multiple_handlers.dart index 3939d446..6e6dad9a 100644 --- a/audio_service/example/lib/example_multiple_handlers.dart +++ b/audio_service/example/lib/example_multiple_handlers.dart @@ -57,7 +57,7 @@ Future main() async { /// The app widget class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -76,7 +76,7 @@ class MainScreen extends StatelessWidget { 'Text-To-Speech', ]; - const MainScreen({Key? key}) : super(key: key); + const MainScreen({super.key}); @override Widget build(BuildContext context) { diff --git a/audio_service/example/lib/example_playlist.dart b/audio_service/example/lib/example_playlist.dart index d1e3eb61..29ad4498 100644 --- a/audio_service/example/lib/example_playlist.dart +++ b/audio_service/example/lib/example_playlist.dart @@ -33,7 +33,7 @@ Future main() async { /// The app widget class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -47,7 +47,7 @@ class MyApp extends StatelessWidget { /// The main screen. class MainScreen extends StatelessWidget { - const MainScreen({Key? key}) : super(key: key); + const MainScreen({super.key}); Stream get _bufferedPositionStream => _audioHandler.playbackState .map((state) => state.bufferedPosition) @@ -228,7 +228,7 @@ class MainScreen extends StatelessWidget { class ControlButtons extends StatelessWidget { final AudioPlayerHandler audioHandler; - const ControlButtons(this.audioHandler, {Key? key}) : super(key: key); + const ControlButtons(this.audioHandler, {super.key}); @override Widget build(BuildContext context) { diff --git a/audio_service/example/lib/main.dart b/audio_service/example/lib/main.dart index 91e5c79f..e415c978 100644 --- a/audio_service/example/lib/main.dart +++ b/audio_service/example/lib/main.dart @@ -43,7 +43,7 @@ Future main() async { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -56,7 +56,7 @@ class MyApp extends StatelessWidget { } class MainScreen extends StatelessWidget { - const MainScreen({Key? key}) : super(key: key); + const MainScreen({super.key}); @override Widget build(BuildContext context) { diff --git a/audio_service/lib/audio_service.dart b/audio_service/lib/audio_service.dart index 34363f4c..941c1206 100644 --- a/audio_service/lib/audio_service.dart +++ b/audio_service/lib/audio_service.dart @@ -2400,11 +2400,10 @@ class IsolatedAudioHandler extends CompositeAudioHandler { /// isolate is able to register another new handler with the same name before /// this isolate can. IsolatedAudioHandler( - AudioHandler inner, { + super.inner, { this.portName = defaultPortName, bool overridePortName = false, - }) : assert(!kIsWeb), - super(inner) { + }) : assert(!kIsWeb) { _receivePort.listen((dynamic event) async { final request = event as _IsolateRequest; switch (request.method) { @@ -4051,7 +4050,7 @@ class AudioServiceWidget extends StatelessWidget { final Widget child; /// Deprecated. - const AudioServiceWidget({Key? key, required this.child}) : super(key: key); + const AudioServiceWidget({super.key, required this.child}); @override Widget build(BuildContext context) {