Apply Flutter best practices [Non-Breaking]#2
Apply Flutter best practices [Non-Breaking]#2hiroshihorie merged 26 commits intolivekit:mainfrom unxp:apply-flutter-best-practices
Conversation
lint: use_key_in_widget_constructors
lint: unnecessary_new
|
@davidzhao The tests wont pass because I didn't solve the "Prefer using lowerCamelCase for constant names" lint which requires potentially breaking changes. |
|
Ah I see. could we turn off this rule? Some of those we'd probably want to preserve, like Do you have ideas around handling the print violations in example? should we ignore that folder entirely? |
|
@davidzhao IMO that should be an enum maybe something like: enum RTCIceTransportPolicy {
all,
relay,
}
extension RTCIceTransportPolicyExt on RTCIceTransportPolicy {
String toStringValue() => {
RTCIceTransportPolicy.all: 'all',
RTCIceTransportPolicy.relay: 'relay',
}[this]!;
}But that's potentially breaking, I don't see references to But it's your call 😁 |
|
that's fair. go ahead and update to your suggestions. Since we haven't officially released it and none of these enums are in the critical path, it's fine to not maintain compatibility. |
|
I find the 80 chars line length too short for
|
|
I'm ok with relaxing the constraints a bit. But I think 120 is a bit too long. How about 100? |
Should solve lint error: no_logic_in_create_state
|
@davidzhao Made minor improvements to the example |
Add flutter_lints package, and clear the lint warnings.
This PR is intended to be non-breaking, but clearing some lint errors need breaking changes, I will open another Draft PR for that.