januwA / flutter_video_box

flutter_video_box
MIT License
22 stars 12 forks source link

Missing imports of 'package:flutter/rendering.dart' #25

Closed liudonghua123 closed 4 years ago

liudonghua123 commented 4 years ago

I got the following error when I updated my flutter to the latest master


Compiler message:
/D:/apps/flutter/.pub-cache/hosted/pub.flutter-io.cn/video_box-0.12.0/lib/widgets/buffer_slider.dart:165:31: Error: The getter 'Overflow' isn't defined for the class 'BufferSlider'.
 - 'BufferSlider' is from 'package:video_box/widgets/buffer_slider.dart' ('/D:/apps/flutter/.pub-cache/hosted/pub.flutter-io.cn/video_box-0.12.0/lib/widgets/buffer_slider.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Overflow'.
                    overflow: Overflow.visible,
                              ^^^^^^^^

The output of flutter doctor is the following.

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.19.0-2.0.pre.213, on Microsoft Windows [Version 10.0.19041.264], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.5.4)   
[√] Android Studio (version 3.6)
[√] VS Code, 64-bit edition (version 1.45.1)
[√] Connected device (4 available)

• No issues found!

If I manual add this line (import 'package:flutter/rendering.dart';), then this error disappeared.

januwA commented 4 years ago

Sorry, this plugin is developed based on stable, if there is a problem in other branches, you can directly repair the plugin's local file to avoid errors

liudonghua123 commented 4 years ago

@januwA OK, I see, thanks. If someone encountered the same issue, especially build on ci, you can try use the following snippets.

dependency_overrides:
  video_box:
    git:
      url: git://github.com/liudonghua123/flutter_video_box.git
      ref: fix_overflow

However, IMO I suggest to add this line for support more branches, because this fix does not break the old exist code. Other package like flutter_chips_input use the same strategy for supporting more branches.