Feat: LF-166 LF-168 Add flutter web iframe contract package#514
Feat: LF-166 LF-168 Add flutter web iframe contract package#514
Conversation
| flutter: '>=3.24.0' | ||
|
|
||
| dependencies: | ||
| bloc: ^8.1.4 |
There was a problem hiding this comment.
This doesn't support the latest 9.* versions
| class UrlParamsBase { | ||
| /// The contract version extracted from the URL query parameters, if present. | ||
| String? get contractVersion => params[contractVersionQueryKey]; | ||
|
|
||
| /// All query parameters from the current URL. | ||
| Map<String, String> get params => Uri.base.queryParameters; | ||
| } |
There was a problem hiding this comment.
Let's make these properties static, and the class itself abstract final
| @@ -0,0 +1,43 @@ | |||
| /// Base state for the host connection lifecycle. | |||
| sealed class ConnectToHostState<THostMethods> { | |||
There was a problem hiding this comment.
Cubit & bloc state should have value-based equatability (package:equatable)
| final cached = _cachedConnection; | ||
| if (cached != null) { |
There was a problem hiding this comment.
| final cached = _cachedConnection; | |
| if (cached != null) { | |
| if (_cachedConnection case final cached?) { |
| matrix: | ||
| flutter_version: ['3.24.x'] |
There was a problem hiding this comment.
Let's also test against the latest version (3.41)
| const String contractVersionQueryKey = 'contractVersion'; | ||
|
|
||
| /// Base class for accessing URL query parameters from [Uri.base]. | ||
| abstract class UrlParamsBase { |
| import 'package:equatable/equatable.dart'; | ||
|
|
||
| /// Base state for the host connection lifecycle. | ||
| sealed class ConnectToHostState<THostMethods> extends Equatable { |
There was a problem hiding this comment.
Use EquatableMixin instead
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| flutter_version: ['3.41'] |
There was a problem hiding this comment.
Since the package claims to support Flutter 3.24+, let's also test that version (i.e. the version that was here before)
| ConnectToHostCubitOptions<TRemoteMethods, THostMethods> options, | ||
| ) : _options = options, | ||
| super(ConnectToHostIdle<THostMethods>()) { | ||
| _connect(); |
There was a problem hiding this comment.
I'd move the initialization out of the constructor (and invoke it where the cubit is created)
No description provided.