[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
final baseBorder = const OutlineInputBorder( borderSide: BorderSide( color: INPUT_BORDER_COLOR, ), ); 이 코드를 CustomTextFormField 클래스의 필드로 넣지 않고 build 메서드 안에 작성하신 이유가 따로 있을까요? 이렇게 작성하면 렌더링될때마다 baseBorder가 만들어져야하니 메모리관리면에서 손해인거 아닌가 싶어서요!
프로젝트를 생성하고 첫 실행을 했는데 아래와 같은 오류가 발생했습니다. C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(247,5): error MSB8066: 'C:\Users\tnqls\OneDrive\���� ȭ��\ff\hello_f\build\windows\CMakeFiles\17bcc7b3690274761bc31777eb11dab3\flutter_windows.dll.rule;C:\Users\tnqls\OneDrive\���� ȭ��\ff\hello_f\build\windows\CMakeFiles\e86d85ec92b8cca453a41bad4e8ed811\flutter_assemble.rule;C:\Users\tnqls\OneDrive\���� ȭ��\ff\hello_f\windows\flutter\CMakeLists.txt'�� ���� ����� ���� ���尡 ����Ǿ����ϴ�(�ڵ� 1). [C:\Users\tnqls\OneDrive\���� ȭ��\ff\hello_f\build\windows\flutter\flutter_assemble.vcxproj] Exception: Build process failed. 이후 프로젝트의 안드로이드 파일에 에러표시가 떠 cmd에 flutter doctor를 실행한 결과 Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.10.6, on Microsoft Windows [Version 10.0.22621.1992], locale ko-KR) [√] Windows Version (Installed version of Windows is version 10 or higher) [!] Android toolchain - develop for Android devices (Android SDK version 34.0.0) X cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See https://developer.android.com/studio/command-line for more details. X Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.4) [√] Android Studio (version 2022.2) [√] VS Code (version 1.80.1) [√] Connected device (3 available) [√] Network resources ! Doctor found issues in 1 category. 하나의 오류가 있는듯 한데 현재 안드로이드 스튜디오로 다른 앱 개발 활동을 하고있는것이 혹시 연관이 있을까요? 해결방안을 모르겠어서 질문 남깁니다. 도와주세요..
[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
GoRouter 적용하는 강의 후 처음 splash screen으로 진입 후 getMe함수를 통해 state가 null이 되는 로직을 통과했음에도 router의 redirect를 따르지 않고 계속해서 splash screen에서 머무는 모습이 나타납니다. print로 결과를 확인해보니 처음 redirect 로직을 검증할 때 UserModelLoading의 Instance로 나타나고 이후 getMe를 통해 null이 되더라도 새롭게 redirection이 일어나지 않는 것 같습니다. 고민하다가 해결책이 떠오르지 않아 문의남깁니다!
[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
border: baseBorder 로 설정했을때 color 를 Colors.red 로 해놔도 아무 변화가 없습니다. enabledBorder: baseBorder 설정했을때 그제서야 빨간색이 적용됩니다. focusedBorder 는 커서가 있을때 border 의 형태로 이해가 되었는데 일반 border 와 enabledBorder 속성은 어떤차이가 있는걸까요? border 속성만 사용할때는 아무 변화가 없는 이유도 궁굼합니다.
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
안녕하세요, Flutter에 익숙해지기 위해 해당 강의를 보며 샘플 코드(?)와 비슷하게 코드를 추가하고 hot reload 버튼을 눌렀습니다. 그러자 IOS simulator(iPhone 14 Pro Max)에서 "Lookup failed: title in @getters in MyHomePage in package:hello_world/main.dart" 에러가 발생하여 추가 한 코드가 정상동작을 하는지, 수정해야 하는 부분이 있는지 확인이 불가능하게 되었습니다. 혹시 제가 추가한 코드에서 문제가 될 만한 부분이 있을까요? 제가 추가한 코드와 IOS simulator 에러 화면 첨부드립니다.
[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
안녕하세요. 실험적으로 Code Generator 기능을 이용해서 프로바이더를 다시 작성해보고 있습니다. 궁금한 게 Section 9. 다섯 번째 강의를 보는데, 1분 대에 나오는 RestaurantStateNotifier와 StateNotifierProvider를 어떻게 CodeGenerator를 이용해서 고칠 수 있을까 고민 중입니다. 시도한 코드는 아래와 같은데요(import는 생략했습니다): part 'restaurant_provider.g.dart'; @Riverpod(keepAlive: true) class Restaurant extends _$Restaurant { final RestaurantRepository repository; Restaurant({ required this.repository, }) { paginate(); } // 초기 상태는 Loading 상태로 @override CursorPaginationBase build() { return CursorPaginationLoading(); } paginate() async { final response = await repository.paginate(); state = response; } } 코드 제너레이션은 잘 되는데, 문제는 이를 실행시키려고 하니 다음과 같은 에러가 뜹니다. Launching lib/main.dart on iPhone 14 Pro Max in debug mode... main.dart:1 Xcode build done. 3.9s Failed to build iOS app Error (Xcode): lib/restaurant/provider/restaurant_provider.g.dart:15:3: Error: The argument type 'Restaurant Function({RestaurantRepository repository})' can't be assigned to the parameter type 'Restaurant Function()' because 'Restaurant Function({RestaurantRepository repository})' is nullable and 'Restaurant Function()' isn't. restaurant_provider.g.dart:15 Could not build the application for the simulator. Error launching application on iPhone 14 Pro Max. Exited 이전까지는 잘 됐었는데, 바로 직전 강의에서 CursorPaginationBase를 만들고, 이를 상속받는 CursorPagination 상태들을 구현하고 나서부터, 문제가 발생한 것 같습니다. 아마 CursorPagination의 경우는 data와 meta라는 필드가 들어가는데, 어디선가 Code generation에 문제가 생겨서, CursorPaginationBase가 아닌, data와 Meta를 필요로 하는 생성자가 호출된 건 아닌가 의심하는 중입니다. 아래는 위 코드로 생성된 .g.dart 파일입니다. // GENERATED CODE - DO NOT MODIFY BY HAND part of 'restaurant_provider.dart'; // ************************************************************************** // RiverpodGenerator // ************************************************************************** String _$restaurantHash() => r'50915edab0a63433f5d54b932240cf504147e391'; /// See also [Restaurant]. @ProviderFor(Restaurant) final restaurantProvider = NotifierProvider<Restaurant, CursorPaginationBase>.internal( Restaurant.new, name: r'restaurantProvider', debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') ? null : _$restaurantHash, dependencies: null, allTransitiveDependencies: null, ); typedef _$Restaurant = Notifier<CursorPaginationBase>; // ignore_for_file: unnecessary_raw_strings, subtype_of_sealed_class, invalid_use_of_internal_member, do_not_use_environment, prefer_const_constructors, public_member_api_docs, avoid_private_typedef_functions 어떻게 하면 Code Generator를 이용해서 문제를 해결할 수 있을까요?
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 코드팩토리 디스코드 https://bit.ly/3HzRzUM Flutter 강의를 구매하시면 코드팩토리 디스코드 서버 플러터 프리미엄 채널에 들어오실 수 있습니다! 디스코드 서버에 들어오시고 저에게 메세지로 강의를 구매하신 이메일을 보내주시면 프리미엄 채널에 등록해드려요! 프리미엄 채널에 들어오시면 모든 질의응답 최우선으로 답변해드립니다! video영상을 choose하면 compressing video를 거치고 메인으로 돌아가버려요 뭐가 문제일까요?
128줄에 return inside에서 inside()를 안하는 이유가 궁금합니다 @higher_order_example 자체가 inside 리턴받은 함수를 자동으로 ()붙여서 실행해주는 것인가요? 136줄에 sample_example()을 안쓰면 121줄에 있는 func 매개변수로 못넣는것인가요???
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 코드팩토리 디스코드 https://bit.ly/3HzRzUM Flutter 강의를 구매하시면 코드팩토리 디스코드 서버 플러터 프리미엄 채널에 들어오실 수 있습니다! 디스코드 서버에 들어오시고 저에게 메세지로 강의를 구매하신 이메일을 보내주시면 프리미엄 채널에 등록해드려요! 프리미엄 채널에 들어오시면 모든 질의응답 최우선으로 답변해드립니다! 강의대로 따라해도,최신버전을 넣어도 Pub get 에러가 계속생기는데 다른 설정을 따로 해야하나요? 윈도우10 사용중입니다
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
안녕하세요 강사님, 구글지도 사용해보기 수업을 듣는데 지도가 나타나지 않아 질문드립니다. PlatformView, registerViewFactory가 호출되었는지 확인하라는 메세지로 파악했으나 해결 방법을 찾지 못하고 있습니다. 에러 메세지는 아래와 같습니다. [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(unregistered_view_type, A UIKitView widget is trying to create a PlatformView with an unregistered type: < plugins.flutter.io/google_maps >, If you are the author of the PlatformView, make sure registerViewFactory is invoked. See: https://docs.flutter.dev/development/platform-integration/platform-views#on-the-platform-side-1 for more details. If you are not the author of the PlatformView, make sure to call GeneratedPluginRegistrant.register ., null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18) <asynchronous suspension> #2 PlatformViewsService.initUiKitView (package:flutter/src/services/platform_views.dart:242:5) <asynchronous suspension> #3 UiKitViewState. createNewUiKitView (package:flutter/src/widgets/platform_view.dart:649:44) <asynchronous suspension>
[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 코드팩토리 디스코드 https://bit.ly/3HzRzUM Flutter 강의를 구매하시면 코드팩토리 디스코드 서버 플러터 프리미엄 채널에 들어오실 수 있습니다! 디스코드 서버에 들어오시고 저에게 메세지로 강의를 구매하신 이메일을 보내주시면 프리미엄 채널에 등록해드려요! 프리미엄 채널에 들어오시면 모든 질의응답 최우선으로 답변해드립니다! 강의에 나온대로 resolveWith를 사용해서 실행했는데 버튼을 눌러도 계속 빨강색으로 뜨고 하얀색으로 바뀌질 않아요. 뭐가 문제인걸까요?ㅠㅠ