-
Notifications
You must be signed in to change notification settings - Fork 2
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
#8 Feat: 화면 UI, 라우팅
- Loading branch information
Showing
12 changed files
with
535 additions
and
91 deletions.
There are no files selected for viewing
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
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,12 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
double getScreenWidth(BuildContext context) { | ||
return MediaQuery.of(context).size.width; | ||
} | ||
|
||
class FontSize { | ||
// 전부 임시값들임 | ||
static const double primary = menuName; | ||
static const double content = 18; | ||
static const double menuName = 22; | ||
} |
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,56 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:unibond/util/validator_util.dart'; | ||
import 'package:unibond/widgets/custom_text_form_field.dart'; | ||
import 'package:unibond/widgets/custom_textarea.dart'; | ||
import 'package:unibond/widgets/custon_elevated_button.dart'; | ||
|
||
class UpdateScreen extends StatelessWidget { | ||
final _formKey = GlobalKey<FormState>(); | ||
UpdateScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
centerTitle: true, | ||
title: const Text('게시물 수정'), | ||
leading: IconButton( | ||
icon: const Icon(Icons.arrow_back_ios), | ||
onPressed: () { | ||
Get.back(); | ||
}, | ||
), | ||
), | ||
body: Padding( | ||
padding: const EdgeInsets.all(16.0), | ||
child: Form( | ||
key: _formKey, | ||
child: ListView( | ||
children: [ | ||
CustomTextFormField( | ||
hint: "제목", | ||
funvalidator: validateTitle, | ||
value: "하하 이것은 나중에 서버에서 받아올 제목이야.", | ||
), | ||
CustomTextArea( | ||
hint: "내용", | ||
funvalidator: validateContent, | ||
value: "나중에 서버에서 받아올 내용. 나는 배가 고파요. " * 10, | ||
), | ||
CustomElevatedButton( | ||
text: "수정 완료", | ||
screenRoute: () { | ||
if (isValid(_formKey)) { | ||
// TODO: 추후 GetX Obs 기능 사용해서 이전 화면 갱신하기 | ||
Get.back(); | ||
} | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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,48 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:unibond/screens/home_screen.dart'; | ||
import 'package:unibond/util/validator_util.dart'; | ||
import 'package:unibond/widgets/custom_text_form_field.dart'; | ||
import 'package:unibond/widgets/custom_textarea.dart'; | ||
import 'package:unibond/widgets/custon_elevated_button.dart'; | ||
|
||
class WriteScreen extends StatelessWidget { | ||
final _formKey = GlobalKey<FormState>(); | ||
WriteScreen({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
centerTitle: true, | ||
title: const Text('게시물 작성'), | ||
leading: IconButton( | ||
icon: const Icon(Icons.arrow_back_ios), | ||
onPressed: () { | ||
Get.back(); | ||
}, | ||
), | ||
), | ||
body: Padding( | ||
padding: const EdgeInsets.all(16.0), | ||
child: Form( | ||
key: _formKey, | ||
child: ListView( | ||
children: [ | ||
CustomTextFormField(hint: "제목", funvalidator: validateTitle), | ||
CustomTextArea(hint: "내용", funvalidator: validateContent), | ||
CustomElevatedButton( | ||
text: "작성 완료", | ||
screenRoute: () { | ||
if (isValid(_formKey)) { | ||
Get.off(() => const HomeScreen()); | ||
} | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.