-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat/#3 : 대회페이지 구현
- Loading branch information
Showing
25 changed files
with
2,192 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class Event { | ||
final String eventId; | ||
final String thumbnail; | ||
final String title; | ||
final String smallTitle; | ||
final String startDate; | ||
final String endDate; | ||
|
||
Event({ | ||
required this.eventId, | ||
required this.thumbnail, | ||
required this.title, | ||
required this.smallTitle, | ||
required this.startDate, | ||
required this.endDate, | ||
}); | ||
} | ||
|
||
// 하드코딩된 이벤트 데이터 | ||
final Event hardcodedEvent = Event( | ||
eventId: '1', | ||
thumbnail: 'https://example.com/image.jpg', // 적절한 이미지 URL 사용 | ||
title: '가톨릭대학교 총장배', | ||
smallTitle: '가톨릭대학교 체육관', | ||
startDate: '2023-01-01', | ||
endDate: '2023-01-31', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:get/get.dart'; | ||
import '../controller/create_controller.dart'; | ||
|
||
class CreateBinding implements Bindings { | ||
@override | ||
void dependencies() { | ||
Get.put(CreateController()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:get/get.dart'; | ||
|
||
class CreateController extends GetxController { | ||
RxString tournamentName = ''.obs; | ||
RxString tournamentDate = ''.obs; | ||
RxString tournamentLocation = ''.obs; | ||
RxString tournamentTeam = ''.obs; | ||
RxString tournamentHead = ''.obs; | ||
|
||
void setTournamentName(String name) { | ||
tournamentName.value = name; | ||
} | ||
|
||
void setTournamentDate(String date) { | ||
tournamentDate.value = date; | ||
} | ||
void setTournamentLocation(String location) { | ||
tournamentLocation.value = location; | ||
} | ||
void setTournamentTeam(String team) { | ||
tournamentTeam.value = team; | ||
} | ||
void setTournamentHead(String head) { | ||
tournamentHead.value = head; | ||
} | ||
|
||
@override | ||
void onInit() { | ||
super.onInit(); | ||
} | ||
|
||
// 필요한 다른 메서드들... | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
import '../../../util/components/global_app_bar.dart'; | ||
import '../../../util/components/global_modal.dart'; | ||
import '../../../util/const/style/global_color.dart'; | ||
import '../../../util/const/style/global_text_styles.dart'; | ||
import '../../event/view/event_view.dart'; | ||
import '../../match/view/match_view.dart'; | ||
import '../controller/create_controller.dart'; | ||
|
||
class CreateTournamentScreen extends StatelessWidget { | ||
final CreateController controller = Get.put(CreateController()); | ||
|
||
CreateTournamentScreen({Key? key}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
// 아이콘 디렉토리 | ||
final String iconDir = "assets/icons/"; | ||
|
||
// 텍스트 컨트롤러들 | ||
return Scaffold( | ||
appBar: CommonAppBar.basic("대회 생성"), | ||
body: SingleChildScrollView( // SingleChildScrollView 추가 | ||
child: Padding( | ||
padding: EdgeInsets.all(16.w), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, // 왼쪽으로 정렬 | ||
children: <Widget>[ | ||
SizedBox(height: 10.h), | ||
Text( | ||
"대회명", | ||
style: AppTextStyles.L1Medium13, | ||
), | ||
SizedBox(height: 10.h), | ||
CupertinoTextField( | ||
// 대회명 입력 필드 | ||
controller: TextEditingController(text: controller.tournamentName.value), | ||
placeholder: '대회명을 입력해주세요', | ||
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 12.w), | ||
decoration: BoxDecoration( | ||
color: AppColors.white, | ||
borderRadius: BorderRadius.circular(8.r), | ||
border: Border.all(color: AppColors.grey1), | ||
), | ||
cursorColor: AppColors.black, | ||
style: AppTextStyles.T1Bold13.copyWith(color: AppColors.grey8), | ||
), | ||
SizedBox(height: 26.h), | ||
Text( | ||
"대회 기간", | ||
style: AppTextStyles.L1Medium13, | ||
), | ||
SizedBox(height: 10.h), | ||
CupertinoTextField( | ||
// 대회 기간 입력 필드 | ||
controller: TextEditingController(text: controller.tournamentDate.value), | ||
placeholder: '대회 기간을 입력해주세요', | ||
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 12.w), | ||
decoration: BoxDecoration( | ||
color: AppColors.white, | ||
borderRadius: BorderRadius.circular(8.r), | ||
border: Border.all(color: AppColors.grey1), | ||
), | ||
cursorColor: AppColors.black, | ||
style: AppTextStyles.T1Bold13.copyWith(color: AppColors.grey8), | ||
), | ||
SizedBox(height: 26.h), | ||
Text( | ||
"대회 장소", | ||
style: AppTextStyles.L1Medium13, | ||
), | ||
SizedBox(height: 10.h), | ||
CupertinoTextField( | ||
// 대회 기간 입력 필드 | ||
controller: TextEditingController(text: controller.tournamentLocation.value), | ||
placeholder: '대회 장소를 입력해주세요', | ||
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 12.w), | ||
decoration: BoxDecoration( | ||
color: AppColors.white, | ||
borderRadius: BorderRadius.circular(8.r), | ||
border: Border.all(color: AppColors.grey1), | ||
), | ||
cursorColor: AppColors.black, | ||
style: AppTextStyles.T1Bold13.copyWith(color: AppColors.grey8), | ||
), | ||
SizedBox(height: 26.h), | ||
Text( | ||
"동아리 명", | ||
style: AppTextStyles.L1Medium13, | ||
), | ||
SizedBox(height: 10.h), | ||
CupertinoTextField( | ||
// 대회 기간 입력 필드 | ||
controller: TextEditingController(text: controller.tournamentTeam.value), | ||
placeholder: '동아리 명을 입력해주세요', | ||
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 12.w), | ||
decoration: BoxDecoration( | ||
color: AppColors.white, | ||
borderRadius: BorderRadius.circular(8.r), | ||
border: Border.all(color: AppColors.grey1), | ||
), | ||
cursorColor: AppColors.black, | ||
style: AppTextStyles.T1Bold13.copyWith(color: AppColors.grey8), | ||
), | ||
SizedBox(height: 26.h), | ||
Text( | ||
"대표자 명", | ||
style: AppTextStyles.L1Medium13, | ||
), | ||
SizedBox(height: 10.h), | ||
CupertinoTextField( | ||
// 대회 기간 입력 필드 | ||
controller: TextEditingController(text: controller.tournamentHead.value), | ||
placeholder: '대표자 명을 입력해주세요', | ||
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 12.w), | ||
decoration: BoxDecoration( | ||
color: AppColors.white, | ||
borderRadius: BorderRadius.circular(8.r), | ||
border: Border.all(color: AppColors.grey1), | ||
), | ||
cursorColor: AppColors.black, | ||
style: AppTextStyles.T1Bold13.copyWith(color: AppColors.grey8), | ||
), | ||
SizedBox(height: 16.h), | ||
// 기타 위젯들... | ||
Padding( | ||
padding: EdgeInsets.symmetric(vertical: 24.h), | ||
child: Row( | ||
children: [ | ||
Expanded( // 버튼의 가로 크기를 확장합니다. | ||
child: ElevatedButton( | ||
onPressed: () { | ||
// CommonDialog 모달 표시 | ||
showDialog( | ||
context: context, | ||
builder: (BuildContext context) { | ||
return CommonDialog( | ||
title: "대회 신청 확인", | ||
subtitle: "대회에 신청하시겠습니까?", | ||
onGrant: () async { | ||
// 확인 버튼을 눌렀을 때의 작업 | ||
Get.to(() => const MatchScreen()); | ||
}, | ||
grantText: "확인", | ||
); | ||
}, | ||
); | ||
}, | ||
style: ElevatedButton.styleFrom( | ||
primary: Colors.blue, | ||
padding: EdgeInsets.symmetric(vertical: 12.h), | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(20), | ||
), | ||
), | ||
child: Text( | ||
"신청하기", | ||
style: TextStyle( | ||
fontSize: 16.sp, | ||
color: Colors.white, | ||
), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
// 기타 위젯들... | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
|
||
// AppColors, AppTextStyles 등 필요한 스타일을 정의합니다. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,73 @@ | ||
import 'package:carousel_slider/carousel_slider.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:match/modules/event/widget/event_widget.dart'; | ||
// import 'package:match/provider/api/util/pagination_function.dart'; | ||
import 'package:match/util/const/style/global_text_styles.dart'; | ||
|
||
// import '../../../provider/api/util/global_api_field.dart'; | ||
import '../../../util/components/global_app_bar.dart'; | ||
import '../../../util/components/global_widget.dart'; | ||
// import '../../../util/const/style/global_logger.dart'; | ||
// import '../../../util/const/style/global_skeleton.dart'; | ||
import '../controller/event_controller.dart'; | ||
|
||
///<h2>이벤트 화면</h2> | ||
///이벤트 탭을 눌렀을때 나오는 화면 | ||
class EventScreen extends GetView<EventController> { | ||
const EventScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Text('event'), | ||
appBar: CommonAppBar.basic("진행중인 경기"), | ||
body: SafeArea( | ||
child: Column( | ||
children: [ | ||
///*1.제목 header | ||
// Padding( | ||
// padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 8.h) | ||
// .copyWith(bottom: 17.h), | ||
// child: Row( | ||
// mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
// children: [ | ||
// Text( | ||
// "진행중인 경기", | ||
// style: AppTextStyles.T1Bold16, | ||
// textAlign: TextAlign.center, | ||
// ), | ||
// // alarmButton() | ||
// ], | ||
// ), | ||
// ), | ||
|
||
///*2. event body | ||
///carousel slider로 구성 | ||
Expanded( | ||
child: Container( | ||
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 8.h) | ||
.copyWith(bottom: 17.h), | ||
width: double.infinity, | ||
height: double.infinity, | ||
child: CarouselSlider.builder( | ||
itemCount: 5, // 예시로 5개의 위젯을 표시합니다. | ||
itemBuilder: (context, index, realIndex) { | ||
// EventWidget 호출을 하드코딩된 데이터로 수정합니다. | ||
return EventWidget(); // 여기서 event 매개변수를 제거했습니다. | ||
}, | ||
options: CarouselOptions( | ||
autoPlay: false, | ||
aspectRatio: 299.w / 445.h, | ||
viewportFraction: 1, | ||
scrollDirection: Axis.vertical, | ||
), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.