-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix(configurator): Fix configurator web unsupported error #105
Conversation
@@ -5,19 +5,19 @@ import 'dart:async'; | |||
class Config<T> { | |||
Config({ | |||
required T value, | |||
required StreamSubscription<void> subscription, | |||
required StreamSubscription<void>? subscription, |
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.
I thought this.subscription
would be fine, but I'm wondering if you're purposely assigning it to _subscription
to keep it from being accessed externally.
Probably so, so it is left as is.
required StreamSubscription<void>? subscription, | |
this.subscription, |
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.
I was probably intending that!
@@ -1,18 +1,19 @@ | |||
import 'dart:convert'; | |||
|
|||
import 'package:firebase_remote_config/firebase_remote_config.dart'; | |||
import 'package:meta/meta.dart'; | |||
import 'package:flutter/foundation.dart'; |
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.
Added to use kIsWeb
and made explicit the dependency on Flutter in pubspec as well!
|
||
import 'config.dart'; | ||
|
||
typedef ValueChanged<T> = void Function(T value); | ||
typedef _ValueChanged<T> = void Function(T value); |
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.
I made it private because it seems to be used only within this file.
subscription: kIsWeb || onConfigUpdated == null | ||
? null | ||
: filteredOnConfigUpdated(key).listen((event) async { | ||
await activate(); | ||
onConfigUpdated(getString(key)); | ||
}), |
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.
Register subscriptions only when not on the web and onConfigUpdated
is not null!
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.
@@ -5,19 +5,19 @@ import 'dart:async'; | |||
class Config<T> { | |||
Config({ | |||
required T value, | |||
required StreamSubscription<void> subscription, | |||
required StreamSubscription<void>? subscription, |
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.
I was probably intending that!
π Issue Link
closes #14
π What I did
βοΈ What I didn't do
β Verification
Screenshots
Additional Information