
두 가지 질문을 드리겠습니다.
1. 해설 강의까지 들어봤는데요. chartdata를 차트 페이지에 적용시키는 방법에 대해서는 강의를 해주지 않으셔서 혼자 하기가 너무 벅찹니다.
어떻게 적용시키는지 방법을 시연해주시면 감사하겠습니다. (아래 코드의 맨 마지막 부분에 korea, global, newyork 데이터가 있습니다. 그 데이터들을 차트 페이지에 적용시키는 방법이 궁금합니다.)
2. 그리고 3주 ~ 5주 강의 중에 데이터를 AWS 서버와 연동시켜서 CRUD하는 것도 가르쳐주시는지 궁금합니다.
저는 다른 것은 강의 동영상 보고 따라할 수가 있는데 Flutter로 서버와 연동하여 데이터를 CRUD 하는 방법을 모르겠습니다.
Container(
width: double.infinity,
height: 8,
color: Colors.grey[400],
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8),
child: Row(
children: [
Text('대한민국 차트'),
Spacer(),
Text('모두 보기'),
],
),
),
Row(
children: [
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
],
),
Container(
width: double.infinity,
height: 8,
color: Colors.grey[400],
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8),
child: Row(
children: [
Text('대한민국 차트'),
Spacer(),
Text('모두 보기'),
],
),
),
Row(
children: [
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
],
),
Container(
width: double.infinity,
height: 8,
color: Colors.grey[400],
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8),
child: Row(
children: [
Text('대한민국 차트'),
Spacer(),
Text('모두 보기'),
],
),
),
Row(
children: [
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
],
),
Container(
width: double.infinity,
height: 8,
color: Colors.grey[400],
),
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8),
child: Row(
children: [
Text('대한민국 차트'),
Spacer(),
Text('모두 보기'),
],
),
),
Row(
children: [
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
AlbumCard(
imageUrl:
'https://i.ibb.co/xf2HpfG/dynamite.jpg',
name: 'Dynamite',
artist: 'BTS',
),
],
),
],
),
),
),
],
),
),
],
),
SafeArea(
child: Padding(
padding: const EdgeInsets.all(18),
child: Container(
alignment: Alignment.topCenter,
child: TabPageSelector(
color:
_selectedIndex == 1 ? Colors.blue[300] : Colors.grey[400],
selectedColor:
_selectedIndex == 1 ? Colors.white : Colors.blue,
controller: _tabController,
),
),
),
),
],
),
);
}
}
class AlbumCard extends StatelessWidget {
const AlbumCard(
{Key? key,
required this.imageUrl,
required this.name,
required this.artist})
: super(key: key);
final String imageUrl;
final String name;
final String artist;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(
imageUrl,
width: MediaQuery.of(context).size.width * 0.29,
),
Text(
name,
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(artist),
],
),
);
}
}
// 세번째 페이지
class ThirdTab extends StatelessWidget {
const ThirdTab({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
const chartData = {
'korea': [
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
],
'global': [
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
],
'newyork': [
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
{
'imageUrl': 'https://i.ibb.co/xf2HpfG/dynamite.jpg',
'name': 'Dynamite',
'artist': 'BTS',
},
],
};
return Center(child: Text('세번째 페이지'));
}
}
