강의

멘토링

커뮤니티

Inflearn Community Q&A

cloud5k8132's profile image
cloud5k8132

asked

Flutter Intermediate Part 1 - Clean Architecture

g.dart 파일이 생성이 안됩니다.

Written on

·

2K

·

Edited

0

import 'package:json_annotation/json_annotation.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'note.freezed.dart';
part 'note.g.dart';

@freezed
class Note with _$Note {
  factory Note({
    required String title,
    required String content,
    required int color,
    required int timestamp,
    int? id,
  }) = _Note;

  factory Note.formJson(Map<String, dynamic> json) => _$NoteFromJon(json);
}

g.dart 파일이 생성이 안됩니다.

flutter pub run build_runner build

flutter pub run build_runner clean

flutter pub run build_runner build --delete-conflicting-outputs

이거 해 보았는데 안됩니다.

provider: ^6.0.5
sqflite: ^2.2.3
json_annotation: ^4.7.0
freezed_annotation: ^2.2.0
flutter_lints: ^2.0.1
json_serializable: ^6.5.4
freezed: ^2.3.2
build_runner: ^2.3.3

처음엔 강의 대로 버전 맞춰서 했는데 안되서 최신으로 했는데 그래도 안됩니다~

도와 주십시요~ 강의를 시작도 못하고 있습니다~ ㅜㅜ

iosFlutterandroid

Answer 1

0

survivalcoding님의 프로필 이미지
survivalcoding
Instructor

여기에 오타가 있습니다. 뒷부분에 _$NoteFromJson 인데 s가 빠졌습니다.

factory Note.formJson(Map<String, dynamic> json) => _$NoteFromJon(json);

제가 사용하는 라이브템플릿 공유해 드렸는데요. 참고하셔서 설정하시면 오타없이 하실 수 있습니다.

https://gravel-pike-705.notion.site/Flutter-Live-Templeate-579bac3070754bdf8fa10afe4ebe8c92

cloud5k8132님의 프로필 이미지
cloud5k8132
Questioner

감사합니다 ㅜㅜ

cloud5k8132's profile image
cloud5k8132

asked

Ask a question