Skip to content

Commit

Permalink
feat: add json macro support (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunogabriel committed Oct 17, 2024
1 parent 7436178 commit 2e20525
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
38 changes: 38 additions & 0 deletions pokedex/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "pokedex (debug mode)",
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"program": "lib/app/main.dart",
"toolArgs": [
"--enable-experiment=macros"
]
},
{
"name": "pokedex (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile",
"program": "lib/app/main.dart",
"toolArgs": [
"--enable-experiment=macros"
]
},
{
"name": "pokedex (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release",
"program": "lib/app/main.dart",
"toolArgs": [
"--enable-experiment=macros"
]
}
]
}
4 changes: 3 additions & 1 deletion pokedex/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ linter:
analyzer:
exclude:
- lib/**/*.g.dart
- lib/**/*.config.dart
- lib/**/*.config.dart
enable-experiment:
- macros
12 changes: 12 additions & 0 deletions pokedex/lib/pokemon_list/data/model/pokemon_list_response.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:json/json.dart';

@JsonCodable()
class PokemonListResponse {
PokemonListResponse({
required this.name,
required this.url,
});

final String name;
final String url;
}
1 change: 1 addition & 0 deletions pokedex/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies:
shared_preferences: ^2.3.2
collection: ^1.18.0
dio: ^5.7.0
json: ^0.20.2

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 2e20525

Please sign in to comment.