Skip to content

Commit b7d2442

Browse files
committed
Added support for Flutter 3.29 while maintaining minimum support for 3.27.
1 parent 6806424 commit b7d2442

File tree

6 files changed

+62
-65
lines changed

6 files changed

+62
-65
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# refer to https://docs.flutter.dev/development/tools/sdk/releases.
3232
# Note: The version below should be manually updated to the latest second most recent version
3333
# after a new stable version comes out.
34-
- "3.24.5"
34+
- "3.27.4"
3535
- "3.x"
3636
steps:
3737
- name: 📚 Git Checkout

example/lib/app/app.dart

+48-49
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import 'package:flutter/material.dart';
66
import 'package:video_player/video_player.dart';
77

88
class ChewieDemo extends StatefulWidget {
9-
const ChewieDemo({
10-
super.key,
11-
this.title = 'Chewie Demo',
12-
});
9+
const ChewieDemo({super.key, this.title = 'Chewie Demo'});
1310

1411
final String title;
1512

@@ -47,13 +44,15 @@ class _ChewieDemoState extends State<ChewieDemo> {
4744
];
4845

4946
Future<void> initializePlayer() async {
50-
_videoPlayerController1 =
51-
VideoPlayerController.networkUrl(Uri.parse(srcs[currPlayIndex]));
52-
_videoPlayerController2 =
53-
VideoPlayerController.networkUrl(Uri.parse(srcs[currPlayIndex]));
47+
_videoPlayerController1 = VideoPlayerController.networkUrl(
48+
Uri.parse(srcs[currPlayIndex]),
49+
);
50+
_videoPlayerController2 = VideoPlayerController.networkUrl(
51+
Uri.parse(srcs[currPlayIndex]),
52+
);
5453
await Future.wait([
5554
_videoPlayerController1.initialize(),
56-
_videoPlayerController2.initialize()
55+
_videoPlayerController2.initialize(),
5756
]);
5857
_createChewieController();
5958
setState(() {});
@@ -93,7 +92,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
9392
TextSpan(
9493
text: 'subtitles',
9594
style: TextStyle(color: Colors.blue, fontSize: 18),
96-
)
95+
),
9796
],
9897
),
9998
),
@@ -127,17 +126,17 @@ class _ChewieDemoState extends State<ChewieDemo> {
127126
},
128127
subtitle: Subtitles(subtitles),
129128
showSubtitles: true,
130-
subtitleBuilder: (context, dynamic subtitle) => Container(
131-
padding: const EdgeInsets.all(10.0),
132-
child: subtitle is InlineSpan
133-
? RichText(
134-
text: subtitle,
135-
)
136-
: Text(
137-
subtitle.toString(),
138-
style: const TextStyle(color: Colors.black),
139-
),
140-
),
129+
subtitleBuilder:
130+
(context, dynamic subtitle) => Container(
131+
padding: const EdgeInsets.all(10.0),
132+
child:
133+
subtitle is InlineSpan
134+
? RichText(text: subtitle)
135+
: Text(
136+
subtitle.toString(),
137+
style: const TextStyle(color: Colors.black),
138+
),
139+
),
141140

142141
hideControlsTimer: const Duration(seconds: 1),
143142

