Update dependency flutter_dotenv to v6 #13
Reference in New Issue
Block a user
Delete Branch "renovate/flutter_dotenv-6.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
^5.2.1→^6.0.0Release Notes
java-james/flutter_dotenv (flutter_dotenv)
v6.0.1Compare Source
isEveryDefined()now throwsNotInitializedErrorbeforeload(), consistent with all other read APIsassert()with explicitif/throwingetInt(),getDouble(), andgetBool()so null-safety checks are enforced in release buildsload(isOptional: true)no longer discards successfully loaded base file when an override file is missing or empty (fixes #70, #93, #101, #125)clean()now resetsisInitializedtofalse, so accessingenvafterclean()correctly throwsNotInitializedErrorNotInitializedError,FileNotFoundError,EmptyEnvFileError) now include informative messages intoString()instead of the unhelpfulInstance of 'ClassName'(fixes #72, #127; improves diagnostics for #59, #89)FileNotFoundErrorandEmptyEnvFileErrornow carry the filename when availableNote on error message improvements
NotInitializedError,FileNotFoundError, andEmptyEnvFileErrornow overridetoString()with actionable messages (e.g.,FileNotFoundError: Environment file ".env" not found. Ensure the file exists and is listed under assets in pubspec.yaml.). This is not a breaking change — the class names and hierarchy are unchanged, so existingon FileNotFoundErrorcatch clauses continue to work.FileNotFoundErrornow accepts an optional positionalfilenameparameter, andEmptyEnvFileErroraccepts an optional namedfilenameparameter; both default tonullfor backward compatibility.Note on release-build behavior change
In debug mode, behavior is unchanged —
AssertionErrorwas thrown before,AssertionErroris thrown now.In release mode, calling
getInt(),getDouble(), orgetBool()with a missing variable and no fallback previously threw aTypeError(from the null-check operator!) becauseassert()was stripped. It now correctly throwsAssertionErrorwith a descriptive message. If your release-mode code catcheson TypeErroraround these methods, update it to catchon AssertionError(oron Error) instead.Breaking change:
clean()now resets initialization statePreviously, calling
clean()only cleared the env map but leftisInitialized == true. Now it also setsisInitialized = false. Code that callsclean()and then immediately accessesdotenv.envwithout reloading will now throwNotInitializedError. The fix is to callload()orloadFromString()again afterclean().v6.0.0Compare Source
Breaking changes
Renamed:
testLoad→loadFromStringThe method has been renamed to better reflect that it can be used outside of test environments.
⚠️ Update your code to call
loadFromString()instead oftestLoad().Behavior change: Empty file handling with
isOptional = truePreviously, if the env file was empty and
isOptionalwastrue, the method would throw.Now, in this case, it no longer throws and simply returns an empty env.
Supported SDK range change: Dropped support for the pre release
2.12.0-0. Now supports2.12.0onwards.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: pubspec.lock
69e647d33fto604b73b2ffView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.