import 'package:flutter/material.dart';
class ProductDetailScreen extends StatefulWidget {
const ProductDetailScreen({super.key});
@override
State<ProductDetailScreen> createState() => _ProductDetailScreenState();
}
class _ProductDetailScreenState extends State<ProductDetailScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("패캠 제품 상세"),
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 320,
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.orange,
),
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(color: Colors.red),
padding: EdgeInsets.symmetric(
horizontal: 24,
vertical: 12,
),
child: Text(
"할인 중",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
)
],
),
),
),
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"플러터 물건",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 24),
),
PopupMenuButton(
itemBuilder: (context) {
return [
PopupMenuItem(
child: Text("리뷰등록"),
),
];
},
),
],
),
Text("제품 상세 정보"),
Text("상세상세"),
Row(
children: [
Text(
"10000원",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
Spacer(),
Icon(
Icons.star,
color: Colors.orange,
),
Text("4.5"),
],
)
],
),
),
DefaultTabController(
length: 2,
child: Column(
children: [
TabBar(
tabs: [
Tab(
text: "제품 상세",
),
Tab(
text: "리뷰",
),
],
),
Container(
height: 500,
child: TabBarView(
children: [
Container(
child: Text("제품 상세"),
),
Container(
child: Text("리뷰"),
),
],
),
)
],
),
),
],
),
),
)
],
),
);
}
}

다음과 같이 나온다.
Expanded로 Scroll을 감싸준다.
'Flutter' 카테고리의 다른 글
| firebase - 배달앱(10) 회원가입 기능 구현 (0) | 2024.07.14 |
|---|---|
| firebase - 배달앱(9) 라우터 구현 & 데이터 모델 구현 (0) | 2024.07.14 |
| firebase - 배달앱(5) 제품 등록 화면 구현 기초 (0) | 2024.07.07 |
| firebase - 배달앱(4) 홈화면, 사장님 화면 기초 구성 (0) | 2024.07.07 |
| firebase - 배달앱(3) 회원가입 화면 (0) | 2024.07.07 |