cmdrootaccess / another-flushbar

A flexible widget for user notification. Customize your text, button, duration, animations and much more. For Android devs, it is made to replace Snackbars and Toasts.
https://pub.dev/packages/another_flushbar
MIT License
145 stars 89 forks source link

Release upgrade to flutter 3 in a small version is a mistake #67

Closed LangInteger closed 2 years ago

LangInteger commented 2 years ago

Hey, I'm using flutter_login in my project, and another_flushbar is one of the dependencies of flutter_login. Thx for your awesome work here.

I noticed that there is a release of 1.10.29 - 2022-17-05, that declares merged flutter v3.

With this change, my project (based on flutter v2.10.4) failed to build with the message:

../../../green_software/flutter/.pub-cache/hosted/pub.dartlang.org/another_flushbar-1.10.29/lib/flushbar.dart:350:31: Error: Method 'addPostFrameCallback' cannot be called on 'SchedulerBinding?' because it is potentially null.
 - 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../green_software/flutter/packages/flutter/lib/src/scheduler/binding.dart').
Try calling using ?. instead.
    SchedulerBinding.instance.addPostFrameCallback(
                              ^^^^^^^^^^^^^^^^^^^^
Failed to package /Users/mac/gitrepo/presence/Presence-FE.
Command PhaseScriptExecution failed with a nonzero exit code

I think this is because flutter_login writes dependency as another_flushbar: ^1.10.28, as 1.10.29 is released, flutter pub get will treat it as a compatible version of v1.10.28 and use the newer one, which is actually with huge change and may cause an unknown error.

So, I think it is not proper to release a function like merged flutter v3 in a small version.

I'm new to flutter, do you have any others suggestions on managing flutter dependencies so that I can avoid such a problem?

Many thanks to your contribution to the community again!

nullhandler commented 2 years ago

I agree. Please follow https://semver.org. If it's a breaking change, the MAJOR number in MAJOR.MINOR.PATCH should be increased.

cmdrootaccess commented 2 years ago

i hear you, thanks for pointing that out, will be mindful next time

LangInteger commented 2 years ago

i hear you, thanks for pointing that out, will be mindful next time

Thanks for your response, I'll close this issue