From 9e1804959ff30c29fc0235511321fe2fa94804ec Mon Sep 17 00:00:00 2001 From: whaeundo <1916388@sookmyung.ac.kr> Date: Sun, 6 Nov 2022 04:33:45 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20#8=20=ED=8C=8C=ED=8B=B0=EC=9B=90=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80(=EA=B8=80=20?= =?UTF-8?q?=EB=AF=B8=EC=9E=91=EC=84=B1=EC=9E=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/Login/login.dart | 1 - lib/Party/party_detail_nonwriterview.dart | 273 ++++++++++++++++++++++ lib/Party/party_detail_writerview.dart | 10 +- 3 files changed, 278 insertions(+), 6 deletions(-) create mode 100644 lib/Party/party_detail_nonwriterview.dart diff --git a/lib/Login/login.dart b/lib/Login/login.dart index dc323e6..9158ac7 100644 --- a/lib/Login/login.dart +++ b/lib/Login/login.dart @@ -34,7 +34,6 @@ class _LoginPageState extends State { // 임시 이동 Navigator.pop(context); - Navigator.push( context, MaterialPageRoute(builder: (context) => tabBarMainPage()), diff --git a/lib/Party/party_detail_nonwriterview.dart b/lib/Party/party_detail_nonwriterview.dart new file mode 100644 index 0000000..fbca357 --- /dev/null +++ b/lib/Party/party_detail_nonwriterview.dart @@ -0,0 +1,273 @@ +import 'package:flutter/material.dart'; + +import '../color.dart'; + +class PartyDetailNonWriterPage extends StatefulWidget { + const PartyDetailNonWriterPage({Key? key}) : super(key: key); + + @override + State createState() => _PartyDetailNonWriterPageState(); +} + +class _PartyDetailNonWriterPageState extends State { + + final List isEnabled = [true, true, true, true, true, true, true, true]; + + final List userName = ["손님1", "손님2", "손님3"]; + final List userPhone = ["010-9999-1234", "010-9999-1234", "010-9999-1234"]; + + String writer = "글쓴이"; + String ottType = "넷플릭스"; + String startDate = "2022-11-05"; + String endDate = "2022-12-31"; + String price = "4,250"; + int maxPeople = 3; + int curPeople = 1; + + void disableElevatedButton(int index) { + //isEnabled[index] = false; + setState(() { + curPeople++; + isEnabled[index] = false; + }); + + if(curPeople == maxPeople){ + showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('모집 완료'), + content: const Text('모집이 완료되었습니다.'), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + Navigator.of(context).pop(); + }, + child: const Text('확인'), + ), + ], + ), + ); + } + } + + // func(int index){ + // print("clicked"); + // disableElevatedButton(index); + // } + + + + @override + Widget build(BuildContext context) { + + return Scaffold( + appBar: AppBar( + title: Text("파티모집", + style:TextStyle( + color:Color(mainColor), + fontWeight: FontWeight.bold, + fontSize: 20 + ) + ), + backgroundColor: Colors.white, + ), + + body: SafeArea( + child: Container( + margin: EdgeInsets.only(left: 22.0, right: 22.0, top: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + + // 글 내용 + Container( + padding: EdgeInsets.all(22.0), + margin: EdgeInsets.only(), + decoration: BoxDecoration( + border: Border.all( + width: 1, + color: Color(mainColor), + ), + borderRadius: BorderRadius.all(Radius.circular(5) + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + child: Text("넷플릭스 파티원 4명 구해요", + style:TextStyle( + fontSize: 16, + color:Color(0xff333333), + fontWeight: FontWeight.bold + ) + ), + ), + + Container( + child: Row( + children: [ + Container( + child: Text( + "${curPeople}/${maxPeople}", + style:TextStyle( + fontSize: 10, + color:Color(0xff666666), + ) + ), + ), + + Container( + child: Icon( + Icons.circle, + size: 9, + color: curPeople == maxPeople? Colors.red : Colors.green, + ), + ) + + ], + ), + ) + ], + ), + + Container( + margin: EdgeInsets.only(top: 5, bottom: 15.0), + child: Text("${writer}", + style:TextStyle( + fontSize: 10, + color:Color(0xff666666), + ) + ), + ) + ], + ) + ), + + // body Container + + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Text("OTT", + style:TextStyle( + fontSize: 12, + color:Color(mainColor), + fontWeight: FontWeight.w700 + ) + ) + ), + + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("사용기간", + style:TextStyle( + fontSize: 12, + color:Color(mainColor), + fontWeight: FontWeight.w700 + ) + ) + ), + + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("희망가격", + style:TextStyle( + fontSize: 12, + color:Color(mainColor), + fontWeight: FontWeight.w700 + ) + ) + ), + + ], + ), + ), + + Container( + margin: EdgeInsets.only(left: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Text("${ottType}", + style:TextStyle( + fontSize: 12, + color:Color(0xff333333), + ) + ) + ), + + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("${startDate} ~ ${endDate}", + style:TextStyle( + fontSize: 12, + color:Color(0xff333333), + ) + ) + ), + + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("${price}", + style:TextStyle( + fontSize: 12, + color:Color(0xff333333), + ) + ) + ), + + ], + ), + ), + ], + ), + ], + ) + ), + + Spacer(), + + Container( + margin: EdgeInsets.only(bottom: 30.0), + + child: new ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(mainColor), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + ), + child: new Text( + '삭제하기', + style: new TextStyle( + fontSize: 18.0, + color: Color(0xffFFFFFF), + ), + ), + onPressed: () => {}, + ), + height: 45, + ), + + ], + ), + ) + ), + ); + } +} diff --git a/lib/Party/party_detail_writerview.dart b/lib/Party/party_detail_writerview.dart index fba56ee..9f2251a 100644 --- a/lib/Party/party_detail_writerview.dart +++ b/lib/Party/party_detail_writerview.dart @@ -2,14 +2,14 @@ import 'package:flutter/material.dart'; import '../color.dart'; -class PartyMainPage extends StatefulWidget { - const PartyMainPage({Key? key}) : super(key: key); +class PartyDetailWriterPage extends StatefulWidget { + const PartyDetailWriterPage({Key? key}) : super(key: key); @override - State createState() => _PartyMainPageState(); + State createState() => _PartyDetailWriterPageState(); } -class _PartyMainPageState extends State { +class _PartyDetailWriterPageState extends State { final List isEnabled = [true, true, true, true, true, true, true, true]; @@ -22,7 +22,7 @@ class _PartyMainPageState extends State { String endDate = "2022-12-31"; String price = "4,250"; int maxPeople = 3; - int curPeople = 0; + int curPeople = 1; void disableElevatedButton(int index) { //isEnabled[index] = false;