커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
GridView 사용법 문의2
[왕초보] 플러터(Flutter)로 시작하는 앱개발 종합반 v0
2주차
북마크
진*만
댓글
8
추천
0
조회수
7
조회수
7
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


- GridView 사용법 문의2

안녕하세요? 숙제 - Shazam 클론 코딩을 소스 코딩해서 올리니깐 VS Coding에서

문제없이 나오는데 Dart Pad에서 에러가 납니다.

확인 부탁 드립니다.

감사합니다.

---------------------------------------------------------------------------------------------------


  1. 현상

■■■ [/main.dart] [main()] ==> [T_01] [Project Start] ■■■

■■■ [/MyApp.C] [build()] ==> [T_01] [MyApp Start]

■■■ [/HomePage.C] [build()] ==> [T_01] [HomePage Start] ■

■■■ [/HomePage.C] [build()] ==> [T_01] [라이브러리 Icon 클릭 이벤트]

■■■ [/HomePage.C] [build()] ==> [T_02] [라이브러리 Icon 클릭 이벤트]

■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [라이브러리] ■

══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════

The following assertion was thrown during layout:

A RenderFlex overflowed by 26 pixels on the bottom.


Widget creation tracking is currently disabled. Enabling it enables improved error messages. It can

be enabled by passing `--track-widget-creation` to `flutter run` or `flutter test`.


The overflowing RenderFlex has an orientation of Axis.vertical.

The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and

black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the

RenderFlex to fit within the available space instead of being sized to their natural size.

This is considered an error condition because it indicates that there is content that cannot be

seen. If the content is legitimately bigger than the available space, consider clipping it with a

ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex,

like a ListView.

