Skip to content

Commit

Permalink
chore!: Bump Flutter to version 3.10.x (#1529)
Browse files Browse the repository at this point in the history
# Description

- chore: bump flame_lint to v1.0.0
- chore: bump min flutter to v3.10.0
- chore: bump min dart sdk to v3.0.0
- chore: bump http to v1.0.0 (closes #1528)
- add melos commands for: `dart pub outdated` & `dart pub upgrade --major-versions`

## Breaking Change

- [x] Yes, this is a breaking change.

### Migration instructions

Before:
```yaml
# pubspec.yaml
environment:
  sdk: ">=2.x.x <3.0.0"
  flutter: ">=3.x.x"
```

After:
```yaml
# pubspec.yaml
environment:
  sdk: ">=3.0.0 <4.0.0"
  flutter: ">=3.10.0"
```
  • Loading branch information
Gustl22 authored May 30, 2023
1 parent 4d5a229 commit c1296c9
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ on:
inputs:
flutter_version:
required: false
default: '3.7.12'
default: '3.10.2'
type: string
enable_android:
required: false
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ jobs:
call-min-flutter-test:
uses: ./.github/workflows/test.yml
with:
flutter_version: '3.3.x'
flutter_version: '3.10.x'
fatal_warnings: false
# TODO(gustl22): Windows tests fail on Flutter <= 3.3.x, remove when setting min version to 3.7.x
enable_windows: false
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
- '3.10.x'
- '3.7.x'
- '3.3.x'
- '3.0.x'
fatal_warnings:
description: 'Treat warnings as fatal'
required: false
Expand Down Expand Up @@ -52,7 +51,7 @@ on:
inputs:
flutter_version:
required: false
default: '3.7.12'
default: '3.10.2'
type: string
fatal_warnings:
required: false
Expand Down
9 changes: 9 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ scripts:
packageFilters:
ignore: "*_example"

pub-outdated:
run: melos exec dart pub outdated
description: Run `dart pub outdated` for all packages.

pub-upgrade:
# May fails until https://github.com/dart-lang/pub/pull/3920 is released
run: melos exec dart pub upgrade --major-versions
description: Run `dart pub upgrade --major-versions` for all packages.

test:select:
run: melos exec flutter test
packageFilters:
Expand Down
4 changes: 2 additions & 2 deletions packages/audioplayers/example/lib/components/cbx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class Cbx extends StatelessWidget {
final String label;
final bool value;
final void Function(bool) update;
final void Function({required bool? value}) update;

const Cbx(
this.label,
Expand All @@ -17,7 +17,7 @@ class Cbx extends StatelessWidget {
return CheckboxListTile(
title: Text(label),
value: value,
onChanged: (v) => update(v!),
onChanged: (v) => update(value: v),
);
}
}
39 changes: 0 additions & 39 deletions packages/audioplayers/example/lib/components/indexed_stack.dart

This file was deleted.

3 changes: 1 addition & 2 deletions packages/audioplayers/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:audioplayers/audioplayers.dart';
import 'package:audioplayers_example/components/indexed_stack.dart';
import 'package:audioplayers_example/components/tabs.dart';
import 'package:audioplayers_example/components/tgl.dart';
import 'package:audioplayers_example/tabs/audio_context.dart';
Expand Down Expand Up @@ -148,7 +147,7 @@ class _ExampleAppState extends State<_ExampleApp> {
Expanded(
child: audioPlayers.isEmpty
? const Text('No AudioPlayer available!')
: IndexedStack2(
: IndexedStack(
index: selectedPlayerIdx,
children: audioPlayers
.map(
Expand Down
24 changes: 14 additions & 10 deletions packages/audioplayers/example/lib/tabs/audio_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,26 @@ class AudioContextTabState extends State<AudioContextTab>
Cbx(
'Force Speaker',
value: audioContextConfig.forceSpeaker,
(v) => updateConfig(audioContextConfig.copy(forceSpeaker: v)),
({value}) =>
updateConfig(audioContextConfig.copy(forceSpeaker: value)),
),
Cbx(
'Duck Audio',
value: audioContextConfig.duckAudio,
(v) => updateConfig(audioContextConfig.copy(duckAudio: v)),
({value}) => updateConfig(
audioContextConfig.copy(duckAudio: value),
),
),
Cbx(
'Respect Silence',
value: audioContextConfig.respectSilence,
(v) => updateConfig(audioContextConfig.copy(respectSilence: v)),
({value}) =>
updateConfig(audioContextConfig.copy(respectSilence: value)),
),
Cbx(
'Stay Awake',
value: audioContextConfig.stayAwake,
(v) => updateConfig(audioContextConfig.copy(stayAwake: v)),
({value}) => updateConfig(audioContextConfig.copy(stayAwake: value)),
),
],
);
Expand All @@ -133,15 +137,15 @@ class AudioContextTabState extends State<AudioContextTab>
Cbx(
'isSpeakerphoneOn',
value: audioContext.android.isSpeakerphoneOn,
(v) => updateAudioContextAndroid(
audioContext.android.copy(isSpeakerphoneOn: v),
({value}) => updateAudioContextAndroid(
audioContext.android.copy(isSpeakerphoneOn: value),
),
),
Cbx(
'stayAwake',
value: audioContext.android.stayAwake,
(v) => updateAudioContextAndroid(
audioContext.android.copy(stayAwake: v),
({value}) => updateAudioContextAndroid(
audioContext.android.copy(stayAwake: value),
),
),
LabeledDropDown<AndroidContentType>(
Expand Down Expand Up @@ -191,8 +195,8 @@ class AudioContextTabState extends State<AudioContextTab>
return Cbx(
option.name,
value: options.contains(option),
(v) {
if (v) {
({value}) {
if (value ?? false) {
options.add(option);
} else {
options.remove(option);
Expand Down
8 changes: 4 additions & 4 deletions packages/audioplayers/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ dependencies:
file_picker: ^5.0.1
flutter:
sdk: flutter
http: ^0.13.1
http: ^1.0.0
path_provider: ^2.0.12
provider: ^6.0.5

dev_dependencies:
# Integration tests for audioplayers_platform_interface are handled
# in this package to avoid maintaining multiple example apps:
audioplayers_platform_interface: ^5.0.1
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter
integration_test:
Expand All @@ -29,5 +29,5 @@ flutter:
- assets/

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
6 changes: 3 additions & 3 deletions packages/audioplayers/example/server/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: audioplayers_test_server
publish_to: none

environment:
sdk: ">=2.18.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
shelf: ^1.2.0
shelf_router: ^1.0.0
shelf_static: ^1.0.0

dev_dependencies:
flame_lint: ^0.2.0
http: ^0.13.0
flame_lint: ^1.0.0
http: ^1.0.0
8 changes: 4 additions & 4 deletions packages/audioplayers/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ dependencies:
file: ^6.1.0
flutter:
sdk: flutter
http: ^0.13.5
http: ^1.0.0
meta: ^1.7.0
path_provider: ^2.0.12
synchronized: ^3.0.0
uuid: ^3.0.7

dev_dependencies:
dartdoc: ^6.1.5
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"

6 changes: 3 additions & 3 deletions packages/audioplayers_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ dependencies:

dev_dependencies:
dartdoc: ^6.1.5
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"

6 changes: 3 additions & 3 deletions packages/audioplayers_darwin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ dependencies:

dev_dependencies:
dartdoc: ^6.1.5
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"

6 changes: 3 additions & 3 deletions packages/audioplayers_linux/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ dependencies:

dev_dependencies:
dartdoc: ^6.1.5
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"

6 changes: 3 additions & 3 deletions packages/audioplayers_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ dependencies:

dev_dependencies:
dartdoc: ^6.1.5
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
final platform = AudioplayersPlatformInterface.instance;

final methodCalls = <MethodCall>[];
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
const MethodChannel('xyz.luan/audioplayers'),
(MethodCall methodCall) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void main() {
}

group('Global Method Channel', () {
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
const MethodChannel('xyz.luan/audioplayers.global'),
(MethodCall methodCall) async {
Expand Down
4 changes: 2 additions & 2 deletions packages/audioplayers_platform_interface/test/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ void createNativeEventStream({
required String channel,
Stream<ByteData>? byteDataStream,
}) {
TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMessageHandler(channel, (ByteData? message) async {
final methodCall = const StandardMethodCodec().decodeMethodCall(message);
if (methodCall.method == 'listen') {
byteDataStream?.listen((byteData) async {
await TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger
await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.handlePlatformMessage(
channel,
byteData,
Expand Down
6 changes: 3 additions & 3 deletions packages/audioplayers_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ dependencies:

dev_dependencies:
dartdoc: ^6.1.5
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"
6 changes: 3 additions & 3 deletions packages/audioplayers_windows/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ dependencies:

dev_dependencies:
dartdoc: ^6.1.5
flame_lint: ^0.2.0
flame_lint: ^1.0.0
flutter_test:
sdk: flutter

environment:
sdk: ">=2.18.0 <3.0.0"
flutter: ">=3.3.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.0"

0 comments on commit c1296c9

Please sign in to comment.