Skip to content

Commit

Permalink
feat: #8 파티원 상세 페이지(글 미작성자)
Browse files Browse the repository at this point in the history
  • Loading branch information
whaeundo25 committed Nov 5, 2022
1 parent fce0076 commit 9e18049
Show file tree
Hide file tree
Showing 3 changed files with 278 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/Login/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class _LoginPageState extends State<LoginPage> {

// 임시 이동
Navigator.pop(context);

Navigator.push(
context,
MaterialPageRoute(builder: (context) => tabBarMainPage()),
Expand Down
273 changes: 273 additions & 0 deletions lib/Party/party_detail_nonwriterview.dart
Original file line number Diff line number Diff line change
@@ -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<PartyDetailNonWriterPage> createState() => _PartyDetailNonWriterPageState();
}

class _PartyDetailNonWriterPageState extends State<PartyDetailNonWriterPage> {

final List <bool> isEnabled = <bool>[true, true, true, true, true, true, true, true];

final List<String> userName = <String>["손님1", "손님2", "손님3"];
final List<String> userPhone = <String>["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<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('모집 완료'),
content: const Text('모집이 완료되었습니다.'),
actions: <Widget>[
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,
),

],
),
)
),
);
}
}
10 changes: 5 additions & 5 deletions lib/Party/party_detail_writerview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<PartyMainPage> createState() => _PartyMainPageState();
State<PartyDetailWriterPage> createState() => _PartyDetailWriterPageState();
}

class _PartyMainPageState extends State<PartyMainPage> {
class _PartyDetailWriterPageState extends State<PartyDetailWriterPage> {

final List <bool> isEnabled = <bool>[true, true, true, true, true, true, true, true];

Expand All @@ -22,7 +22,7 @@ class _PartyMainPageState extends State<PartyMainPage> {
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;
Expand Down

0 comments on commit 9e18049

Please sign in to comment.