커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
movie review 과제중 오류
[왕초보] 플러터(Flutter)로 시작하는 앱개발 종합반 v0
0주차
북마크
조*리
댓글
3
추천
0
조회수
12
조회수
12
답변 완료
스파르타 즉문즉답

안녕하세요 movie review 과제중 body에 검색창 밑 영화이미지 리스트를 넣으려고 하는 중입니다.


body에 column의 children으로 padding 다음에 listview.builder를 넣고싶은 데 이렇게 하면 안되는 건가요?



import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}


class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);


  @overrideWidget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: HomePage(), // 홈페이지 보여주기
    );
  }
}


class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);


  @overrideWidget build(BuildContext context) {
    // 음식 사진 데이터List<Map<String, dynamic>> dataList = [
      {
        "category": "탑건: 매버릭",
        "imgUrl": "https://i.ibb.co/sR32PN3/topgun.jpg",
      },
      {
        "category": "마녀2",
        "imgUrl": "https://i.ibb.co/CKMrv91/The-Witch.jpg",
      },
      {
        "category": "범죄도시2",
        "imgUrl": "https://i.ibb.co/2czdVdm/The-Outlaws.jpg",
      },
      {
        "category": "헤어질 결심",
        "imgUrl": "https://i.ibb.co/gM394CV/Decision-to-Leave.jpg",
      },
      {
        "category": "브로커",
        "imgUrl": "https://i.ibb.co/MSy1XNB/broker.jpg",
      },
      {
        "category": "문폴",
        "imgUrl": "https://i.ibb.co/4JYHHtc/Moonfall.jpg",
      },
    ];


    // 화면에 보이는 영역return Scaffold(appBar: AppBar(
          elevation: 0,
          centerTitle: false,
          backgroundColor: Colors.white,
          actions: <Widget>[
            IconButton(
              icon: Icon(
                Icons.perm_identity,
                color: Colors.black,
              ),
              onPressed: () {},
            )
          ],
          title: Text(
            "Movie Reviews",
            style: TextStyle(
                fontSize: 28, color: Colors.black, fontWeight: FontWeight.bold),
          )),
      body: Column(
        children: [
          Padding(
            padding: const EdgeInsets.all(8.0),
            child: TextField(
              decoration: InputDecoration(
                enabledBorder: OutlineInputBorder(
                  borderSide: BorderSide(
                      color: Color.fromARGB(255, 176, 174, 174), width: 1.0),
                ),
                labelText: ' 영화 제목을 검색해주세요.',
                suffixIcon: Icon(Icons.search),
              ),),),],),
          ListView.builder(itemCount: 6,itemBuilder: (BuildContext context, int (context, index) {return postContainer(););

Too many positional arguments: 0 expected, but 1 found.

Try removing the extra positional arguments, or specifying the name for named arguments.


The argument type 'Type' can't be assigned to the parameter type 'Widget? Function(BuildContext, int)'.

취소
 공유
취소
댓글 0
댓글 알림
나의얼굴