@@ -176,27 +175,26 @@ class _ChewieDemoState extends State<ChewieDemo> {
176175
platform: _platform ?? Theme.of(context).platform,
177176
),
178177
home: Scaffold(
179-
appBar: AppBar(
180-
title: Text(widget.title),
181-
),
178+
appBar: AppBar(title: Text(widget.title)),
182179
body: Column(
183180
children: <Widget>[
184181
Expanded(
185182
child: Center(
186-
child: _chewieController != null &&
187-
_chewieController!
188-
.videoPlayerController.value.isInitialized
189-
? Chewie(
190-
controller: _chewieController!,
191-
)
192-
: const Column(
193-
mainAxisAlignment: MainAxisAlignment.center,
194-
children: [
195-
CircularProgressIndicator(),
196-
SizedBox(height: 20),
197-
Text('Loading'),
198-
],
199-
),
183+
child:
184+
_chewieController != null &&
185+
_chewieController!
186+
.videoPlayerController
187+
.value
188+
.isInitialized
189+
? Chewie(controller: _chewieController!)
190+
: const Column(
191+
mainAxisAlignment: MainAxisAlignment.center,
192+
children: [
193+
CircularProgressIndicator(),
194+
SizedBox(height: 20),
195+
Text('Loading'),
196+
],
197+
),
200198
),
201199
),
202200
TextButton(
@@ -261,7 +259,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
261259
child: Text("Portrait Video"),
262260
),
263261
),
264-
)
262+
),
265263
],
266264
),
267265
Row(
@@ -291,7 +289,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
291289
child: Text("iOS controls"),
292290
),
293291
),
294-
)
292+
),
295293
],
296294
),
297295
Row(
@@ -324,7 +322,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
324322
}
325323
},
326324
),
327-
)
325+
),
328326
],
329327
),
330328
),
@@ -369,14 +367,15 @@ class _DelaySliderState extends State<DelaySlider> {
369367
),
370368
trailing: IconButton(
371369
icon: const Icon(Icons.save),
372-
onPressed: saved
373-
? null
374-
: () {
375-
widget.onSave(delay);
376-
setState(() {
377-
saved = true;
378-
});
379-
},
370+
onPressed:
371+
saved
372+
? null
373+
: () {
374+
widget.onSave(delay);
375+
setState(() {
376+
saved = true;
377+
});
378+
},
380379
),
381380
);
382381
}

example/lib/main.dart

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ import 'package:chewie_example/app/app.dart';
22
import 'package:flutter/material.dart';
33

44
void main() {
5-
runApp(
6-
const ChewieDemo(),
7-
);
5+
runApp(const ChewieDemo());
86
}

example/pubspec.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ version: 1.0.0
44
publish_to: none
55

66
environment:
7-
sdk: '>=3.3.0 <4.0.0'
8-
flutter: ">=3.19.0"
7+
sdk: '>=3.7.0 <4.0.0'
8+
flutter: ">=3.29.0"
99

1010
dependencies:
1111
chewie:
1212
path: ../
1313
flutter:
1414
sdk: flutter
15+
video_player: ^2.9.3
1516

16-
video_player: ^2.9.1
1717
dev_dependencies:
1818
flutter_test:
1919
sdk: flutter
20-
flutter_lints: ^4.0.0
20+
flutter_lints: ^5.0.0
2121

2222
# For information on the generic Dart part of this file, see the
2323
# following page: https://www.dartlang.org/tools/pub/pubspec

lib/chewie.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
library chewie;
1+
library;
22

33
export 'src/chewie_player.dart';
44
export 'src/chewie_progress_colors.dart';
55
export 'src/cupertino/cupertino_controls.dart';
66
export 'src/material/material_controls.dart';
7-
export 'src/material/material_progress_bar.dart';
87
export 'src/material/material_desktop_controls.dart';
8+
export 'src/material/material_progress_bar.dart';
99
export 'src/models/index.dart';

pubspec.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ version: 1.10.0
44
homepage: https://github.com/fluttercommunity/chewie
55

66
environment:
7-
sdk: '>=3.5.0 <4.0.0'
8-
flutter: ">=3.24.0"
7+
sdk: '>=3.6.0 <4.0.0'
8+
flutter: ">=3.27.0"
99

1010
dependencies:
11-
cupertino_icons: ^1.0.5
11+
cupertino_icons: ^1.0.8
1212
flutter:
1313
sdk: flutter
1414
provider: ^6.1.2
15-
video_player: ^2.9.1
16-
wakelock_plus: ^1.2.8
15+
video_player: ^2.9.3
16+
wakelock_plus: ^1.2.10
1717

1818
dev_dependencies:
1919
flutter_test:
2020
sdk: flutter
21-
flutter_lints: ^4.0.0
21+
flutter_lints: ^5.0.0
2222

2323
flutter:
2424
uses-material-design: true

0 commit comments

Comments
 (0)