Skip to content

When Flutter app in background, env file data not importing #61

Open

Description

@SamarpanCoder2002
static Key _key =
      Key.fromBase64(DataManagement.getEnvData(EnvFileKey.encryptKey) ?? '');

That's how I am importing env file data(encryptKey in this case). It works fine normally but does not import data while the app is in the background.

If possible, please fix this.

Activity

  1. FlawLessx commented on Sep 6, 2022

    @FlawLessx

    because background service is creating separate isolate from flutter app, you need to initialize first on your background service function, example:
    await dotenv.load(fileName: ".env");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions