Observer don't rebuild #3139
Unanswered
ismailkoksal
asked this question in
Q&A
Replies: 1 comment
-
Please report at the mobx.dart repository, this one maintains the JS
version.
…On Sat, Oct 9, 2021 at 7:05 PM Ismail Koksal ***@***.***> wrote:
Hello, I don't understand why my observer don't rebuild when brands are
fetched from server
// main.tsrunApp(MultiProvider(
providers: [
Provider(create: (context) => brandStore),
],
child: MyApp(),
));
// brand_store.dartabstract class _BrandStore with Store {
final Repository _repository;
@observable
ObservableList<Brand> brands = ObservableList<Brand>();
_BrandStore(this._repository);
@action
Future<void> loadBrands() async {
brands = ObservableList.of(await _repository.getBrandList());
}
}
@OverRide
Widget build(BuildContext context) {
final brandStore = context.watch<BrandStore>();
return Observer(builder: (context) {
final brands = brandStore.brands;
return Row(
children: brands
.map((brand) => BrandButton(
logoUrl: brand.image, onTap: () {}))
.toList(),
);
});
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3139>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBDHK3MIFPIGXPXZHUDUGB77ZANCNFSM5FVQ5VMA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I don't understand why my observer don't rebuild when brands are fetched from server
Beta Was this translation helpful? Give feedback.
All reactions