Update dependency flutter_dotenv to v6#34
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
8d4a9be to
acd9ff2
Compare
acd9ff2 to
f5859c3
Compare
f5859c3 to
40cfd67
Compare
40cfd67 to
bd9748f
Compare
bd9748f to
57b596e
Compare
57b596e to
7fa6d88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^5.1.0→^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:
⚠️ Update your code to call
testLoad→loadFromStringThe method has been renamed to better reflect that it can be used outside of test environments.
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 was generated by Mend Renovate. View the repository job log.