Ver Fonte

Version 0.7.0 -- Full Dart 2 support

Brian Egan há 7 anos atrás
pai
commit
ef9aaaf4da

+ 5 - 0
CHANGELOG.md

@@ -1,5 +1,10 @@
 # Changelog
 
+## 0.7.0
+
+  * Requires Dart 2
+  * Updated dependencies that were not Dart 2 compatible
+
 ## 0.6.1
 
   * Fix time formatting

+ 1 - 1
example/lib/main.dart

@@ -28,7 +28,7 @@ class _ChewieDemoState extends State<ChewieDemo> {
   void initState() {
     super.initState();
     _controller = new VideoPlayerController.network(
-      'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
+      'https://github.com/flutter/assets-for-api-docs/blob/master/assets/videos/butterfly.mp4?raw=true',
     );
   }
 

+ 1 - 2
lib/src/chewie_progress_colors.dart

@@ -11,8 +11,7 @@ class ChewieProgressColors {
     Color bufferedColor: const Color.fromRGBO(30, 30, 200, 0.2),
     Color handleColor: const Color.fromRGBO(200, 200, 200, 1.0),
     Color backgroundColor: const Color.fromRGBO(200, 200, 200, 0.5),
-  })
-      : playedPaint = new Paint()..color = playedColor,
+  })  : playedPaint = new Paint()..color = playedColor,
         bufferedPaint = new Paint()..color = bufferedColor,
         handlePaint = new Paint()..color = handleColor,
         backgroundPaint = new Paint()..color = backgroundColor;

+ 1 - 2
lib/src/cupertino_progress_bar.dart

@@ -16,8 +16,7 @@ class CupertinoVideoProgressBar extends StatefulWidget {
     this.onDragEnd,
     this.onDragStart,
     this.onDragUpdate,
-  })
-      : colors = colors ?? new ChewieProgressColors();
+  }) : colors = colors ?? new ChewieProgressColors();
 
   @override
   _VideoProgressBarState createState() {

+ 10 - 1
lib/src/material_controls.dart

@@ -44,7 +44,16 @@ class _MaterialControlsState extends State<MaterialControls> {
   Widget build(BuildContext context) {
     return new Column(
       children: <Widget>[
-        _buildHitArea(),
+        _latestValue != null &&
+                    !_latestValue.isPlaying &&
+                    _latestValue.duration == null ||
+                _latestValue.isBuffering
+            ? Expanded(
+                child: Center(
+                  child: CircularProgressIndicator(),
+                ),
+              )
+            : _buildHitArea(),
         _buildBottomBar(context, widget.controller),
       ],
     );

+ 1 - 2
lib/src/material_progress_bar.dart

@@ -16,8 +16,7 @@ class MaterialVideoProgressBar extends StatefulWidget {
     this.onDragEnd,
     this.onDragStart,
     this.onDragUpdate,
-  })
-      : colors = colors ?? new ChewieProgressColors();
+  }) : colors = colors ?? new ChewieProgressColors();
 
   @override
   _VideoProgressBarState createState() {

+ 1 - 2
lib/src/player_with_controls.dart

@@ -116,7 +116,6 @@ class _VideoPlayerWithControlsState extends State<PlayerWithControls> {
     super.initState();
   }
 
-
   @override
   void didUpdateWidget(PlayerWithControls oldWidget) {
     super.didUpdateWidget(oldWidget);
@@ -127,7 +126,7 @@ class _VideoPlayerWithControlsState extends State<PlayerWithControls> {
   }
 
   @override
-  dispose(){
+  dispose() {
     widget.controller.removeListener(_onPlay);
     super.dispose();
   }

+ 2 - 2
lib/src/utils.dart

@@ -15,8 +15,8 @@ String formatDuration(Duration position) {
   final secondsString =
       seconds >= 10 ? '$seconds' : seconds == 0 ? '00' : '0$seconds';
 
-  final formattedTime = '${hoursString == '00' ? '' : hoursString +
-      ':'}$minutesString:$secondsString';
+  final formattedTime =
+      '${hoursString == '00' ? '' : hoursString + ':'}$minutesString:$secondsString';
 
   return formattedTime;
 }

+ 2 - 2
pubspec.yaml

@@ -1,6 +1,6 @@
 name: chewie
 description: A video player for Flutter with Cupertino and Material play controls
-version: 0.6.1
+version: 0.7.0
 homepage: https://github.com/brianegan/chewie
 author: Brian Egan <brian@brianegan.com>
 
@@ -8,7 +8,7 @@ environment:
   sdk: ">=2.0.0-dev.28.0 <3.0.0"
 
 dependencies:
-  open_iconic_flutter: ">=0.2.0 <0.3.0"
+  open_iconic_flutter: ">=0.3.0 <0.4.0"
   video_player: ">=0.6.0 <0.7.0"
   flutter:
     sdk: flutter