플러터 (2) 썸네일형 리스트형 [Flutter] 외부 image 리소스 추가하고 보여주기 준비물 : 보여줄 이미지 파일 하나! ( png 파일만 됩니다.. jpg 안됨... ) 따로 귀찮으신분은 우리집 강아지 파일을 샘플로 쓰면됨! 1. 신규 프로젝트 생성 프로젝트명 : sample_image_display //플러터는 프로젝트에 대문자 못씀 나머지는 굳이 똑같이 안해도 됨.. 2. 외부이미지 추가 루트 폴더 밑에 assets 라는 폴더를 만든다. ( 폴더명은 임의로 만들어도 됨 ) 거기에 보여줄 이미지 파일을 복사한다. 3. 이미지 폴더 지정 pubspec.yaml 파일을 연다. 주석이 처리되어 있는 이미지 폴더 지정 부분을 찾는다. # assets: # - images/a_dot_burr.jpeg # - images/a_dot_ham.jpeg 주석을 해제 하고, 방금 생성한 폴더를 써준다.. Flutter 복습 - 기본 템플릿 import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return const MaterialApp( home: MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, requi.. 이전 1 다음