From 39a3a0c7b9d53f0c53253391c6c6bdeb6f28feb4 Mon Sep 17 00:00:00 2001 From: Gustl22 Date: Sat, 24 Dec 2022 14:46:02 +0100 Subject: [PATCH] feat: upgrade flutter to v3.0.0 and dart 2.17 to support "Super initializers" --- packages/audioplayers/example/lib/components/btn.dart | 3 +-- packages/audioplayers/example/lib/components/cbx.dart | 4 ++-- packages/audioplayers/example/lib/components/dlg.dart | 8 ++++---- packages/audioplayers/example/lib/components/pad.dart | 2 +- .../example/lib/components/player_widget.dart | 4 ++-- .../audioplayers/example/lib/components/tab_wrapper.dart | 2 +- packages/audioplayers/example/lib/components/tabs.dart | 2 +- packages/audioplayers/example/lib/components/tgl.dart | 8 ++++---- packages/audioplayers/example/lib/components/txt.dart | 4 ++-- packages/audioplayers/example/lib/main.dart | 2 +- packages/audioplayers/example/lib/tabs/audio_context.dart | 2 +- packages/audioplayers/example/lib/tabs/controls.dart | 2 +- packages/audioplayers/example/lib/tabs/logger.dart | 2 +- packages/audioplayers/example/lib/tabs/sources.dart | 2 +- packages/audioplayers/example/lib/tabs/streams.dart | 2 +- packages/audioplayers/example/pubspec.yaml | 4 ++-- 16 files changed, 26 insertions(+), 27 deletions(-) diff --git a/packages/audioplayers/example/lib/components/btn.dart b/packages/audioplayers/example/lib/components/btn.dart index 9c3ce1e53..88f050290 100644 --- a/packages/audioplayers/example/lib/components/btn.dart +++ b/packages/audioplayers/example/lib/components/btn.dart @@ -4,8 +4,7 @@ class Btn extends StatelessWidget { final String txt; final VoidCallback onPressed; - const Btn({Key? key, required this.txt, required this.onPressed}) - : super(key: key); + const Btn({super.key, required this.txt, required this.onPressed}); @override Widget build(BuildContext context) { diff --git a/packages/audioplayers/example/lib/components/cbx.dart b/packages/audioplayers/example/lib/components/cbx.dart index 70b2893df..ad5f6bfbb 100644 --- a/packages/audioplayers/example/lib/components/cbx.dart +++ b/packages/audioplayers/example/lib/components/cbx.dart @@ -9,8 +9,8 @@ class Cbx extends StatelessWidget { this.label, this.value, this.update, { - Key? key, - }) : super(key: key); + super.key, + }); @override Widget build(BuildContext context) { diff --git a/packages/audioplayers/example/lib/components/dlg.dart b/packages/audioplayers/example/lib/components/dlg.dart index 3f0c89fc7..bfa81d9cf 100644 --- a/packages/audioplayers/example/lib/components/dlg.dart +++ b/packages/audioplayers/example/lib/components/dlg.dart @@ -5,10 +5,10 @@ class SimpleDlg extends StatelessWidget { final String message, action; const SimpleDlg({ - Key? key, + super.key, required this.message, required this.action, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -28,9 +28,9 @@ class Dlg extends StatelessWidget { final List children; const Dlg({ - Key? key, + super.key, required this.children, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/packages/audioplayers/example/lib/components/pad.dart b/packages/audioplayers/example/lib/components/pad.dart index d60ba396d..5a4686fa5 100644 --- a/packages/audioplayers/example/lib/components/pad.dart +++ b/packages/audioplayers/example/lib/components/pad.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class Pad extends StatelessWidget { final double width, height; - const Pad({Key? key, this.width = 0, this.height = 0}) : super(key: key); + const Pad({super.key, this.width = 0, this.height = 0}); @override Widget build(BuildContext context) { diff --git a/packages/audioplayers/example/lib/components/player_widget.dart b/packages/audioplayers/example/lib/components/player_widget.dart index 6c754397b..e93d5d51b 100644 --- a/packages/audioplayers/example/lib/components/player_widget.dart +++ b/packages/audioplayers/example/lib/components/player_widget.dart @@ -7,9 +7,9 @@ class PlayerWidget extends StatefulWidget { final AudioPlayer player; const PlayerWidget({ - Key? key, + super.key, required this.player, - }) : super(key: key); + }); @override State createState() { diff --git a/packages/audioplayers/example/lib/components/tab_wrapper.dart b/packages/audioplayers/example/lib/components/tab_wrapper.dart index b1a4e7ec1..3000a192f 100644 --- a/packages/audioplayers/example/lib/components/tab_wrapper.dart +++ b/packages/audioplayers/example/lib/components/tab_wrapper.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class TabWrapper extends StatelessWidget { final List children; - const TabWrapper({Key? key, required this.children}) : super(key: key); + const TabWrapper({super.key, required this.children}); @override Widget build(BuildContext context) { diff --git a/packages/audioplayers/example/lib/components/tabs.dart b/packages/audioplayers/example/lib/components/tabs.dart index 8ba48c0b6..4b37df3b8 100644 --- a/packages/audioplayers/example/lib/components/tabs.dart +++ b/packages/audioplayers/example/lib/components/tabs.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class Tabs extends StatelessWidget { final List tabs; - const Tabs({Key? key, required this.tabs}) : super(key: key); + const Tabs({super.key, required this.tabs}); @override Widget build(BuildContext context) { diff --git a/packages/audioplayers/example/lib/components/tgl.dart b/packages/audioplayers/example/lib/components/tgl.dart index 18f4a98f7..0004e35bc 100644 --- a/packages/audioplayers/example/lib/components/tgl.dart +++ b/packages/audioplayers/example/lib/components/tgl.dart @@ -7,11 +7,11 @@ class Tgl extends StatelessWidget { final void Function(int) onChange; const Tgl({ - Key? key, + super.key, required this.options, required this.selected, required this.onChange, - }) : super(key: key); + }); @override Widget build(BuildContext context) { @@ -38,11 +38,11 @@ class EnumTgl extends StatelessWidget { final void Function(T) onChange; const EnumTgl({ - Key? key, + super.key, required this.options, required this.selected, required this.onChange, - }) : super(key: key); + }); @override Widget build(BuildContext context) { diff --git a/packages/audioplayers/example/lib/components/txt.dart b/packages/audioplayers/example/lib/components/txt.dart index a668bfbef..c6c5a1e1d 100644 --- a/packages/audioplayers/example/lib/components/txt.dart +++ b/packages/audioplayers/example/lib/components/txt.dart @@ -4,10 +4,10 @@ class TxtBox extends StatefulWidget { final String value; final void Function(String) onChange; const TxtBox({ - Key? key, + super.key, required this.value, required this.onChange, - }) : super(key: key); + }); @override State createState() => _TxtBoxState(); diff --git a/packages/audioplayers/example/lib/main.dart b/packages/audioplayers/example/lib/main.dart index 782a862bf..317dd1149 100644 --- a/packages/audioplayers/example/lib/main.dart +++ b/packages/audioplayers/example/lib/main.dart @@ -18,7 +18,7 @@ void main() { } class ExampleApp extends StatefulWidget { - const ExampleApp({Key? key}) : super(key: key); + const ExampleApp({super.key}); @override _ExampleAppState createState() => _ExampleAppState(); diff --git a/packages/audioplayers/example/lib/tabs/audio_context.dart b/packages/audioplayers/example/lib/tabs/audio_context.dart index 2729db4fb..7cc971593 100644 --- a/packages/audioplayers/example/lib/tabs/audio_context.dart +++ b/packages/audioplayers/example/lib/tabs/audio_context.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; class AudioContextTab extends StatefulWidget { final AudioPlayer player; - const AudioContextTab({Key? key, required this.player}) : super(key: key); + const AudioContextTab({super.key, required this.player}); @override _AudioContextTabState createState() => _AudioContextTabState(); diff --git a/packages/audioplayers/example/lib/tabs/controls.dart b/packages/audioplayers/example/lib/tabs/controls.dart index d3f9cab74..3a8f3692f 100644 --- a/packages/audioplayers/example/lib/tabs/controls.dart +++ b/packages/audioplayers/example/lib/tabs/controls.dart @@ -9,7 +9,7 @@ import 'package:flutter/material.dart'; class ControlsTab extends StatefulWidget { final AudioPlayer player; - const ControlsTab({Key? key, required this.player}) : super(key: key); + const ControlsTab({super.key, required this.player}); @override State createState() => _ControlsTabState(); diff --git a/packages/audioplayers/example/lib/tabs/logger.dart b/packages/audioplayers/example/lib/tabs/logger.dart index 95215166c..e4f97fe25 100644 --- a/packages/audioplayers/example/lib/tabs/logger.dart +++ b/packages/audioplayers/example/lib/tabs/logger.dart @@ -4,7 +4,7 @@ import 'package:audioplayers_example/components/tab_wrapper.dart'; import 'package:flutter/material.dart'; class LoggerTab extends StatefulWidget { - const LoggerTab({Key? key}) : super(key: key); + const LoggerTab({super.key}); @override _LoggerTabState createState() => _LoggerTabState(); diff --git a/packages/audioplayers/example/lib/tabs/sources.dart b/packages/audioplayers/example/lib/tabs/sources.dart index 5ca967ac6..38f152bbc 100644 --- a/packages/audioplayers/example/lib/tabs/sources.dart +++ b/packages/audioplayers/example/lib/tabs/sources.dart @@ -30,7 +30,7 @@ const _asset2 = 'nasa_on_a_mission.mp3'; class SourcesTab extends StatefulWidget { final AudioPlayer player; - const SourcesTab({Key? key, required this.player}) : super(key: key); + const SourcesTab({super.key, required this.player}); @override State createState() => _SourcesTabState(); diff --git a/packages/audioplayers/example/lib/tabs/streams.dart b/packages/audioplayers/example/lib/tabs/streams.dart index 51b79f559..956fc353c 100644 --- a/packages/audioplayers/example/lib/tabs/streams.dart +++ b/packages/audioplayers/example/lib/tabs/streams.dart @@ -10,7 +10,7 @@ import 'package:flutter/material.dart'; class StreamsTab extends StatefulWidget { final AudioPlayer player; - const StreamsTab({Key? key, required this.player}) : super(key: key); + const StreamsTab({super.key, required this.player}); @override State createState() => _StreamsTabState(); diff --git a/packages/audioplayers/example/pubspec.yaml b/packages/audioplayers/example/pubspec.yaml index 699ce84af..ccccdcc94 100644 --- a/packages/audioplayers/example/pubspec.yaml +++ b/packages/audioplayers/example/pubspec.yaml @@ -24,5 +24,5 @@ flutter: - assets/ environment: - sdk: ">=2.14.0 <3.0.0" - flutter: ">=2.5.0" + sdk: ">=2.17.0 <3.0.0" + flutter: ">=3.0.0"