Skip to content
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

refactor: facelift both Envied and EnviedGenerator to Dart 3.0 #46

Merged
merged 7 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/envied_example/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
KEY1=VALUE1
KEY2=VALUE2
KEY1=foo
KEY2=bar
key3=baz
key4=123
key5=false
7 changes: 5 additions & 2 deletions examples/envied_example/.env_debug
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
KEY1=DEBUG1
KEY2=DEBUG2
KEY1=debug_foo
KEY2=debug_bar
key3=debug_baz
key4=456
key5=true
2 changes: 1 addition & 1 deletion examples/envied_example/lib/app_env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'app_env_fields.dart';
import 'debug_env.dart';
import 'release_env.dart';

abstract class AppEnv implements AppEnvFields {
abstract interface class AppEnv implements AppEnvFields {
/// NOTE: This is here just as an example!
///
/// In a Flutter app you would normally import this like so
Expand Down
2 changes: 1 addition & 1 deletion examples/envied_example/lib/app_env_fields.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Both DebugEnv and ReleaseEnv must implement all these values
abstract class AppEnvFields {
abstract interface class AppEnvFields {
abstract final String key1;
abstract final String key2;
abstract final String key3;
Expand Down
2 changes: 1 addition & 1 deletion examples/envied_example/lib/debug_env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'app_env_fields.dart';
part 'debug_env.g.dart';

@Envied(name: 'Env', path: '.env_debug')
class DebugEnv implements AppEnv, AppEnvFields {
final class DebugEnv implements AppEnv, AppEnvFields {
const DebugEnv();

@override
Expand Down
10 changes: 5 additions & 5 deletions examples/envied_example/lib/debug_env.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/envied_example/lib/env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import 'package:envied/envied.dart';
part 'env.g.dart';

@Envied(path: '.env')
abstract class Env {
final class Env {
@EnviedField(varName: 'KEY1')
static const key1 = _Env.key1;
static const String key1 = _Env.key1;
@EnviedField(varName: 'KEY2')
static const key2 = _Env.key2;
static const String key2 = _Env.key2;
@EnviedField()
static const String key3 = _Env.key3;
@EnviedField()
Expand Down
12 changes: 6 additions & 6 deletions examples/envied_example/lib/env.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/envied_example/lib/release_env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'app_env_fields.dart';
part 'release_env.g.dart';

@Envied(name: 'Env', path: '.env')
class ReleaseEnv implements AppEnv, AppEnvFields {
final class ReleaseEnv implements AppEnv, AppEnvFields {
const ReleaseEnv();

@override
Expand Down
12 changes: 6 additions & 6 deletions examples/envied_example/lib/release_env.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading