EnableBannerNotifier.create constructor

EnableBannerNotifier.create(
  1. Future<bool> calculateInitiallyEnabled()
)

Creates a new EnableBannerNotifier that is initially false and will update to the value of calculateInitiallyEnabled once that completes

Implementation

factory EnableBannerNotifier.create(
  Future<bool> Function() calculateInitiallyEnabled,
) {
  final bannerNotifier = EnableBannerNotifier();

  calculateInitiallyEnabled().then((result) {
    bannerNotifier.enabled = result;
  });

  return bannerNotifier;
}