The specific RenderFlex in question is: RenderFlex#b8742 relayoutBoundary=up2 OVERFLOWING:

 needs compositing

 creator: Column ← Padding ← KeyedSubtree-[GlobalKey#50b16] ← _BodyBuilder ← MediaQuery ←

  LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ← _ActionsScope ← Actions ←

  AnimatedBuilder ← DefaultTextStyle ← AnimatedDefaultTextStyle ← ⋯

 parentData: offset=Offset(10.0, 10.0) (can use size)

 constraints: BoxConstraints(0.0<=w<=593.0, 0.0<=h<=544.0)

 size: Size(593.0, 544.0)

 direction: vertical

 mainAxisAlignment: start

 mainAxisSize: max

 crossAxisAlignment: start

 textDirection: ltr

 verticalDirection: down

◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤

════════════════════════════════════════════════════════════════════════════════════════════════════

Another exception was thrown: [object ProgressEvent]

■■■ [/HomePage.C] [build()] ==> [T_01] [챠트 Icon 클릭 이벤트]

■■■ [/HomePage.C] [build()] ==> [T_02] [챠트 Icon 클릭 이벤트]

■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [차트] ■

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 29 pixels on the bottom.

■■■ [/HomePage.C] [build()] ==> [T_01] [챠트 Icon 클릭 이벤트]

■■■ [/HomePage.C] [build()] ==> [T_02] [챠트 Icon 클릭 이벤트]

■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [차트] ■

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 29 pixels on the bottom.

■■■ [/HomePage.C] [build()] ==> [T_01] [라이브러리 Icon 클릭 이벤트]

■■■ [/HomePage.C] [build()] ==> [T_02] [라이브러리 Icon 클릭 이벤트]

■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [라이브러리] ■

Another exception was thrown: A RenderFlex overflowed by 26 pixels on the bottom.

Another exception was thrown: A RenderFlex overflowed by 8.0 pixels on the right.

■■■ [/HomePage.C] [build()] ==> [T_01] [챠트 Icon 클릭 이벤트]

■■■ [/HomePage.C] [build()] ==> [T_02] [챠트 Icon 클릭 이벤트]

■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [차트] ■

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 33 pixels on the right.

Another exception was thrown: A RenderFlex overflowed by 29 pixels on the bottom.

■■■ [/HomePage.C] [build()] ==> [T_01] [라이브러리 Icon 클릭 이벤트]

■■■ [/HomePage.C] [build()] ==> [T_02] [라이브러리 Icon 클릭 이벤트]

■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [라이브러리] ■

Another exception was thrown: A RenderFlex overflowed by 26 pixels on the bottom.


---------------------------------------------------------------------------------------------------




스파르타 즉문즉답스파르타 즉문즉답



import 'package:flutter/material.dart';

import 'package:flutter/cupertino.dart';


void main() {

 debugPrint("■■■ [/main.dart] [main()] ==> [T_01] [Project Start] ■■■");


 runApp(const MyApp()); // MyApp class 호출

}


class MyApp extends StatelessWidget {

 const MyApp({super.key});


 @override

 Widget build(BuildContext context) {

  debugPrint("■■■ [/MyApp.C] [build()] ==> [T_01] [MyApp Start]");


  return MaterialApp(

   home: HomePage(), // HomePage class 호출

  );

 }

}


/**

 * @description ThirdPage class(3 번째 페이지): 메인 화면

*/

class HomePage extends StatelessWidget {

 const HomePage({super.key});


 @override

 Widget build(BuildContext context) {

  debugPrint("■■■ [/HomePage.C] [build()] ==> [T_01] [HomePage Start] ■");


  return Scaffold(

   appBar: AppBar(

    // 01. appBar■ =====================>

    backgroundColor: Color(0xff2C6FC0), // 배경색 설정(노란색)

    centerTitle: true,

    elevation: 0.0,

    leading: Row(

     // 01-1. 앱 바의 왼쪽에 배치에 사용하는 속성

     children: [

      // SizedBox(width: 16), // 위젯 사이에 간격 두기

      Ink(

       decoration: const ShapeDecoration(

        shape: CircleBorder(),

        color: Colors.blue,

       ),

       child: IconButton(

        onPressed: () {

         debugPrint(

           "■■■ [/HomePage.C] [build()] ==> [T_01] [라이브러리 Icon 클릭 이벤트]");


         Navigator.push(

          context,

          MaterialPageRoute(

            builder: (context) => FirstPage()), // 1 번째 페이지로 이동

         );

         debugPrint(

           "■■■ [/HomePage.C] [build()] ==> [T_02] [라이브러리 Icon 클릭 이벤트]");

        },

        icon: const Icon(

         CupertinoIcons.chart_bar_square,

        ),

       ),

      ),

     ],

    ),

    actions: [

     IconButton(

      onPressed: () {

       debugPrint(

         "■■■ [/HomePage.C] [build()] ==> [T_01] [챠트 Icon 클릭 이벤트]");


       Navigator.push(

        context,

        MaterialPageRoute(

          builder: (context) => ThirdPage()), // 3 번째 페이지로 이동

       );

       debugPrint(

         "■■■ [/HomePage.C] [build()] ==> [T_02] [챠트 Icon 클릭 이벤트]");

      },

      icon: const Icon(

       CupertinoIcons.chart_bar_square,

      ),

     ),

     // ),

    ],

    // title: Text('OEN'),

   ), // 01. appBar 위젯■ ==================================>

   body: Padding(

    // 02. body 위젯■ ==================================>

    padding: const EdgeInsets.all(1), // 패딩 설정(전방위 모두 동일하게 적용)


    child: Container(

     width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

     // height: 10,

     color: Color(0xff2C6FC0), // 배경색 설정(노란색)

     child: Column(

      children: [

       SizedBox(

        width: 90,

       ),

       Text(

        // 01. Shazam 알림 Text

        "Shazam하려면 탭 하세요",

        style: TextStyle(

         fontSize: 26,

         fontWeight: FontWeight.bold,

         color: Colors.white,

        ),

       ), // 01. Shazam 알림 Text

       SizedBox(

        height: 15,

       ),

       Padding(

        padding:

          const EdgeInsets.all(32.0), // 이미지 패딩 설정(전방위 모두 동일하게 적용)

        child: Image.network(

         // 02. Shazam 로고 Image

         "https://play-lh.googleusercontent.com/TRYsWE1Fhn-8q1F2m1MQIv_6y3Kx85iBYjZeGNU8gePPu8aLR4ig3AiGSJltXM2Zeb1b=w240-h480-rw", // 이미지 설정

         width: 200,

         height: 200,

        ), // 02. Shazam 로고 Image

       ),

       SizedBox(

        height: 50,

       ),

       Ink(

        decoration: const ShapeDecoration(

         shape: CircleBorder(),

         color: Colors.brown,

        ),

        child: IconButton(

         // 03. 조회 Icon

         onPressed: () {},

         icon: const Icon(

          Icons.search,

          size: 40,

         ), // 03. 조회 Icon

        ),

       ),

      ],

     ),

    ),

   ), // 02. body 위젯■ =====================>

  );

 }

}


/**

 * @description FirstPage class(1 번째 페이지): 라이브러리 화면

*/

class FirstPage extends StatelessWidget {

 const FirstPage({super.key});


 @override

 Widget build(BuildContext context) {

  debugPrint(

    "■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [라이브러리] ■");


  return Scaffold(

   appBar: AppBar(

    // 02. body 위젯■(Row ==> Feed()) =====================>

    backgroundColor: Colors.white,

    centerTitle: true,

    elevation: 0.5, // 앱바 또는 바텀바 등의 위젯에서 음영을 줄 수있는 속성

    title: Text(

     "라이브러리",

     style: TextStyle(

      fontSize: 26,

      fontWeight: FontWeight.bold,

      color: Colors.black,

     ),

    ),

   ),

   body: Padding(

    // 02. body■

    padding: const EdgeInsets.all(10), // 패딩 설정(전방위 모두 동일하게 적용)


    child: Column(

     crossAxisAlignment: CrossAxisAlignment.start,

     children: [

      Container(

       // 01. Shazam Container ■■■

       color: Colors.red, // 배경색 설정(노란색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 40,

       child: Row(

        children: [

         Icon(

          // 01. Shazam Icon

          CupertinoIcons.heart_fill,

          size: 16,

         ), // 01. Shazam Icon

         SizedBox(

          width: 12,

         ),

         Text(

          // 02. Shazam Text

          "Shazam",

          style: TextStyle(

           fontSize: 20,

           fontWeight: FontWeight.bold,

           color: Colors.black,

          ),

          overflow: TextOverflow.ellipsis,

         ), // 02. Shazam Text ■■■

        ],

       ),

      ), // 01. Shazam Container ■■■

      Container(

       // 02. 아티스트 Container ■■■

       color: Color(0xff00FF00), // 배경색 설정(녹색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 40,

       child: Row(

        children: [

         Icon(

          // 01. Shazam Icon

          Icons.man_sharp,

          size: 16,

         ), // 01. Shazam Icon

         SizedBox(

          width: 12,

         ),

         Text(

          // 02. 아티스트 Text

          "아티스트",

          style: TextStyle(

           fontSize: 20,

           fontWeight: FontWeight.bold,

           color: Colors.black,

          ),

          overflow: TextOverflow.ellipsis,

         ), // 02. 아티스트 Text ■■■

        ],

       ),

       // 02. 아티스트 Text ■■■

      ), // 02. 아티스트 Container ■■■

      Container(

       // 03. 회원님을 위한 재생목록 Container ■■■

       color: Colors.blue, // 배경색 설정(진한 파란색색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 40,

       child: Row(

        children: [

         Icon(

          // 01. Shazam Icon

          CupertinoIcons.heart_fill,

          size: 16,

         ), // 01. Shazam Icon

         SizedBox(

          width: 12,

         ),

         Text(

          // 02. 아티스트 Text

          "회원님을 위한 재생목록",

          style: TextStyle(

           fontSize: 20,

           fontWeight: FontWeight.bold,

           color: Colors.black,

          ),

          overflow: TextOverflow.ellipsis,

         ), // 02. 아티스트 Text ■■■

        ],

       ), // 03. 회원님을 위한 재생목록 Text

      ), // 03. 회원님을 위한 재생목록 Container ■■■

      SizedBox(

       width: 12,

       height: 30,

      ),

      Container(

       // 51. 최근 Shazam Text ■■■

       color: Colors.yellow, // 배경색 설정(진한 파란색색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 40,

       child: Text(

        // 03. 회원님을 위한 재생목록 Text

        "최근 Shazam",

        style: TextStyle(

         fontSize: 20,

         fontWeight: FontWeight.bold,

         color: Colors.black,

        ),

        softWrap: false,

        maxLines: 2,

        overflow: TextOverflow.ellipsis,

       ), // 03. 회원님을 위한 재생목록 Text

      ),

      Row(

       children: [

        Container(

         // 51. 최근 Shazam 리스트 Container ■■■

         // color: Color(0xffFF00FF), // 배경색 설정(분홍색)

         padding: const EdgeInsets.all(10.0),

         width: 390,

         height: 380,

         child: GridView.builder(

          // GridView.builder 사용 ■

          itemCount: 4, // 전체 아이템 갯수

          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(

           crossAxisCount: 2, // 1 개의 행에 보여줄 item 개수

           childAspectRatio:

             0.9, // item 의 가로 1, 세로 2 의 비율(width: 290)

           mainAxisSpacing: 10, // 수평 Padding

           crossAxisSpacing: 10, //수직 Padding

          ),

          itemBuilder: (BuildContext context, int index) {

           // item 의 반목문 항목 형성

           return Container(

            // color: Colors.lightGreen,

            child: Row(

             children: [

              Column(

               // crossAxisAlignment: CrossAxisAlignment.start,

               mainAxisAlignment: MainAxisAlignment.start,

               children: [

                ClipRRect(

                 // 정사각형을 동그라미 그리는 속성

                 child: Image.network(

                  // 00. 상품 Image

                  "https://cdn2.thecatapi.com/images/6bt.jpg", // 21. 차트 Image

                  width: 110,

                  height: 110,

                  fit: BoxFit.cover, // 이미지 크기 조절 fit 옵션

                 ), // 21. 차트 Image

                ),

                Text(

                 // 22. 노래 명 Text

                 "가을밤에 든 생각",

                 style: TextStyle(

                  fontSize: 16,

                  color: Colors.black,

                 ),

                 softWrap: false,

                 maxLines: 2,

                 overflow: TextOverflow.ellipsis,

                ), // 22. 노래 명 Text

                Text(

                 // 23. 가수명 Text

                 "산나비",

                 style: TextStyle(

                  fontSize: 16,

                  color: Colors.black,

                 ),

                 softWrap: false,

                 maxLines: 2,

                 overflow: TextOverflow.ellipsis,

                ), // 23. 가수명 Text

               ],

              ),

             ],

            ),

           );

          },

         ),

        ), //51. 최근 Shazam 리스트 Container ■■■

       ],

      ),

     ],

    ),

   ), // 02. body 위젯■ =====================>

  );

 }

}


/**

 * @description ThirdPage class(3 번째 페이지): 차트 화면

*/

class ThirdPage extends StatelessWidget {

 const ThirdPage({super.key});


 @override

 Widget build(BuildContext context) {

  debugPrint(

    "■■■ [/FirstPage.C] [build()] ==> [T_01] [FirstPage Start] [차트] ■");


  return Scaffold(

   appBar: AppBar(

    // 02. body 위젯■(Row ==> Feed()) =====================>

    backgroundColor: Colors.white,

    centerTitle: true,

    elevation: 0.5, // 앱바 또는 바텀바 등의 위젯에서 음영을 줄 수있는 속성

    title: Text(

     "차트",

     style: TextStyle(

      fontSize: 26,

      fontWeight: FontWeight.bold,

      color: Colors.black,

     ),

    ),

   ), // 02. body 위젯■(Row ==> Feed()) =====================>

   body: Padding(

    // 02. body 위젯■ =====================>

    padding: const EdgeInsets.all(0), // 패딩 설정(전방위 모두 동일하게 적용)


    child: Column(

     crossAxisAlignment: CrossAxisAlignment.center,

     // mainAxisAlignment: MainAxisAlignment.center,

     children: [

      Container(

       // 01. Shazam Container ■■■

       color: Color(0xff4A148C), // 배경색 설정(보라색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 60,

       child: Row(

        mainAxisAlignment: MainAxisAlignment.center,

        children: [

         ElevatedButton(

          onPressed: () {},

          child: Text("국가 및 도시별 차트"),

          style: TextButton.styleFrom(

           primary: Color(0xff4A148C),

           backgroundColor: Colors.white, // 배경색 설정(보라색)

          ),

         ),

        ],

       ),

      ), // 01. Shazam Container ■■■

      Container(

       // 02. 아티스트 Container ■■■

       color: Color(0xff4A148C), // 배경색 설정(보라색)

       //color: Color.fromARGB(255, 82, 199, 46), // 배경색 설정(보라색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 70,

       child: Row(

        mainAxisAlignment: MainAxisAlignment.center,

        // crossAxisAlignment: CrossAxisAlignment.center,

        children: [

         Text(

          // 02. 아티스트 Text

          "전 세계",

          style: TextStyle(

           fontSize: 16,

           fontWeight: FontWeight.bold,

           color: Colors.white,

          ),

          overflow: TextOverflow.ellipsis,

         ), // 02. 아티스트 Text ■■■

        ],

       ),

       // 02. 아티스트 Text ■■■

      ), // 02. 아티스트 Container ■■■

      Divider(

       thickness: 10,

       height: 1,

       color: Color(0xffBDBDBD), // 0xff4A148C

      ),

      Container(

       // 51, 대한민국 차트 Container ■■■ ========================>

       //color: Colors.yellow, // 배경색 설정(진한 파란색색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 40,

       child: Row(

        children: [

         Text(

          // 01, 대한민국 차트 Text

          "대한민국 차트",

          style: TextStyle(

           fontSize: 16,

           color: Colors.black,

          ), // 01, 대한민국 차트 Text

          softWrap: false,

          maxLines: 2,

          overflow: TextOverflow.ellipsis,

         ),

         Spacer(), // 11. 빈칸

         Text(

          // 02, 모두 보기 Text

          "모두 보기",

          style: TextStyle(

           fontSize: 16,

           color: Colors.blue,

          ),

          softWrap: false,

          maxLines: 2,

          overflow: TextOverflow.ellipsis,

         ), // 02, 모두 보기 Text

        ],

       ), // 03. 회원님을 위한 재생목록 Text

      ),

      Row(

       children: [

        Container(

         // 51. 최근 Shazam 리스트 Container ■■■

         // color: Color(0xffFF00FF), // 배경색 설정(분홍색)

         padding: const EdgeInsets.all(10.0),

         width: 400,

         // width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

         height: 180,

         child: GridView.builder(

          // GridView.builder 사용 ■

          itemCount: 3, // 전체 아이템 갯수

          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(

           crossAxisCount: 3, // 1 개의 행에 보여줄 item 개수

           childAspectRatio:

             0.8, // item 의 가로 1, 세로 2 의 비율(width: 290)

           mainAxisSpacing: 10, // 수평 Padding

           crossAxisSpacing: 10, //수직 Padding

          ),

          itemBuilder: (BuildContext context, int index) {

           // item 의 반목문 항목 형성

           return Container(

            // color: Colors.lightGreen,

            child: Row(

             children: [

              SingleChildScrollView(

               // scrollDirection: Axis.horizontal,

               scrollDirection: Axis.vertical,

               child: Column(

                // crossAxisAlignment: CrossAxisAlignment.start,

                mainAxisAlignment: MainAxisAlignment.start,

                children: [

                 ClipRRect(

                  // 정사각형을 동그라미 그리는 속성

                  child: Image.network(

                   // 00. 상품 Image

                   "https://cdn2.thecatapi.com/images/6bt.jpg", // 21. 차트 Image

                   width: 110,

                   height: 110,

                   fit: BoxFit.cover, // 이미지 크기 조절 fit 옵션

                  ), // 21. 차트 Image

                 ),

                 Text(

                  // 22. 노래 명 Text

                  "Dynamite",

                  style: TextStyle(

                   fontSize: 16,

                   color: Colors.black,

                  ),

                  softWrap: false,

                  maxLines: 2,

                  overflow: TextOverflow.ellipsis,

                 ), // 22. 노래 명 Text

                 Text(

                  // 23. 가수명 Text

                  "BTS",

                  style: TextStyle(

                   fontSize: 16,

                   color: Colors.black,

                  ),

                  softWrap: false,

                  maxLines: 2,

                  overflow: TextOverflow.ellipsis,

                 ), // 23. 가수명 Text

                ],

               ),

              ),

             ],

            ),

           );

          },

         ),

        ),

       ],

      ),

      SizedBox(

       width: 20,

       height: 10,

      ),

      Divider(

       thickness: 10,

       height: 1,

       color: Color(0xffBDBDBD), // 0xff4A148C

      ),

      Container(

       // 52. 글로벌 차트 Container ■■■ ========================>

       //color: Colors.yellow, // 배경색 설정(진한 파란색색)

       width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

       height: 40,

       child: Row(

        children: [

         Text(

          // 01, 대한민국 차트 Text

          "글로벌 차트",

          style: TextStyle(

           fontSize: 16,

           color: Colors.black,

          ), // 01, 대한민국 차트 Text

          softWrap: false,

          maxLines: 2,

          overflow: TextOverflow.ellipsis,

         ),

         Spacer(), // 11. 빈칸

         Text(

          // 02, 모두 보기 Text

          "모두 보기",

          style: TextStyle(

           fontSize: 16,

           color: Colors.blue,

          ),

          softWrap: false,

          maxLines: 2,

          overflow: TextOverflow.ellipsis,

         ), // 02, 모두 보기 Text

        ],

       ), // 03. 회원님을 위한 재생목록 Text

      ),

      Row(

       children: [

        Container(

         // 51. 최근 Shazam 리스트 Container ■■■

         // color: Color(0xffFF00FF), // 배경색 설정(분홍색)

         padding: const EdgeInsets.all(10.0),

         width: 400,

         // width: double.infinity, // 버튼도 함께 최대 크기로 늘어남

         height: 180,

         child: GridView.builder(

          itemCount: 3, // 전체 아이템 갯수

          gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(

           crossAxisCount: 3, // 1 개의 행에 보여줄 item 개수

           childAspectRatio:

             0.8, // item 의 가로 1, 세로 2 의 비율(width: 290)

           mainAxisSpacing: 10, // 수평 Padding

           crossAxisSpacing: 10, //수직 Padding

          ),

          itemBuilder: (BuildContext context, int index) {

           //item 의 반목문 항목 형성

           return Container(

            // color: Colors.lightGreen,

            child: Row(

             children: [

              SingleChildScrollView(

               // scrollDirection: Axis.horizontal,

               scrollDirection: Axis.vertical,

               child: Column(

                // crossAxisAlignment: CrossAxisAlignment.start,

                mainAxisAlignment: MainAxisAlignment.start,

                children: [

                 ClipRRect(

                  // 정사각형을 동그라미 그리는 속성

                  child: Image.network(

                   // 00. 상품 Image

                   "https://cdn2.thecatapi.com/images/6bt.jpg", // 21. 차트 Image

                   width: 110,

                   height: 110,

                   fit: BoxFit.cover, // 이미지 크기 조절 fit 옵션

                  ), // 21. 차트 Image

                 ),

                 Text(

                  // 22. 노래 명 Text

                  "Dynamite",

                  style: TextStyle(

                   fontSize: 16,

                   color: Colors.black,

                  ),

                  softWrap: false,

                  maxLines: 2,

                  overflow: TextOverflow.ellipsis,

                 ), // 22. 노래 명 Text

                 Text(

                  // 23. 가수명 Text

                  "BTS",

                  style: TextStyle(

                   fontSize: 16,

                   color: Colors.black,

                  ),

                  softWrap: false,

                  maxLines: 2,

                  overflow: TextOverflow.ellipsis,

                 ), // 23. 가수명 Text

                ],

               ),

              ),

             ],

            ),

           );

          },

         ),

        ),

       ],

      ),

      SizedBox(

       width: 20,

       height: 10,

      ),

      Divider(

       thickness: 10,

       height: 1,

       color: Color(0xffBDBDBD), // 0xff4A148C

      ),

     ],

    ),

   ), // 02. body 위젯■ =====================>

  );

 }

}




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