at_widgets icon indicating copy to clipboard operation
at_widgets copied to clipboard

bug(onboarding_flutter): There are 3 places to specify rootDomain in at_onboarding_flutter

Open xavierchanth opened this issue 1 year ago • 0 comments

There should only be one.

Example code:

Future<AtClientPreference> loadAtClientPreference(String rootDomain) async {
  var dir = await getApplicationSupportDirectory();

  return AtClientPreference()
    ..rootDomain = rootDomain
    ..namespace = Constants.namespace
    ..hiveStoragePath = dir.path
    ..commitLogPath = dir.path
    ..isLocalStoreRequired = true;
}

    AtOnboardingResult onboardingResult = await AtOnboarding.onboard(
      atsign: atsign,
      // ignore: use_build_context_synchronously
      context: context,
      config: AtOnboardingConfig(
        atClientPreference: await loadAtClientPreference(rootDomain),
        rootEnvironment: RootEnvironment.Production,
        domain: rootDomain,
        appAPIKey: Constants.appAPIKey,
      ),
    );

AtClientPreference, RootEnvironment, and domain all imply the same thing.

xavierchanth avatar Oct 16 '24 18:10 xavierchanth