-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: multiple generations for same class #123
Closed
Closed
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2eba9e7
removed erroneous entry from melos.yaml
Rodsevich 1ec950d
work with pubspec overrides for facilitating example package deps
Rodsevich b2312bc
order pubspec dependencies
Rodsevich 8f9ba1f
support multiple Envied annotations (Fix #122)
Rodsevich 22a2820
bump version 1.0.1
Rodsevich 9644c82
Revert "bump version 1.0.1"
Rodsevich 00a4916
revert to melos bs
Rodsevich bc0114e
dev instructions
Rodsevich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Files and directories created by pub. | ||
.dart_tool/ | ||
.packages | ||
.pubspec.lock | ||
|
||
# Conventional directory for build output. | ||
build/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// lib/env.dart | ||
import 'package:envied/envied.dart'; | ||
import 'package:example/example_enum.dart'; | ||
|
||
import 'app_env_fields.dart'; | ||
|
||
part 'envs.env.g.dart'; | ||
|
||
@Envied( | ||
path: '.env_debug', | ||
name: 'Dev', | ||
allowOptionalFields: true, | ||
interpolate: false, | ||
obfuscate: false, | ||
requireEnvFile: true, | ||
rawStrings: true, | ||
useConstantCase: false, | ||
randomSeed: 1) | ||
@Envied(path: '.env', name: 'Prod') | ||
final class Envs implements AppEnvFields { | ||
/// NOTE: This is here just as an example! | ||
/// | ||
/// In a Flutter app you would normally import this like so | ||
/// import 'package:flutter/foundation.dart'; | ||
static const kDebugMode = true; | ||
|
||
factory Envs() => _instance; | ||
|
||
static dynamic _instance = kDebugMode ? _Dev() : _Prod(); | ||
|
||
@override | ||
@EnviedField(varName: 'KEY1') | ||
final String key1 = _instance.key1; | ||
|
||
@override | ||
@EnviedField(varName: 'KEY2') | ||
final String key2 = _instance.key2; | ||
|
||
@override | ||
@EnviedField() | ||
final String key3 = _instance.key3; | ||
|
||
@override | ||
@EnviedField() | ||
final int key4 = _instance.key4; | ||
|
||
@override | ||
@EnviedField() | ||
final bool key5 = _instance.key5; | ||
|
||
@override | ||
@EnviedField() | ||
final Uri key6 = _instance.key6; | ||
|
||
@override | ||
@EnviedField() | ||
final DateTime key7 = _instance.key7; | ||
|
||
@override | ||
@EnviedField() | ||
final ExampleEnum key8 = _instance.key8; | ||
|
||
@override | ||
@EnviedField(rawString: true) | ||
final String key9 = _instance.key9; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this, as the overrides should not be tracked.