@@ -6,10 +6,7 @@ import 'package:flutter/material.dart';
66import 'package:video_player/video_player.dart' ;
77
88class 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 ),
@@ -130,9 +129,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
130129 subtitleBuilder: (context, dynamic subtitle) => Container (
131130 padding: const EdgeInsets .all (10.0 ),
132131 child: subtitle is InlineSpan
133- ? RichText (
134- text: subtitle,
135- )
132+ ? RichText (text: subtitle)
136133 : Text (
137134 subtitle.toString (),
138135 style: const TextStyle (color: Colors .black),
@@ -176,19 +173,15 @@ class _ChewieDemoState extends State<ChewieDemo> {
176173 platform: _platform ?? Theme .of (context).platform,
177174 ),
178175 home: Scaffold (
179- appBar: AppBar (
180- title: Text (widget.title),
181- ),
176+ appBar: AppBar (title: Text (widget.title)),
182177 body: Column (
183178 children: < Widget > [
184179 Expanded (
185180 child: Center (
186181 child: _chewieController != null &&
187182 _chewieController!
188183 .videoPlayerController.value.isInitialized
189- ? Chewie (
190- controller: _chewieController! ,
191- )
184+ ? Chewie (controller: _chewieController! )
192185 : const Column (
193186 mainAxisAlignment: MainAxisAlignment .center,
194187 children: [
@@ -261,7 +254,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
261254 child: Text ("Portrait Video" ),
262255 ),
263256 ),
264- )
257+ ),
265258 ],
266259 ),
267260 Row (
@@ -291,7 +284,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
291284 child: Text ("iOS controls" ),
292285 ),
293286 ),
294- )
287+ ),
295288 ],
296289 ),
297290 Row (
@@ -324,7 +317,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
324317 }
325318 },
326319 ),
327- )
320+ ),
328321 ],
329322 ),
330323 ),
0 commit comments