inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

웹뷰 내에서 스크롤이 안돼요

미해결

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

flutter_webview 강의에서 ios 애뮬레이터에서 웹뷰를 띄운 뒤 화면 안에서 스크롤이 안됩니다!! 코드는 강의와 동일하구요

  • flutter
  • 클론코딩
lsg 댓글 2 좋아요 0 조회수 488

ios 이미지 전송 질문

미해결

[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!

Future<void> uploadFile() async { // file picker를 통해 파일 선택 final filePath = _image!.path; // 파일 경로를 통해 formData 생성 var dio = Dio(); var formData = FormData.fromMap({ 'file' : await MultipartFile.fromFile(filePath!) }); dio.options.contentType = 'multipart/form-data'; dio.options.maxRedirects.isFinite; final token = await ref.read(secureStorageProvider).read(key:ACCESS_TOKEN_KEY); dio.options.headers.addAll({ 'authorization': 'bearer $token', }); print("ok"); // 업로드 요청 final response = await dio.post("http://$ip/s3/upload", data: formData); _downloadUrl = response.data; print(response.statusCode.toString() + "hihi"); } 이미지 업로드 코드로 위 코드를 사용하고있는데 안드로이드 애뮬레이터에서는 전송이 잘 되지만 ios에서 해당 코드를 실행하면 [ERROR:flutter/runtime/dart_vm _initializer.c c(41)] Unhandled Exception: DioError [DioErrorType.response]: Http status error [401] 계속 위와 같은 에러가 뜹니다 구글에 검색해도 잘 안나와서 질문드립니다.

  • flutter
  • 하이브리드-앱
dlckdals9467 댓글 2 좋아요 0 조회수 239

IconButton 위치(정렬??) 질문

미해결

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

안녕하세요. 질문이 있어서 글올립니다. 8강 web_view까지 봤는데요, appBar에서 actions하위 IconButton home icon위치를 우측에서 좌측으로 변경하고 싶습니다. 방법이 있을까요??? IconButton에 alignment속성이 있어서 추가해줘봤는데 어떤 값을 지정해도 우측에만 나오더라구요 ㅠㅠ return Scaffold( appBar: AppBar( title: Text('Wonsun'), backgroundColo r: Colors. ora nge , centerTitle: true, actions: [ IconButton( alignment: Alignment. topLeft , onPressed: () { controller.loadRequest(homeUrl); }, icon: const Icon( Icons. home , color: Colors. white , )) ], ), body: WebViewWidget( controller: controller, ), );

  • flutter
  • 클론코딩
heart_rose 댓글 2 좋아요 0 조회수 703

커스텀 위젯 변수 선언 위치 차이

미해결

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

StatelessWidget이나 StatefulWidget에서 변수를 선언할 때 빌드 함수 내에 선언하는 것과 빌드 함수 밖에 선언하는 것은 어떤 차이가 있나요?

  • flutter
  • 클론코딩
장우준 댓글 1 좋아요 0 조회수 213

변수 선언 위치

미해결

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

웹뷰 앱 만드는 부분 진행중입니다. HomeScreen 클래스 안에 homeUrl을 선언하면, ..loadRequest(homeurl) 부분에 인스턴스 멤버는 생성자?(initializer)안에 can't be accessed 라고 오류가 뜨는데, chatgpt랑 계속 대답을 주고 받았는데 제가 이해를 못해서 그런건지 안 와닿아서요.. HomeScreen 위젯을 생성할 때, 위에서부터 코드가 실행되니까 homeUrl이 먼저 초기화되서 될 것 같은데 왜 오류가 나나요? ㅠㅠ

  • flutter
  • 클론코딩
Lee 댓글 2 좋아요 0 조회수 243

뷰모델 생성자로 리스트 불러오

미해결

Flutter 중급 2편 - 실전 앱 개발 - 미국 주식 앱 (with 클린 아키텍처)

class StoreViewModel with ChangeNotifier { String? regionName = ''; String barName = '지역별 서점'; bool isLoading = false; final StoreRepository repository; StoreViewModel(this.repository) { print('생성자호출'); _loadSimpleStores(); print(stores); } List<SimpleStore> stores = []; void onEvent(StoreEvent event, BuildContext context) { event.when(touchTile: (id) async { StoreInfo store = await repository.getStoreInfo(id); Navigator.push( context, MaterialPageRoute( builder: (context) => StoreDetailScreen(storeDetail: store)), ); }, searchStore: (query) async { }); } //지역 전체 Future<void> _loadSimpleStores() async { isLoading = true; notifyListeners(); stores = await repository.getStores(); isLoading = false; notifyListeners(); } } --------------------------------------------- class StoreViewScreen extends StatefulWidget { StoreViewScreen({ super.key, this.barName, this.regionName, }); String? barName; String? regionName; @override State<StoreViewScreen> createState() => _StoreViewScreenState(); } class _StoreViewScreenState extends State<StoreViewScreen> { TextEditingController _controller = TextEditingController(); @override Widget build(BuildContext context) { final customerInfoViewModel = context.watch<CustomerInfoViewModel>(); final storeViewModel = context.watch<StoreViewModel>(); return Scaffold( appBar: AppBar( centerTitle: true, title: Text( storeViewModel.barName, style: TextStyle( fontWeight: FontWeight.bold, ), ), leading: IconButton( onPressed: () { Navigator.pop(context); }, icon: Icon(Icons.close), ), ), body: Column(children: [ //입력창 + 검색창 Container( child: Row( children: [ Expanded( child: Container( decoration: BoxDecoration( border: Border.all(color: Colors.grey), // 테두리 색상 설정 borderRadius: BorderRadius.circular(8.0), // 테두리 둥글기 설정 ), child: TextField( controller: _controller, decoration: InputDecoration( hintText: '텍스트를 입력하세요.', // 힌트 텍스트 contentPadding: EdgeInsets.all(12.0), // 텍스트 입력 필드 내부의 여백 설정 border: InputBorder.none, // 기본 테두리 제거 ), ), ), ), TextButton(onPressed: () {}, child: Text('검색')) ], ), ), //지역 이름 or 내주변 Container( child: Row( children: [ Text( storeViewModel.regionName ?? '내 주변', style: TextStyle( fontSize: customerInfoViewModel.screenHeight / 20, fontWeight: FontWeight.bold), ), Text( '${storeViewModel.stores.length}가 검색 됨', style: TextStyle( fontSize: customerInfoViewModel.screenWidth / 20, fontWeight: FontWeight.bold), ), ], )), //서점 리스트 표시 Expanded( child: Container( child: !storeViewModel.isLoading ? ListView.builder( itemCount: storeViewModel.stores.length, itemBuilder: (BuildContext context, int index) { return GestureDetector( child: StoreSimpleInfo( id: storeViewModel.stores[index].id, profileUrl: storeViewModel.stores[index].imageUrl, storeName: storeViewModel.stores[index].name, storeAddr: storeViewModel.stores[index].address, category: storeViewModel.stores[index].category), onTap: () { storeViewModel.onEvent( StoreEvent.touchTile( storeViewModel.stores[index].id, ), context, ); }, ); }, ) : CircularProgressIndicator(), ), ), ]), ); } } 스크린을 열면 viewmodel 생성자로 리스트를 불러오고 싶은데 viewmodel 생성자가 작동을 안합니다 이유가 뭘까요 ㅠㅠ? 의존성주입 문제는 아닌것같아요

  • flutter
  • ios
  • android
댓글 1 좋아요 0 조회수 244

비디오 플레이어 만들기에서요

미해결

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

비디오 플레이어 만들기에서요 Setstate를 쓰지 않고요!!! 멈추고 시작하는 부분에서 시작중인가 그럼 멈춰라 멈추었나 그럼 시작해라. 이런 코드를 넣잖아요 그래서 아이콘이 바뀌지는 않지만!! 누르면 멈추고 실행이 동작은 되는데 왜 Setstate를 넣지 않으면 아이콘이 바뀌지않는건 당연하다 생각하는데. 멈추고 실행하는 동작도 안되야 하지 않나 싶어서요 이런 동작을 안할 거 같은데 말이죠…,,

  • flutter
유하 댓글 1 좋아요 0 조회수 223

전체 크기를 차지하게 할 때

미해결

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

double.infinity를 써야 할지 MediaQuery. of (context).size.width를 써야 할지 헷갈리는데 어떤 걸 써야 하나요?

  • flutter
  • 클론코딩
장우준 댓글 1 좋아요 0 조회수 189

.g 파일이 안생기네요

해결됨

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

flutter pub run build_runner build 터미널에서 실행 터미널창 내용 PS E:\_flutter\section24_calendar> flutter pub run build_runner build Deprecated. Use `dart run` instead. Building package executable... (6.4s) Built build_runner:build_runner. [INFO] Generating build script completed, took 352ms [INFO] Precompiling build script... completed, took 7.4s [INFO] Building new asset graph completed, took 994ms [INFO] Checking for unexpected pre-existing outputs. completed, took 1ms [INFO] Generating SDK summary completed, took 4.2s [WARNING] drift_dev on lib/database/drift_database.dart: Could not resolve Dart library package:section24_calendar/database/drift_database.dart This builder requires Dart inputs without syntax errors. However, package:section24_calendar/database/drift_database.dart (or an existing part) contains the following errors. drift_database.dart:24:1: A function body must be provided. Try fixing the errors and re-running the build. [WARNING] drift_dev on lib/database/drift_database.dart: Could not resolve Dart library package:section24_calendar/database/drift_database.dart This builder requires Dart inputs without syntax errors. However, package:section24_calendar/database/drift_database.dart (or an existing part) contains the following errors. drift_database.dart:24:1: A function body must be provided. Try fixing the errors and re-running the build. [INFO] Running build completed, took 14.4s [INFO] Caching finalized dependency graph completed, took 75ms [INFO] Succeeded after 14.5s with 68 outputs (158 actions) PS E:\_flutter\section24_calendar> [INFO] Succeeded after 14.5s with 68 outputs (158 actions) 라고 68개 생긴다고 나오는데 마우스 우클릭 해도 파일은 안생김 검색해보니 flutter pub add --dev drift_dev flutter pub run build_runner clean flutter pub run build_runner build --delete-conflicting-outputs 각각 해봐도 안생기네요 flutter pub add --dev drift_dev 해봄 PS E:\_flutter\section24_calendar> flutter pub add --dev drift_dev "drift_dev" is already in "dev_dependencies". Will try to update the constraint. Resolving dependencies... _fe_analyzer_shared 64.0.0 (67.0.0 available) analyzer 6.2.0 (6.4.1 available) ffi 2.1.0 (2.1.2 available) flutter_lints 2.0.3 (3.0.1 available) intl 0.18.1 (0.19.0 available) js 0.6.7 (0.7.0 available) lints 2.1.1 (3.0.0 available) matcher 0.12.16 (0.12.16+1 available) material_color_utilities 0.5.0 (0.8.0 available) meta 1.10.0 (1.12.0 available) ! path 1.9.0 (overridden) test_api 0.6.1 (0.7.0 available) web 0.3.0 (0.4.2 available) web_socket_channel 2.4.0 (2.4.3 available) Got dependencies! 13 packages have newer versions incompatible with dependency constraints. Try `flutter pub outdated` for more information. PS E:\_flutter\section24_calendar> flutter pub run build_runner clean 해봄 PS E:\_flutter\section24_calendar> flutter pub run build_runner clean Deprecated. Use `dart run` instead. Building package executable... (6.3s) Built build_runner:build_runner. [WARNING] Deleting cache and generated source files. This shouldn't be necessary for most applications, unless you have made intentional edits to generated files (i.e. for testing). Consider filing a bug at https://github.com /dart-lang/build/issues/new if you are using this to work around an apparent (and reproducible) bug. [WARNING] No asset graph found. Skipping cleanup of generated files in source directories. [INFO] Cleaning up source outputs completed, took 1ms [INFO] Cleaning up cache directory completed, took 37ms PS E:\_flutter\section24_calendar> flutter pub run build_runner build --delete-conflicting-outputs 해봄 PS E:\_flutter\section24_calendar> flutter pub run build_runner build --delete-conflicting-outputs Deprecated. Use `dart run` instead. [INFO] Generating build script completed, took 335ms [INFO] Reading cached asset graph completed, took 100ms [INFO] Checking for updates since last build completed, took 911ms [INFO] Running build completed, took 17ms [INFO] Caching finalized dependency graph completed, took 78ms [INFO] Succeeded after 102ms with 0 outputs (0 actions) PS E:\_flutter\section24_calendar> 어찌 해야 조을까요

  • flutter
  • 클론코딩
cdway 댓글 2 좋아요 0 조회수 985

button과 checkbox 조건문과 함수

해결됨

5분빨리 퇴근하자! 파이썬 데이터 분석, 시각화, 웹 대시보드 제작하기

버튼과 체크박스 모두 조건문을 사용할 때는 바로 아래에 텍스트가 출력되는데, 함수를 사용하면 대시보드 맨 위에 텍스트가 호출되는 것은 왜 그런건가요?(맨 위에 텍스트가 호출되어 출력된 부분이 전부 다 한 칸 씩 밀리게 됨)

  • python
  • pandas
  • seaborn
  • plotly
  • matplotlib
  • data-visualization
  • streamlit
TEW_교육관리자 댓글 1 좋아요 0 조회수 329

riverpod 2 (async) notifier 사용?

미해결

[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!

https://riverpod.dev/ko/docs/migration/from_state_notifier riverpod 2 공식문서에 보면 Notifier/ AsyncNotifer 가 새롭게 도입되면서 StateNotifier는 더이상 사용되지 않는다고 나오는데 새로운 방식 강의 업데이트 안 해주시나요...?

  • flutter
  • 하이브리드-앱
DSC HUFS 댓글 1 좋아요 0 조회수 359

remote data source impl

해결됨

Flutter 중급 3편 - 의존성 주입 가이드

안녕하세요. 강의 잘 보고 있습니다. remote data source impl 관련해서 질문이 있습니다. @prod @Singleton(as: CommunityRemoteDataSource) class CommunityRemoteDataSourceApiImpl implements CommunityRemoteDataSource { final _dio = Session().dio; @override Future<CommunityResponseDTO> fetchCommunities() async { Response<dynamic> response = await _dio.get('get/community/path'); final responseDto = CommunityResponseDTO.fromJson(response.data); return responseDto; } } CommunityRemoteDataSource 의 구현체 CommunityRemoteDataSourceApiImpl 를 만들어서 사용중입니다. ApiImpl 은 실제 서버와 통신중 이며, http 라이브러리 Dio를 사용하고 있습니다. 여기서 테스트를 위해 DioMock 객체를 만들어서 사용하고자 합니다. 원래 CommunityRemoteDataSourceApiImpl 에 final _dio = Session().dio; 로 싱글턴으로 dio를 내부에 객체를 생성하고 있는데 이거를 주입받는 식으로 변경하여 테스트 시만 CommunityRemoteDataSourceApiImpl(DioMock()) 을 넣는 것인지, 아니면 CommunityRemoteDataSourceApiMockImpl 를 새로 또 만드는지 궁금합니다. 만약 CommunityRemoteDataSourceApiImpl(DioMock()) 로 주입을 받는 식이라면 Response<dynamic> response = await _dio.get('get/community/path'); final responseDto = CommunityResponseDTO.fromJson(response.data); 해당 코드들이 Dio() 일 때, DioMock() 일 때 달라야 할 것 같은데 어떻게 처리하는 것이 맞는지 궁금합니다. 감사합니다.

  • flutter
  • mvvm
  • provider
  • 클린-아키텍처
  • dependency
김보겸 댓글 1 좋아요 0 조회수 291

댓글 입력 후 FeedCardWidget의 FeedCcount 업데이트 관련

해결됨

Flutter로 SNS 앱 만들기

안녕하세요 댓글 입력 후 메인 화면 코멘트카운트가 업데이트 되지 않고 있습니다. CommentScreen에 callback 멤버 추가해서 하면 될것 같은데. 잘안되네요.. 도움 부탁드리겠습니다.

  • flutter
  • android
  • firebase
  • dart
이주한 댓글 1 좋아요 0 조회수 308

플러터 다트 질문

미해결

처음하는 플러터(Flutter) 기초부터 실전까지 [풀스택 Part4] (쉽고 견고하게 단계별로 다양한 프로젝트까지)

플러터 강의를 들으려고 하는데 로드맵대로 하지않고 바로 플러터를 들어도되나요? 플러터만 익히고싶고 파이썬부터 듣고싶진않아서요

  • flutter
  • dart
  • frontend
lkckss123 댓글 1 좋아요 0 조회수 319

freezed JsonKey 사용 예시 공유

미해결

Flutter 중급 1편 - 클린 아키텍처

import 'package:freezed_annotation/freezed_annotation.dart'; part 'photo.freezed.dart'; part 'photo.g.dart'; @freezed class Photo with _$Photo { factory Photo({ required int id, required String tags, @JsonKey(name: 'previewURL') required String previewUrl, }) = _Photo; factory Photo.fromJson(Map<String, dynamic> json) => _$PhotoFromJson(json); }

  • flutter
  • ios
  • android
izar_dero 댓글 1 좋아요 1 조회수 804

파이썬에서의 재귀

해결됨

코딩테스트 [ ALL IN ONE ]

글에 두서가 없어도 양해 바랍니다 이 수업 수강 이전에 코딩 문제를 풀 때 파이썬으로 재귀함수를 사용했던 적이 있습니다. 그때 알게 된것이 파이썬의 재귀함수에는 기본적으로 깊이의 제한이 있다는 것입니다. sys.recursionlimit()으로 확인해보니 재귀호출을 1000이상 못하도록 값이 제한되어 있고 이 값을 늘려서 사용하는것은 별로 추천되는 방법이 아닌걸로 알고 있습니다. C언어 사용할때에는 속도면에서 제한도 없고 파이썬보다 속도도 월등하다보니 재귀를 자주 사용했었는데 파이썬에서 재귀함수로 풀어야 하는 경우가 있을까요?

  • python
  • 코딩-테스트
  • 알고리즘
댓글 2 좋아요 1 조회수 361

변수를 받는것은 상태변경이랑 상관이 없는건가요?

해결됨

[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!

8:22 에 Calendar를 스테이트풀에서 스테이트리스로 변경하시는데요. selectedDay, focusedDay등의 변수를 외부에서 받는데 이건 위젯 상태관리에 포함 되지 않는건가요?

  • flutter
  • 클론코딩
jihuniglong 댓글 2 좋아요 0 조회수 241

아이폰에서 APP 실행 안되는 현상

미해결

Flutter 중급 1편 - 클린 아키텍처

안녕하세요. 맥북에서 Android Studio와 아이폰간에 USB 케이블을 연결하여 앱 실행을 하면 아이폰에 Flutter APP 아이콘이 생깁니다. 그리고 USB 케이블이 연결된 상태에서는 화면이 활성화되어 있을 때에는 앱 실행이 잘 됩니다. 그런데 USB 케이블을 제거하고 APP을 실행하면 실행이 안됩니다. 이 문제를 해결하려면 어떤 조치를 해야 할까요?

  • flutter
  • ios
  • android
Link 댓글 1 좋아요 0 조회수 680

annot 수치 표현

해결됨

5분빨리 퇴근하자! 파이썬 데이터 분석, 시각화, 웹 대시보드 제작하기

age_bin_list = np.arange(10, 80, 10) df['age_bin'] = pd.cut(df['age'], bins = age_bin_list) pivot_df = df.pivot_table( index = 'age_bin', columns = 'region', values = 'charges', aggfunc = 'median' # 각 구간에 해당하는 값을 중간값을 사용하겠다. ) pivot_df # 각각의 값들에 대해 크기를 가늠할 수 있게끔 시각화(주로 색상)하는 방법 # 2D 형식으로 준비된 데이터를 Seaborn heatmap으로 시각화 # annot 인자를 통해 각 셀의 값 표현 가능 fig, ax = plt.subplots() sns.heatmap(pivot_df, ax = ax, annot = True) 코드 똑같이 따라했는데 왜 저는 표에 수치가 다 표현이 안되는 건가요?

  • python
  • pandas
  • seaborn
  • plotly
  • matplotlib
  • data-visualization
  • streamlit
TEW_교육관리자 댓글 1 좋아요 0 조회수 362

인기 태그

인프런 TOP Writers

주간 인기글