안녕하세요 특정 코드에 대한 질문이 아니라 코드 설계에 대해 궁금한 점이 있습니다. 해당 프로젝트에서는 FeedView를 방문할 때 마다 'loadAllPosts'를 통해서 데이터를 가져오는데 이렇게 하면 비용적인 측면에서 문제가 되지 않을까요? 현업에서도 매번 이렇게 Read를 하는지 아니면 Cache를 사용하는지 궁금합니다.
OnPropertyChanged 해서 선택된 것에서 수정하면 속성 변화를 알고는 동시에 수정되는 것 또한 알았습니다. 혹시 해당 프로그램을 종료하면 저장이 안되어있을텐데, 그 부분에 있어서는 선택된 네임과 에이지의 값을 set 하는 블록 내에서 코딩을 따로 해주면 되는 것일까요? 현재는 age = value; 느낌이면 결국 value을 통해서 age에 바인딩되서 age를 리턴 해서 보여지게 된 것이라고 했을 때 , 모델측에 설정한 list 안의 데이터 값도 변화되서 저장해둘려면 따로 db를 이용해야하는 것일까요 ?
https://gist.githubusercontent.com/junsuk5/bb7485d5f70974deee920b8f0cd1e2f0/raw/063f64d9b343120c2cb01a6555cf9b38761b1d94/sample.json 강의 자료에 따로 없는것 같아서 공유드립니다!
안녕하세요 질문이 2개있습니다. 강의 듣던중 에뮬레이터 실행하니 FAILURE: Build failed with an exception. * Where: Build file 'C:\workspace\Flutter\android\app\build.gradle' line: 5 * What went wrong: An exception occurred applying plugin request [id: 'dev.flutter.flutter-gradle-plugin'] > Failed to apply plugin 'dev.flutter.flutter-gradle-plugin'. > No such property: source for class: java.lang.String * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 590ms Error: Gradle task assembleDebug failed with exit code 1 에러가 났는데 뭐가문제일까요? plugins { id "com.android.application" id "kotlin-android" // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id "dev.flutter.flutter-gradle-plugin" } android { namespace = "com.survivalcoding.flutter_recipe_app_course" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.survivalcoding.flutter_recipe_app_course" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. signingConfig = signingConfigs.debug } } } flutter { source = "../.." } ============================================================ file > settings > build Tools > gradle 설정 부분에서 jdk 설정부분이 없습니다. PS C:\workspace\Flutter> flutter config --list All Settings: enable-web: (Not set) enable-linux-desktop: (Not set) enable-macos-desktop: (Not set) enable-windows-desktop: (Not set) enable-android: (Not set) enable-ios: (Not set) enable-fuchsia: (Not set) (Unavailable) enable-custom-devices: (Not set) cli-animations: (Not set) enable-native-assets: (Not set) (Unavailable) enable-flutter-preview: (Not set) (Unavailable) enable-swift-package-manager: (Not set) (Unavailable) jdk-dir: C:\Program Files\Java\jdk-17 PS C:\workspace\Flutter> flutter doctor -v [√] Flutter (Channel stable, 3.24.0, on Microsoft Windows [Version 10.0.26100.2314], locale ko-KR) • Flutter version 3.24.0 on channel stable at C:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 80c2e84975 (8 months ago), 2024-07-30 23:06:49 +0700 • Engine revision b8800d88be • Dart version 3.5.0 • DevTools version 2.37.2 [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 35.0.1) • Android SDK at C:\Users\hong\AppData\Local\Android\sdk • Platform android-35, build-tools 35.0.1 • Java binary at: C:\Program Files\Java\jdk-17\bin\java • Java version Java(TM) SE Runtime Environment (build 17.0.14+8-LTS-191) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [!] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.42) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools • Visual Studio Build Tools 2019 version 16.11.35425.106 • Windows 10 SDK version 10.0.19041.0 X The current Visual Studio installation is incomplete. Please use Visual Studio Installer to complete the installation or reinstall Visual Studio. [√] Android Studio (version 2024.3) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29) [√] VS Code (version 1.96.4) • VS Code at C:\Users\hong\AppData\Local\Programs\Microsoft VS Code • Flutter extension can be installed from: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [√] Connected device (4 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 16 (API 36) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.2314] • Chrome (web) • chrome • web-javascript • Google Chrome 134.0.6998.89 • Edge (web) • edge • web-javascript • Microsoft Edge 132.0.2957.127 [√] Network resources • All expected network resources are available. ! Doctor found issues in 1 category. PS C:\workspace\Flutter> flutter config --list 명령어하면 jdk는 17이고 flutter doctor -v 하면 jdk가 21로잡혀있어서 버전이 다른데 jdk 설정하는부분이 없는데 어떻게하면 오류해결과 jdk 수동설정 가능하게 할 수 있을까요?
var body: some View { NavigationStack { ScrollView { } } .navigationBarBackButtonHidden() .toolbar { ToolbarItem(placement: .topBarLeading) { Button { dismiss() } label: { Image(systemName: "arrow.backward") .tint(.black) } } } //:TOOLBAR 위와 같이 ProfileView에서 body를 정의하셨는데, NavigationStack에 toolbar가 항상 나타나는 것으로 이해가 됩니다. 그렇다면, 앱을 실행하고 바로 Profile tab을 누른다면, .toolbar가 자동으로 생성되면서 dismiss()가 작동하지 않는 toolbar가 생기는 상황이 발생했습니다. 다시 FeedView로 돌아가면 기존 toolbar는 없어지지 않은채로 "<- : arrow.backward" 가 나타나고, FeedView에서 .overlay { } 로 정의된 NavigationLink 를 클릭한다면 toolbar 가 두개 생기는 것을 확인할 수 있었습니다. 두 개중 위의 버튼은 작동하지 않으며, 아래의 버튼을 누르면 dismiss()가 작동하여 Stack에 쌓인 ProfileView가 없어지면서 FeedView로 돌아가는 것을 확인할 수 있었습니다. 상황에 따라 toolbar 가 보일 수 있도록 따로 설정을 해야하는 것일까요? 다시 말해, ProfileView를 Profile을 tab하여 이동하는 경우는 .toolbar가 나타나지 않도록 해야하는 걸까요?
di 관련해서 문의 좀 드리겠습니다. 선생님 강의를 듣고 get_it, injectable 패키지를 사용해서 di 를 실 프로젝트에도 적용 하고 있습니다. 여러 singleton 으로 생성 한 여러 usecace들을 한군데 모아 둔 usecases(OrderDetailUseCases) 를 만들어 viewModel 에 주입해서 사용하는 것을 보고 실 프로젝트에도 사용하고 있습니다. 아래 처럼요. @singleton class OrderDetailUseCases { final GetOrderDetailUseCase getDetail; final GetGoodsForBasketUseCase getGoodsForBasket; final DeleteOrderUseCase deleteOrder; OrderDetailUseCases( this.getDetail, this.getGoodsForBasket, this.deleteOrder, ); } 그런데 나중에 새로운 usecase(AddOrderUseCase) 가 생겨서 위 OrderDetailUseCases 에 추가하면 아래와 같은 오류가 뜹니다. Bad state: GetIt: Object/factory with type OrderDetailUseCases is not registered inside GetIt. (Did you accidentally do GetIt sl=GetIt.instance(); instead of GetIt sl=GetIt.instance; Did you forget to register it?) 기존에 추가 했던 getDetail, getGooodsForBasket usecase 는 잘 사용하고 있습니다 분명 build runner 명령어를 실행 해 줬음에도 불구하구요. 그래서 DeleteOrderUseCase 는 따로 가져와 viewModel 에 전달해주고 있습니다. 아래처럼요. final orderDetailViewModelProvier = StateNotifierProvider<OrderDetailViewModel, OrderDetailState>((ref) { final useCases = getIt<OrderDetailUseCases>(); final deleteOrderUc = getIt<DeleteOrderUseCase>(); return OrderDetailViewModel( useCases, deleteOrderUc, ); }); 전 하나의 useCases 에 다 넣고 싶거든요..ㅡ,.ㅡ 이게 패키지가 좀 stable 하지 못한 거 같은 느낌인데 이런 경우를 못 보셨는지요? 경우가 있다면 어떻게 해법이 있는지 들어보고 싶습니다.
ingredient view model 의 _loadRecipe 함수는 생성자에서 실행이 안되는 이유에 대해서 궁금합니다. 동일하게 _getDishesByCategoryUseCase.execute를 사용하는 _fetchDishesByCategory 는 home view model에서 생성자에서 쓰이는데 어떤 차이가 있나요
7:15까지 코드 따라하고, 구동하는데;; 아래와 같이 에러가 뜹니다... Thread 3: Simultaneous accesses to 0x600003d332b0, but modification requires exclusive access 구동조차 안되고 바로 아래와 같이 떠버려요;; 이건 어떻게 해결할가요???