Skip to content

Commit

Permalink
๐ŸŽจ Design : ๋กœ๊ทธ์ธ, ํšŒ์›๊ฐ€์ž… ๋ฐฐ๊ฒฝ ํฐ์ƒ‰
Browse files Browse the repository at this point in the history
  • Loading branch information
seochan99 committed Apr 11, 2024
1 parent 88ed4b2 commit fddf114
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 58 deletions.
65 changes: 34 additions & 31 deletions lib/views/auth/email_login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,40 @@ class EmailLoginScreen extends StatelessWidget {
appBar: AppBar(
title: Text("email_login_2".tr),
),
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Form(
// ํ‚ค ๊ฐ’์„ ViewModel์—์„œ ๊ฐ€์ ธ์˜ด
key: controller.formKey,
child: Column(
children: [
TextFormField(
controller: controller.emailController,
decoration: InputDecoration(hintText: 'email'.tr),
validator: (value) => controller.emailValidator(value),
),
TextFormField(
controller: controller.passwordController,
obscureText: true,
decoration: InputDecoration(hintText: 'password'.tr),
validator: (value) => controller.passwordValidator(value),
),
const SizedBox(height: 20),
ElevatedButton(
// ๋กœ๊ทธ์ธ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
onPressed: controller.signInWithEmailAndPassword,
child: Text('login'.tr),
),
const SizedBox(height: 10),
// ํšŒ์›๊ฐ€์ž… ํ™”๋ฉด์œผ๋กœ ์ด๋™
TextButton(
onPressed: () => Get.to(() => const EmailSignupScreen()),
child: Text("go_signup".tr),
),
],
body: Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Form(
// ํ‚ค ๊ฐ’์„ ViewModel์—์„œ ๊ฐ€์ ธ์˜ด
key: controller.formKey,
child: Column(
children: [
TextFormField(
controller: controller.emailController,
decoration: InputDecoration(hintText: 'email'.tr),
validator: (value) => controller.emailValidator(value),
),
TextFormField(
controller: controller.passwordController,
obscureText: true,
decoration: InputDecoration(hintText: 'password'.tr),
validator: (value) => controller.passwordValidator(value),
),
const SizedBox(height: 20),
ElevatedButton(
// ๋กœ๊ทธ์ธ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
onPressed: controller.signInWithEmailAndPassword,
child: Text('login'.tr),
),
const SizedBox(height: 10),
// ํšŒ์›๊ฐ€์ž… ํ™”๋ฉด์œผ๋กœ ์ด๋™
TextButton(
onPressed: () => Get.to(() => const EmailSignupScreen()),
child: Text("go_signup".tr),
),
],
),
),
),
),
Expand Down
57 changes: 30 additions & 27 deletions lib/views/auth/email_signup_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,36 @@ class EmailSignupScreen extends StatelessWidget {
appBar: AppBar(
title: Text("email_signup".tr),
),
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Form(
// ํ‚ค ๊ฐ’์„ ViewModel์—์„œ ๊ฐ€์ ธ์˜ด
key: controller.formKey,
child: Column(
children: [
TextFormField(
// ์ด๋ฉ”์ผ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
controller: controller.emailController,
decoration: InputDecoration(hintText: 'email'.tr),
validator: (value) => controller.emailValidator(value),
),
TextFormField(
// ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
controller: controller.passwordController,
obscureText: true,
decoration: InputDecoration(hintText: 'password'.tr),
validator: (value) => controller.passwordValidator(value),
),
const SizedBox(height: 20),
ElevatedButton(
// ํšŒ์›๊ฐ€์ž… ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
onPressed: controller.registerWithEmailAndPassword,
child: Text('signup'.tr),
),
],
body: Container(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Form(
// ํ‚ค ๊ฐ’์„ ViewModel์—์„œ ๊ฐ€์ ธ์˜ด
key: controller.formKey,
child: Column(
children: [
TextFormField(
// ์ด๋ฉ”์ผ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
controller: controller.emailController,
decoration: InputDecoration(hintText: 'email'.tr),
validator: (value) => controller.emailValidator(value),
),
TextFormField(
// ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
controller: controller.passwordController,
obscureText: true,
decoration: InputDecoration(hintText: 'password'.tr),
validator: (value) => controller.passwordValidator(value),
),
const SizedBox(height: 20),
ElevatedButton(
// ํšŒ์›๊ฐ€์ž… ๋ฉ”์†Œ๋“œ ํ˜ธ์ถœ
onPressed: controller.registerWithEmailAndPassword,
child: Text('signup'.tr),
),
],
),
),
),
),
Expand Down

0 comments on commit fddf114

Please sign in to comment.