-
Notifications
You must be signed in to change notification settings - Fork 200
Downgrade version settings to support flutter 2.8.0+ #139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downgrade version settings to support flutter 2.8.0+ #139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
it's not hard to implement Enum.name
if we need even lower support.
But should we support lower than 2.8.1 ?
yeah, we can try downgrading to a lower version. |
@hiroshihorie I did a more detailed investigation and I tried to downgrade the version to 2.0.0, but failed,
These two features are only supported by dart 2.15.0+. If these places are modified for downgrading, the code readability will be reduced, so I think keeping the current 2.8.0+ support, we can still span three major versions. 2.8.x, 2.10.x and 3.0.x Downgrading to 2.0.0 gives the following error.
|
I made some code modifications to make our SDK work in each version of flutter 2.0.0~3.0.5 I can compile and run normally in the following sdk versions. duanweiwei@duanweiMBPIntel client-sdk-flutter % fvm list
fvm: 2.0.0
fvm: 2.10.5 (current)
fvm: 2.2.0
fvm: 2.5.3
fvm: 2.8.1
fvm: 3.0.0
fvm: 3.0.5
+String enumName(Object o) => o.toString().split('.').last;
...
- '${_connectionState.name} -> ${newValue.name}');
+ '${enumName(_connectionState)} -> ${enumName(newValue)}');
- int get hashCode => Object.hash(maxFramerate, maxBitrate);
+ int get hashCode => identityHashCode(identityHashCode(maxFramerate) + identityHashCode(maxBitrate)); I haven't submitted this commit yet, I think it's worthwhile to exchange this small code modification for the wide-range version support of the SDK, @hiroshihorie @davidzhao what do you think. |
I'm all for it. Just curious, are users asking for supporting older flutter versions? How many people are still using 2.8.0? I think unlike Device OS support, it seems pretty easy to update Flutter version for the developer right? |
yes, I think so. The minimum version of flutter that supports m1 mac is flutter 3.0.0, only intel mac or windows/linux can support flutter 2.x, and 2.8.0 was released on 2021/12/9, so from my developer's point of view, there are 6 Months also seems to be enough (no need to reverse update), so I merge to 2.8.0 support first (don't submit downgrade to 2.0.0 related patches to avoid some dirty code) |
Since the SDK uses the
Enum.name
feature, it is only downgraded to dart 2.15.0, and the corresponding flutter version is 2.8.xCompilation tests passed in
flutter 2.8.1
and3.0.2
.